<< 12-04-2024 >>

00:05:09*def- quit (Quit: -)
00:26:19*def- joined #nim
00:30:42*def- quit (Client Quit)
00:31:59*def- joined #nim
00:35:39*def- quit (Client Quit)
00:36:28*def- joined #nim
00:44:45*krux02_ quit (Remote host closed the connection)
00:45:25*def- quit (Quit: -)
01:03:40*def- joined #nim
01:10:30FromDiscord<the_real_hypno> sent a code paste, see https://play.nim-lang.org/#pasty=hsAOwkAZwQqe
01:11:20FromDiscord<the_real_hypno> The goal is more or less to get rid of the "unnecessary" arguments and to return objects instead of bools
01:12:44FromDiscord<Elegantbeef> pass in the `result` as the `arg: pointer` then just do `cast[ptr seq[Process]](arg).add c[]` would work proper
01:13:16FromDiscord<the_real_hypno> eh
01:13:29FromDiscord<the_real_hypno> first i need to rebuild my brain after reading that
01:13:46FromDiscord<Elegantbeef> Your proc takes in a `pointer` which is type erased data
01:13:56FromDiscord<Elegantbeef> you can do `enumProcessImpl(ccb, result.addr)`
01:14:05FromDiscord<Elegantbeef> Then your internal proc adds to the result and you can call it a day
01:14:13FromDiscord<the_real_hypno> no way
01:14:13FromDiscord<the_real_hypno> sec
01:17:29FromDiscord<the_real_hypno> sent a code paste, see https://play.nim-lang.org/#pasty=XtnUznCYOxEX
01:17:49FromDiscord<Elegantbeef> Remove `result = s`
01:17:55FromDiscord<Elegantbeef> I don't even know where you're getting `s`
01:18:24FromDiscord<the_real_hypno> Ye well, thats the other issue, i couldnt properly allocate a internal seq[Process]
01:18:30FromDiscord<the_real_hypno> so its preallocated
01:18:54FromDiscord<Elegantbeef> Well now it'll work and be totally self contained
01:19:57FromDiscord<the_real_hypno> not yet it seems,
01:20:19FromDiscord<the_real_hypno> sent a code paste, see https://play.nim-lang.org/#pasty=RUrXMHfcrhXv
01:21:27FromDiscord<Elegantbeef> You need to dereference the pointer before add
01:22:55FromDiscord<the_real_hypno> Wow
01:23:12FromDiscord<the_real_hypno> sent a code paste, see https://play.nim-lang.org/#pasty=EwzalrDIQRgV
01:23:21FromDiscord<the_real_hypno> Cant admit that it can follow this but it works
01:23:26FromDiscord<sOkam! 🫐> beef, is it possible to pass keywords into `untyped` parameters and interpret them as strings into the template in someway?
01:23:35FromDiscord<the_real_hypno> Thank you!
01:23:41FromDiscord<Elegantbeef> `astToStr`
01:23:47FromDiscord<Elegantbeef> If you don't understand it read it until you do
01:24:14FromDiscord<sOkam! 🫐> ?
01:24:26*def- quit (Quit: -)
01:24:27FromDiscord<Elegantbeef> The `astToStr` was for you
01:24:33FromDiscord<Elegantbeef> The other comment was for hypnotoad here
01:24:45FromDiscord<sOkam! 🫐> kk, i was confused by the second. makes sense
01:24:57FromDiscord<the_real_hypno> Will do, i have 5 other Enums that need to be made more "nimmonisch" (yes that will be a thing)
01:25:59FromDiscord<Elegantbeef> You also probably can just use Nim's `bool` and disregard `boolt`
01:26:29FromDiscord<the_real_hypno> Its the same anyway. Apart from boolt being "True" instead of "True"
01:26:51FromDiscord<the_real_hypno> I need to remove most of the t's still
01:27:21FromDiscord<the_real_hypno> before it was lm_bool_t, which was a uint8 typedef
01:27:30FromDiscord<the_real_hypno> so its evolving
01:29:07FromDiscord<sOkam! 🫐> crap, `::` is reserved 😔
01:30:45FromDiscord<Elegantbeef> If by reserved you mean not an operator yes 😄
01:31:16FromDiscord<the_real_hypno> sent a code paste, see https://play.nim-lang.org/#pasty=pogsgINAQuBy
01:31:30FromDiscord<the_real_hypno> sent a code paste, see https://play.nim-lang.org/#pasty=nnyAyUCaqIEG
01:32:16FromDiscord<the_real_hypno> (edit) "https://play.nim-lang.org/#pasty=fuCHADOjPaqC" => "https://play.nim-lang.org/#pasty=jrQUANUPANEy"
01:32:32FromDiscord<the_real_hypno> (edit) "https://play.nim-lang.org/#pasty=XjvTwunJZTky" => "https://play.nim-lang.org/#pasty=yUzJpFGgLRlp"
01:33:01FromDiscord<the_real_hypno> (edit) "https://play.nim-lang.org/#pasty=WxvJdIzWANpV" => "https://play.nim-lang.org/#pasty=OjoirQNegmio"
01:34:41FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "If by reserved you": well, whatever it is... it doesn't let me use it as `template :: (arg1 :T1)` 😦
01:35:13FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=loYWMuwuvbUo
01:36:33FromDiscord<Elegantbeef> Oh I didn't think `:` was allowed in operators but it is
01:40:03FromDiscord<the_real_hypno> Oh i have anothe question. Could someone tell me what the usecase of procedure types are? I dont really understand what they would do. Considering my code from above i thought about doing the callback as a type but i couldnt figure out how to use it.
01:40:39FromDiscord<Elegantbeef> Procedure types are pointer procedures, this allows you to call specific behaviour at runtime
01:41:22FromDiscord<the_real_hypno> sent a code paste, see https://play.nim-lang.org/#pasty=vtgKZBSylcgO
01:41:34FromDiscord<the_real_hypno> how would i "use" (call) it?
01:41:41FromDiscord<Elegantbeef> You don't call it
01:41:44FromDiscord<Elegantbeef> It's a type not a value
01:41:59FromDiscord<Elegantbeef> You give the type to a parameter or variable and then you can call that
01:42:02FromDiscord<the_real_hypno> but what do a0 and a1 are then?
01:42:08FromDiscord<the_real_hypno> ah
01:42:12FromDiscord<Elegantbeef> They do nothing
01:42:25FromDiscord<Elegantbeef> you can do `_: A, _: B` if you wish
01:42:31FromDiscord<Elegantbeef> But it does document the type
01:44:02FromDiscord<the_real_hypno> sent a code paste, see https://play.nim-lang.org/#pasty=AaaMMAZCGvZN
01:44:11FromDiscord<Elegantbeef> yes
01:45:09*def- joined #nim
01:45:33FromDiscord<the_real_hypno> sent a code paste, see https://play.nim-lang.org/#pasty=aLyspUdnysCF
01:46:58FromDiscord<the_real_hypno> Makes sense i guess. I still cant really see a benefit here but thats probably because of limited imagination at this time of the day
01:47:17FromDiscord<the_real_hypno> Thanks anyway, REALLY helpful
01:48:05*def- quit (Client Quit)
01:49:43*def- joined #nim
02:05:17FromDiscord<Elegantbeef> The benefit is that it gives the programmer the ability to specify what happens inside code↵(@the_real_hypno)
02:05:30FromDiscord<Elegantbeef> you can have events and call the user provided callbacks
02:19:59*def- quit (Quit: -)
02:20:25*def- joined #nim
02:27:56*def- quit (Quit: -)
02:28:25*def- joined #nim
02:48:19*def- quit (Quit: -)
02:49:49FromDiscord<Robyn [She/Her]> Is the streams module a poor example of this?
02:50:13FromDiscord<Robyn [She/Her]> Or is it a fine example? Just wondering
02:51:03*def- joined #nim
02:57:12FromDiscord<Elegantbeef> Given that it uses pointer procs as interfaces I'd say it's meh, but ok
03:00:13*def- quit (Quit: -)
03:01:30*def- joined #nim
03:10:24*pbsds quit (Quit: The Lounge - https://thelounge.chat)
03:12:33*pbsds joined #nim
03:18:31*def- quit (Quit: -)
03:21:26*def- joined #nim
03:51:48FromDiscord<Robyn [She/Her]> Hey can anyone spot why this code isn't actually adding tokens to the tokens variable? https://play.nim-lang.org/#pasty=CkEMJEQiTtVL↵It's a basic lexer for testing, but for some reason after trying to view the output of the tokens in the list, seems to have nothing inputted despite the codepaths seeming to run
03:58:51FromDiscord<odexine> “While position is greater or equal to code length”
03:59:02FromDiscord<odexine> Never true
03:59:07FromDiscord<odexine> Lex never runs anything
03:59:50FromDiscord<odexine> @Robyn [She/Her]
04:05:15FromDiscord<Robyn [She/Her]> Aah okay, thank you!
04:06:00FromDiscord<Robyn [She/Her]> I forgot a 'not' :p
04:07:01FromDiscord<Robyn [She/Her]> Wait no I didn't
04:07:02FromDiscord<Robyn [She/Her]> What
04:07:41FromDiscord<Robyn [She/Her]> Why is `pos != code.len - 1` working but not `pos >= code.len`
04:07:59FromDiscord<Robyn [She/Her]> Wait no
04:08:02FromDiscord<Robyn [She/Her]> I did forget a not
04:08:07FromDiscord<Robyn [She/Her]> I have no reading comprehension rn
04:10:02*def- quit (Quit: -)
04:11:35FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=gRfzHYskgPsp
04:12:06FromDiscord<Robyn [She/Her]> Forgot a break
04:12:16FromDiscord<Robyn [She/Her]> It works now, yay
04:16:58*disso-peach quit (Quit: Leaving)
04:45:06*def- joined #nim
04:51:00*tiorock joined #nim
04:51:00*tiorock quit (Changing host)
04:51:00*tiorock joined #nim
04:51:00*rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services)))
04:51:00*tiorock is now known as rockcavera
04:54:38*tiorock joined #nim
04:54:38*rockcavera is now known as Guest2128
04:54:38*Guest2128 quit (Killed (copper.libera.chat (Nickname regained by services)))
04:54:38*tiorock is now known as rockcavera
04:54:51*def- quit (Quit: -)
04:55:34*def- joined #nim
04:58:53*def- quit (Client Quit)
05:03:18*def- joined #nim
05:07:47*rockcavera quit (Ping timeout: 264 seconds)
05:10:27*def- quit (Quit: -)
05:11:57*def- joined #nim
05:14:58*def- quit (Client Quit)
05:15:44*nazgulsenpai quit (Quit: ZNC 1.8.2 - https://znc.in)
05:16:17*def- joined #nim
05:18:05*rockcavera joined #nim
05:18:05*rockcavera quit (Changing host)
05:18:05*rockcavera joined #nim
05:18:35*nazgulsenpai joined #nim
05:19:33*def- quit (Client Quit)
05:20:02*tiorock joined #nim
05:20:02*rockcavera is now known as Guest3901
05:20:02*Guest3901 quit (Killed (osmium.libera.chat (Nickname regained by services)))
05:20:02*tiorock is now known as rockcavera
05:20:19*rockcavera quit (Read error: Connection reset by peer)
05:21:29*rockcavera joined #nim
05:21:29*rockcavera quit (Changing host)
05:21:29*rockcavera joined #nim
05:21:38*def- joined #nim
05:27:07*rockcavera quit (Read error: Connection reset by peer)
05:28:57*rockcavera joined #nim
05:36:36*tiorock joined #nim
05:36:36*rockcavera is now known as Guest8119
05:36:36*Guest8119 quit (Killed (osmium.libera.chat (Nickname regained by services)))
05:36:36*tiorock is now known as rockcavera
05:41:39*def- quit (Quit: -)
05:42:40anddamwhat is https://dpaste.com/5QWGLTJH9 supposted to do? Second python example at https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers
05:42:54anddamx/posted/ c/posed/
06:05:37*def- joined #nim
06:17:27*PMunch joined #nim
06:38:35*def- quit (Quit: -)
06:39:03*def- joined #nim
07:05:30*def- quit (Quit: -)
07:42:02FromDiscord<janakali> In reply to @anddam "what is https://dpaste.com/5QWGLTJH9 supposted": I believe it demonstrates that you need unintuitive workarounds (`nonlocal`) in python to use locally scoped variables
07:42:44FromDiscord<janakali> (edit) "In reply to @anddam "what is https://dpaste.com/5QWGLTJH9 supposted": I believe it demonstrates that you need unintuitive workarounds (`nonlocal`) in python to use locally scoped variables ... " added "(with same name as global variables)"
07:46:02*def- joined #nim
08:05:45*def- quit (Quit: -)
08:07:01*def- joined #nim
08:25:22FromDiscord<janakali> probably related to this issue: https://stackoverflow.com/questions/8447947/is-it-possible-to-modify-a-variable-in-python-that-is-in-an-outer-enclosing-b
08:32:27*def- quit (Quit: -)
08:34:32*def- joined #nim
08:46:39*def- quit (Quit: -)
08:47:15*def- joined #nim
08:52:31anddamhrmm will test it later, but I cannot see how that would even compile in python, my guess is the assert should go into a method not in the class attributes
08:59:30*def- quit (Quit: -)
08:59:59*def- joined #nim
09:04:39FromDiscord<ghostbuy_> TEEN/ONLYFANS PORN HERE JOIN NOW! :pizza::peach: https://discord.gg/pornox @everyone
09:05:08Amun-RaPMunch ^
09:06:15PMunchI was already on it :)
09:07:16PMunchCan't remove the message on IRC though
09:07:54Amun-Ra:pizza::peach: these emoji choices are always interesting
09:34:09*def- quit (Quit: -)
09:34:58*def- joined #nim
09:45:08anddamPMunch: well you shouldn't do onlyfans during office hours…
09:45:29anddamAmun-Ra: eh, they had my attention at pizza
09:45:48Amun-Raanddam: same here, not gonna lie
10:01:01*def- quit (Quit: -)
10:03:03*def- joined #nim
10:09:02*def- quit (Quit: -)
10:11:43*def- joined #nim
10:14:46*def- quit (Client Quit)
10:14:58*def- joined #nim
10:53:07*def- quit (Quit: -)
10:53:29*def- joined #nim
11:23:46*xet7 quit (Remote host closed the connection)
11:26:30*def- quit (Quit: -)
11:27:20*def- joined #nim
11:44:09FromDiscord<ayex> for writing a nim-js browser plugin that fills tedious forms,↵↵is there something similar/equivalent to python selenium's `driver.send_keys` ? 🤔
11:47:10*def- quit (Quit: -)
11:52:13*beholders_eye joined #nim
12:00:50FromDiscord<ayex> ok nvm, seems like I do not need to go via send\_keys equivalent. 🙂
12:07:08*def- joined #nim
12:10:08*def- quit (Client Quit)
12:13:45FromDiscord<ayex> but in the same context how would I translate this js line\:↵`inputElement.dispatchEvent(new Event("input"));`↵↵specifically the Event.Input to nim?
12:15:26FromDiscord<ayex> for `inputElement.dispatchEvent(Event(DomEvent.Input))` I get type mismatch error\:↵`Error: type mismatch: got 'DomEvent' for 'Input' but expected 'Event = ref Event:ObjectType'`
12:15:46*def- joined #nim
12:24:23FromDiscord<solitudesf> sent a code paste, see https://play.nim-lang.org/#pasty=YWIgKEdLJKkH
12:25:26FromDiscord<ayex> ah? [solitudesf](https://matrix.to/#/%40_discord_104136074569211904%3At2bot.io) thank! you let me try
12:26:46FromDiscord<dolfy0191> Hi there
12:26:57FromDiscord<ayex> yay compiles 🎉
12:27:06FromDiscord<dolfy0191> In nim is it possible to use name aliases for long names?
12:28:06FromDiscord<dolfy0191> something like↵let slp=myobject.somelongparam↵without copying?
12:29:02FromDiscord<grumblygibson> sent a code paste, see https://play.nim-lang.org/#pasty=FlKjasIyIScl
12:30:16FromDiscord<grumblygibson> That's often my favorite trick to make readable code until views becomes stable/better.
12:31:11FromDiscord<dolfy0191> perfect! thank you!
12:31:48FromDiscord<sOkam! 🫐> is there an inverse to `astToStr`, to get the ast from a string? 🤔
12:32:09FromDiscord<solitudesf> In reply to @heysokam "is there an inverse": https://nim-lang.org/docs/macros.html#parseStmt%2Cstring%2Cstring
12:32:27FromDiscord<sOkam! 🫐> oh... parse! wasn't finding it, tyty ✍️
12:32:42*nazgulsenpai quit (Quit: ZNC 1.8.2 - https://znc.in)
12:33:31FromDiscord<pmunch> sent a code paste, see https://play.nim-lang.org/#pasty=hafynFjVknik
12:33:33*nazgulsenpai joined #nim
12:34:05*beholders_eye quit (Ping timeout: 256 seconds)
12:36:05FromDiscord<dolfy0191> sent a code paste, see https://play.nim-lang.org/#pasty=pGzmZRVnJiqV
12:58:56FromDiscord<Robyn [She/Her]> In reply to @dolfy0191 "something like let slp=myobject.somelongparam": Have you looked at templates?
13:01:31FromDiscord<minamorl> Hi, i am very new to nim lang and wanna learn about how pragma works. is there any good reference?
13:08:09FromDiscord<windowssmece> i have 1 question, if i build a library in nim using noMemoryManagment, and import it in another project that uses ORC will that work and vice versa
13:11:32*beholders_eye joined #nim
13:16:28*def- quit (Quit: -)
13:32:44FromDiscord<sOkam! 🫐> In reply to @windowssmece "i have 1 ": you can do it, but you need to teach orc how to do the management with `destroy=` hooks and friends
13:33:09FromDiscord<ringabout> In reply to @minamorl "Hi, i am very": You can read the Nim manual => https://nim-lang.org/docs/manual.html or read the source code of the Nim compiler
13:33:59FromDiscord<ringabout> (edit) "https://nim-lang.org/docs/manual.html" => "https://nim-lang.org/docs/manual.html#pragmas"
13:34:06PMunchWell, if you have written a library which doesn't need automatic memory management then you can use it with automatic memory management turned on
13:34:11PMunchIt just won't do anything
13:34:20FromDiscord<sOkam! 🫐> (edit) "In reply to @windowssmece "i have 1 ": you can do it, but you need to teach orc how to do the management with `destroy=` hooks and friends" => "sent a long message, see https://pasty.ee/AjncrywDStQA"
13:34:39PMunchThe other way around of course is not as trivial
13:34:47FromDiscord<ringabout> (edit) "compiler" => "compiler; here is where pragmas are implemented https://github.com/nim-lang/Nim/blob/devel/compiler/pragmas.nim"
13:35:17*def- joined #nim
13:36:26FromDiscord<sOkam! 🫐> In reply to @minamorl "Hi, i am very": the just of it is that pragmas mark the identifier with specific functionality↵so "how pragmas work" is like asking "how multiple features work"↵they "tag" the identifier to be used in a certain way, so you need to reference each of the pragma's manual to understand what each of them do ✍️
13:38:10*def- quit (Client Quit)
13:41:09FromDiscord<minamorl> In reply to @heysokam "the just of it": ty for the clarification! ya i thought it was like so
13:41:30FromDiscord<minamorl> In reply to @ringabout "You can read the": thanks for sharing links !
13:43:04FromDiscord<minamorl> i didn’t recognize that nim itself is self-hosted
13:43:16FromDiscord<minamorl> (edit) "i didn’t recognize that nim itself is self-hosted ... " added "till now"
13:43:26FromDiscord<minamorl> cool
13:51:57FromDiscord<windowssmece> hm oke, 1 question are sets in nim determistic i know in c# default implmentaiton is not determistic
13:56:41*def- joined #nim
14:02:16FromDiscord<windowssmece> in nim we do not have any private public accessors right
14:13:37FromDiscord<odexine> In reply to @windowssmece "in nim we do": we can emulate them in nim
14:13:52FromDiscord<odexine> In reply to @windowssmece "hm oke, 1 question": not sure what you mean by this exactly, deterministic in what way?
14:22:32FromDiscord<jaar23> sent a code paste, see https://play.nim-lang.org/#pasty=lHsvVUjYirsO
14:22:41*def- quit (Quit: -)
14:23:25FromDiscord<jaar23> i tried it, didn't expect it would works, but it do works, i can do `obj.t.add()` and `obj.t.getOrDefault()` without error.
14:25:42*def- joined #nim
14:32:50*PMunch quit (Quit: Leaving)
14:35:17FromDiscord<solitudesf> In reply to @jaar23 "i have this object.": no, tables just have checks in their procedures to initialize them if they arent.
14:37:14FromDiscord<jaar23> In reply to @solitudesf "no, tables just have": so you mean, it is initialize when i call `add` instead?
14:38:01FromDiscord<ringabout> You example doesn't compile for me
14:38:09FromDiscord<solitudesf> In reply to @jaar23 "so you mean, it": yes
14:38:36FromDiscord<jaar23> In reply to @ringabout "You example doesn't compile": haha, i just type of psuedo-ly.
14:42:33FromDiscord<jaar23> sent a code paste, see https://play.nim-lang.org/#pasty=fIPiEdVtfwWb
14:44:16FromDiscord<ringabout> In reply to @jaar23 "haha, i just type": I thought you were talking about the type inference for generic object constructor
14:44:38FromDiscord<ringabout> Yeah, they are initialized since https://github.com/nim-lang/Nim/pull/11094
14:47:23FromDiscord<jaar23> ah, no. the generic object constructor will come later until i fix other issue 😅 ↵appreciate the table is initialize for me
14:57:15*def- quit (Quit: -)
15:02:30*xet7 joined #nim
15:09:28NimEventerNew thread by impras: How to migrate from Discourse to Nim Forum?, see https://forum.nim-lang.org/t/11423
15:15:00*def- joined #nim
15:43:48FromDiscord<windowssmece> In reply to @odexine "not sure what you": 2 pc runing same code different result, from what i know in c# hashing is using some float magic or something so it can break determistc
15:45:05*coldfeet joined #nim