<< 04-09-2021 >>

00:00:03*stkrdknmibalz quit (*.net *.split)
00:00:03*nrds quit (*.net *.split)
00:00:03*supakeen quit (*.net *.split)
00:00:03*arkurious quit (*.net *.split)
00:00:03*byanka quit (*.net *.split)
00:00:03*asd quit (*.net *.split)
00:00:14*nrds joined #nim
00:00:25*byanka joined #nim
00:00:25FromDiscord<Elegantbeef> Shame that mcguy died before they could see my helper code
00:00:37PersonMcGuyOh I'm still in and I saw it
00:00:54PersonMcGuyA lot of it looks pretty helpful, so I'll probably use it
00:01:18PersonMcGuyI'm still trying to reason about my example code and finding out that it might not be as practical as I had thought
00:01:20FromDiscord<Elegantbeef> Just fix the off by one
00:02:00*arkurious joined #nim
00:03:08*supakeen joined #nim
00:05:18*asd joined #nim
00:12:35NimEventerNew thread by Alexeypetrushin: Is there a way to get value as if it's reference and update it's value?, see https://forum.nim-lang.org/t/8394
00:18:01*Pyautogui joined #nim
00:20:27PersonMcGuyhttps://hastebin.com/edanuhutoq.md
00:21:09PersonMcGuyI was thinking about something like this, so that I handle data as seqs
00:21:34FromDiscord<Elegantbeef> Well this is broken but yea this stuff works
00:22:56PersonMcGuythen when I need to overwrite the data directly, just iterate through the seq and write back to the ptr
00:23:11PersonMcGuyOh it is? It compile on my local. What's wrong?
00:25:10*auxym_ quit (Ping timeout: 240 seconds)
00:28:54FromDiscord<Elegantbeef> It works cause you use an array
00:28:54FromDiscord<Elegantbeef> If test was a sequence it'd error
00:28:55FromDiscord<Elegantbeef> https://hastebin.com/ujenujexol.md should be a better method of both
00:28:55FromDiscord<Elegantbeef> Though still the `toUa` is questionable since if the sequence grows larger than it's capacity that UA is pointing at dangling
00:31:06PersonMcGuyI'm wondering if I should just bite the bullet and deal with everything as byte arrays. What would you do?
00:31:35FromDiscord<impbox [ftsf]> not use byte arrays
00:31:54FromDiscord<Elegantbeef> Depends on what the API does/wants
00:32:05FromDiscord<Elegantbeef> If i can use the safer code i'd use it, if i cannot i'd not
00:33:07FromDiscord<Elegantbeef> Like in the case of using this code talking to a C library, if it holds onto the pointer and does stuff with it after you modify it, you've now got a chance of dangling pointers
00:33:15PersonMcGuyYeah, using byte arrays makes me feel grimy
00:33:29FromDiscord<Elegantbeef> As it should 😀
00:34:31FromDiscord<Elegantbeef> If you can use sequences it'd be better for your sanity
00:42:40NimEventerNew thread by Upholstered: Choosenim installs older stable?, see https://forum.nim-lang.org/t/8395
00:53:27*Pyautogui quit (Ping timeout: 245 seconds)
00:56:20*Pyautogui joined #nim
00:59:25FromDiscord<Varriount> You really only use unchecked arrays when defining C/C++ types, or when performing raw memory allocation.
00:59:54FromDiscord<Elegantbeef> Yea and they're interacting with a C sdk afaik
00:59:56FromDiscord<Elegantbeef> Solana sdk or w/e
01:03:31*Pyautogui quit (Quit: Connection closed)
01:14:58*neurocyte3 joined #nim
01:14:58*neurocyte3 quit (Changing host)
01:14:58*neurocyte3 joined #nim
01:17:25*neurocyte quit (Ping timeout: 252 seconds)
01:17:25*neurocyte3 is now known as neurocyte
01:23:21*sagax joined #nim
01:39:47*emery quit (Ping timeout: 240 seconds)
01:41:00*emery joined #nim
01:54:54FromDiscord<Gumber aka Zachary Carter> Is the playground down?
01:57:21FromDiscord<Elegantbeef> Seems that way
01:58:42*Gustavo6046 quit (Remote host closed the connection)
01:59:35FromDiscord<impbox [ftsf]> no play today D:
02:00:23FromDiscord<Gumber aka Zachary Carter> doh well
02:01:04*Gustavo6046 joined #nim
02:32:46*arkurious quit (Quit: Leaving)
03:05:41FromDiscord<Goat> I wanted to have interactive tables like this on the online version of the rulebook for my personal rpg. This led me into making a small lib for rolling digital dice on the tables. https://media.discordapp.net/attachments/371759389889003532/883548337704435762/simplescreenrecorder.mp4
03:08:05FromDiscord<Goat> This led me into a rabbit hole because my own dice rolling proc wasn't good enough, so I looked at another library called polydice. Polydice didn't have a few features I needed and now I'm expanding it to implement them. Like rolling multiple different dice at once and doing multiplications and divisions https://media.discordapp.net/attachments/371759389889003532/883548946235002911/unknown.png
03:10:04FromDiscord<Goat> Coding is a hell of a drug
03:36:29*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
03:43:12NimEventerNew question by Alex Craft: Nim varargs in template?, see https://stackoverflow.com/questions/69052244/nim-varargs-in-template
03:45:51*Gustavo6046 joined #nim
04:06:02*supakeen quit (Quit: WeeChat 3.2)
04:06:30*supakeen joined #nim
04:07:17NimEventerNew question by Alex Craft: Why strange operator precedence in Nim macro?, see https://stackoverflow.com/questions/69052327/why-strange-operator-precedence-in-nim-macro
04:08:58*PersonMcGuy quit (Quit: Client closed)
04:11:16*perro joined #nim
04:21:26FromDiscord<Gumber aka Zachary Carter> man every time I go to do cpp interop I have to re-remember how to represent classes and call methods
04:21:34FromDiscord<Gumber aka Zachary Carter> one day I'll remember...
04:21:45FromDiscord<Elegantbeef> Or you wont make CPP bindings 😛
04:21:52FromDiscord<Gumber aka Zachary Carter> psh
04:22:04FromDiscord<Gumber aka Zachary Carter> I don't think that is even possible
04:22:05FromDiscord<Elegantbeef> That was me with MD links for a long time
04:22:30FromDiscord<Gumber aka Zachary Carter> certain libraries just don't have C APIs
04:22:32FromDiscord<Gumber aka Zachary Carter> much less Nim APIs
04:22:45FromDiscord<Elegantbeef> Clearly that means they just arent worthwhile 🙂
04:22:49FromDiscord<Gumber aka Zachary Carter> Steam?
04:23:04FromDiscord<Elegantbeef> Did i stutter!
04:23:07FromDiscord<Gumber aka Zachary Carter> heh
04:23:17FromDiscord<Gumber aka Zachary Carter> I think you have too high of an opinion of Nim 🙂
04:23:18FromDiscord<Elegantbeef> Do you mean steamworks?
04:23:27FromDiscord<Elegantbeef> Or is there another "steam"
04:23:30FromDiscord<Gumber aka Zachary Carter> well yeah steamworks is the name of the sdk I think
04:23:44FromDiscord<Elegantbeef> Well treeform has bindings
04:23:54FromDiscord<Gumber aka Zachary Carter> yeah I don't want to use theirs
04:23:58FromDiscord<Elegantbeef> Ah
04:24:06FromDiscord<Gumber aka Zachary Carter> theirs are outdated and not correct
04:24:10FromDiscord<Gumber aka Zachary Carter> well not complete anyway
04:24:13FromDiscord<Gumber aka Zachary Carter> let me put it that way 🙂
04:24:49FromDiscord<Elegantbeef> You're going to get a message from him a guarantee it
04:25:10FromDiscord<Gumber aka Zachary Carter> yeah well they have bindings for literally everything
04:25:15FromDiscord<Gumber aka Zachary Carter> or a library for everything
04:25:55FromDiscord<Gumber aka Zachary Carter> currently I'm using zero just because I haven't found one that I needed / has had the complete feature set I've needed
04:26:07FromDiscord<Gumber aka Zachary Carter> the steamworks one is very incomplete
04:26:29FromDiscord<Elegantbeef> Yea it appeared so at a glance
04:26:35FromDiscord<Gumber aka Zachary Carter> and I'm also not a fan of the bindings in general
04:32:05NimEventerNew post on r/nim by h234sd: How to import module without creating constant with same name, see https://reddit.com/r/nim/comments/phkvs8/how_to_import_module_without_creating_constant/
04:46:29*nrds quit (Remote host closed the connection)
04:46:44*nrds joined #nim
05:49:37*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
05:53:38NimEventerNew thread by Alexeypetrushin: Questions about Nimble dependencies, see https://forum.nim-lang.org/t/8396
06:01:09*Gustavo6046 joined #nim
06:04:11*flynn quit (Read error: Connection reset by peer)
06:05:17*flynn joined #nim
06:19:40*Gustavo6046 quit (Remote host closed the connection)
06:19:59*Gustavo6046 joined #nim
06:28:55FromDiscord<codic> if I pipe my program, which uses echo to print stuff to stdout, to a process like head -n 5, it sigpipe's:
06:29:01FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3xTA
06:29:04FromDiscord<codic> expected behavior? any way to work around that?
06:29:55FromDiscord<codic> it does print stuff first to be fair
06:36:17FromDiscord<Rika> That means head closed the pipe before the program expected I believe
06:36:26FromDiscord<Rika> Or something like that
06:36:43FromDiscord<Rika> Basically it’s a signal for the sending program that the pipe has closed
06:42:19FromDiscord<codic> yeah but then I don't want it to sig pipe
06:42:24FromDiscord<codic> I guess I can register my own handler sure
07:36:40*flynn quit (Read error: Connection reset by peer)
07:37:47*flynn joined #nim
08:00:21*max22- joined #nim
08:34:06FromDiscord<tandy> does unittest work with the js backend?
08:38:26*supakeen quit (Remote host closed the connection)
08:38:51*supakeen joined #nim
08:44:36FromDiscord<tandy> nvm it seems to
09:31:21NimEventerNew post on r/nim by Marionberry_Unique: What's the idiomatic way of writing Nim code?, see https://reddit.com/r/nim/comments/phof07/whats_the_idiomatic_way_of_writing_nim_code/
09:56:13*flynn quit (Read error: Connection reset by peer)
09:57:20*flynn joined #nim
10:11:08*auxym_ joined #nim
10:23:28*xet7 quit (Remote host closed the connection)
10:38:07*jjido joined #nim
10:47:26*xet7 joined #nim
11:16:48*beshr quit (Remote host closed the connection)
11:19:10FromDiscord<lolgab> Hi! 🙂↵I'm trying to change the `gcc` that is used when you compile with `--cc:gcc`.↵I tried with `--gcc.exe:"my-file"` but it doesn't work. What should I use?
11:20:05FromDiscord<lolgab> (edit) "Hi! 🙂↵I'm trying to change the `gcc` that is used when you compile with `--cc:gcc`.↵I tried with `--gcc.exe:"my-file"` but it doesn't work. What should I use?" => "sent a long message, see http://ix.io/3xUE"
11:25:44FromDiscord<lolgab> Found it!↵I needed to set both `--gcc.exe` and `--gcc.linkerexe`
11:34:40*auxym_ quit (Ping timeout: 240 seconds)
11:40:04*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
11:49:17*jjido joined #nim
11:49:28*max22- quit (Ping timeout: 256 seconds)
12:06:02*supakeen quit (Quit: WeeChat 3.2)
12:06:31*supakeen joined #nim
12:11:25FromDiscord<whisperdev> I want to call this proc https://github.com/guzba/zippy/blob/692650becfd4d20a1ef180460051c2b1be9d3e38/src/zippy/ziparchives.nim#L306 but with a different argument to the compress method.What's the best way to go about it?
12:11:47FromDiscord<whisperdev> Should I just re-declare my own version of the proc?
12:13:11madpropscould ask the dev to add an option
12:32:50ZevvVarriount: you good now?
12:44:54*arkurious joined #nim
13:37:47*max22- joined #nim
13:50:02*flynn quit (Read error: Connection reset by peer)
13:51:10*flynn joined #nim
14:01:28*flynn quit (Read error: Connection reset by peer)
14:02:35*flynn joined #nim
15:25:45*Vladar joined #nim
15:37:01*auxym_ joined #nim
15:41:55*byanka quit (Remote host closed the connection)
15:42:34*byanka joined #nim
15:45:35*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
15:45:55*byanka quit (Remote host closed the connection)
15:47:08*byanka joined #nim
15:50:22*jjido joined #nim
15:50:25*byanka quit (Remote host closed the connection)
15:56:45FromDiscord<codic> how can I remove duplicate keys and values in a Table?
15:59:37FromDiscord<codic> different key, same value
16:07:44FromDiscord<Rika> that is somewhat complex to achieve
16:08:00*stkrdknmibalz joined #nim
16:20:11*flynn quit (Read error: Connection reset by peer)
16:21:18*flynn joined #nim
16:25:12FromDiscord<jos> hi
16:25:16FromDiscord<jos> is incremental compilation implemented yet?
16:25:23FromDiscord<jos> i see some RFC issue was closed but it's only like a PoC or something
16:25:35FromDiscord<jos> i'm rly curious how long the compile times are on larger projects
16:26:34FromDiscord<Rika> partially implemented afaik
16:28:34FromDiscord<jos> o ok
16:28:41FromDiscord<jos> i mean i guess that shouldn't sway my opinion too much then
16:28:43FromDiscord<jos> if there's movement on it
16:28:53FromDiscord<jos> by the time it matters to me it'll prolly be there
16:31:36FromDiscord<Rika> does treeform mind if i ping them or something? ive never really understood ping etiquette
16:31:39*flynn quit (Read error: Connection reset by peer)
16:32:26FromDiscord<Rika> i'll shoot anyway
16:32:45*flynn joined #nim
16:33:13FromDiscord<Rika> @treeform is there a reason on your `pixie` library theres like, one proc that returns a Vec2 (wh for Image) but all other procs dont take or return a Vec2? that makes it kinda annoying to deal with...
16:33:47*auxym_ quit (Ping timeout: 252 seconds)
16:33:57FromDiscord<Rika> i mean for `pixie/images`, other modules have Vec2 params
16:43:48*flynn quit (Read error: Connection reset by peer)
16:44:54*flynn joined #nim
16:58:04FromDiscord<dom96> if folks mind pings then they should disable them
16:58:10FromDiscord<dom96> so ping away
16:59:58FromDiscord<jos> if i have
17:00:08FromDiscord<jos> `main.nim folder/something_else.nim`
17:00:19FromDiscord<jos> and i don't want to use `include`
17:00:23FromDiscord<jos> how can i use `import`
17:00:23FromDiscord<jos> 🙂
17:00:25FromDiscord<jos> i am a beginner
17:01:12FromDiscord<jos> i'm struggling with how to declare a new module, what a module is by definition, i guess
17:01:27FromDiscord<jos> are files implicitly a module? is a folder a module? is a nimble file a declaration of a module?
17:01:31FromDiscord<jos> i read the docs but im still not rly sure
17:01:59FromDiscord<jos> ok nvm im an idiot i figured it out
17:02:00FromDiscord<jos> love u xx
17:04:29*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
17:11:24FromDiscord<Rika> Glad you figured it out lol
17:14:05*flynn quit (Read error: Connection reset by peer)
17:15:11*flynn joined #nim
17:24:01*flynn quit (Read error: Connection reset by peer)
17:24:37*auxym_ joined #nim
17:25:08*flynn joined #nim
17:41:26*flynn quit (Read error: Connection reset by peer)
17:42:39*flynn joined #nim
17:47:57FromDiscord<jos> does nim ORC invoke finalizer when the refcount hits 0?
17:48:01FromDiscord<jos> or is it possibly deferred
17:49:30FromDiscord<jos> "In fact, ORC can be seen as a generational and incremental GC with the additional guarantee that acyclic structures are freed as soon as they become garbage."
17:49:32FromDiscord<jos> does this mean what i think it means x
17:50:14FromDiscord<jos> and the { .acyclic } thing enforces at compile time that i won't have cycles?
17:50:29FromDiscord<jos> 🤯
17:54:31FromDiscord<leorize> no, `{.acyclic.}` means that you let the compiler assume that there is no cycle in your structure
17:54:44FromDiscord<leorize> it doesn't enforce anything since it can't analyze cycles at compile time
17:54:59FromDiscord<leorize> (if it can then we wouldn't need orc)
17:55:32FromDiscord<jos> oh ok
17:55:53FromDiscord<jos> that makes sense, i didn't think about it hard enough
17:55:53*flynn quit (Read error: Connection reset by peer)
17:56:22FromDiscord<jos> is there any way to configure nim to throw in debug builds if a cycle a detected? or something
17:56:25FromDiscord<jos> just so i'm not flying blind x
17:57:01*flynn joined #nim
17:57:52FromDiscord<jos> the thing is i'd like to leverage RAII for some of these ref objects but it doesn't seem possible (that's okay too)
17:59:22FromDiscord<leorize> orc works perfectly fine with destructors
17:59:33FromDiscord<leorize> but do remember that top-level variables are not destroyed
18:00:50FromDiscord<jos> hmm the thing says that only acyclic structures are freed as soon as they become garbage though
18:01:14*auxym_ quit (Ping timeout: 252 seconds)
18:01:14FromDiscord<jos> so if i accidentally create a cyclic structure, i'm assuming that means the finalizer will be deferred
18:01:27FromDiscord<jos> and if i don't have a way to detect that at runtime that's a little scary so i'm just checking in advance
18:01:33FromDiscord<jos> not a deal breaker but if someone knows that would be cool
18:02:47FromDiscord<leorize> the best way to not have a cyclic structure is to not use ref \:p
18:04:19FromDiscord<leorize> the other way is to make good use of `distinct` to apply compile-time constraints
18:07:06FromDiscord<jos> ok ill read up on that
18:07:09FromDiscord<jos> thanks for the help 🙂
18:22:04*kayabaNerve quit (Ping timeout: 252 seconds)
18:38:33*kayabaNerve joined #nim
18:59:52*jjido joined #nim
19:05:47*auxym_ joined #nim
19:10:12*beshr joined #nim
19:26:21NimEventerNew thread by Rbohl64: Calling Proc Variable Supported within Thread?, see https://forum.nim-lang.org/t/8398
19:51:40*auxym_ quit (Read error: No route to host)
19:51:58*auxym_ joined #nim
19:56:01NimEventerNew post on r/nim by Ether-naut: Pointer to a position in a sequence?, see https://reddit.com/r/nim/comments/phyfuk/pointer_to_a_position_in_a_sequence/
20:07:37*Figworm joined #nim
20:08:27*supakeen quit (Remote host closed the connection)
20:08:51*supakeen joined #nim
20:13:32*vicfred joined #nim
20:15:07*Figworm quit (Quit: Figworm)
20:20:44FromDiscord<aleclarson> How can I make a `TableRef` that points to an existing `Table`?
20:22:03FromDiscord<haxscramper> Copy existing table to a `ref` version, there is no other way
20:22:34FromDiscord<haxscramper> If you already have a `Table` you can take a pointer to it, but that's it
20:22:35*auxym_ quit (Ping timeout: 252 seconds)
20:23:00FromDiscord<haxscramper> value types are not directly convertible to ref types without copying the whole thing.
20:24:07*flynn quit (Read error: Connection reset by peer)
20:24:54FromDiscord<aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3xWV
20:25:13*flynn joined #nim
20:29:15*auxym_ joined #nim
20:33:42*Vladar quit (Quit: Leaving)
20:37:20NimEventerNew Nimble package! distorm3 - Nim wrapper for distorm3 - Powerful Disassembler Library For x86/AMD64, see https://github.com/ba0f3/distorm3.nim
20:37:23nrds<R2D299> itHub: 7"distorm3 disassembler wrapper for Nim"
20:37:40*auxym_ quit (Ping timeout: 240 seconds)
20:52:11*xet7 quit (Read error: Connection reset by peer)
20:52:25*xet7 joined #nim
21:04:03*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
21:12:20FromDiscord<rishavs (Rishav Sharan)> How can I give optional parameters in Nim?↵I believe I can use a sequence for this, but is there any other way?
21:13:40Zevvproc foo(a:int, b: int = 42)
21:13:49Zevvfoo(1)
21:18:30FromDiscord<Elegantbeef> Nim also has named parameter passing so for example with `proc foo(a, b, c = 100)` you can do `foo(c = 30)`
21:34:24FromDiscord<Zoom> Hey, g'day everybody. I'm out of the loop, just saw the new `channels` got deprecated. What's the current story? Was GordonBGood assigned with rewriting them?
21:38:50FromDiscord<konsumlamm> it didn't get deprecated, it just got removed again, because it isn't ready yet
21:39:34*flynn quit (Read error: Connection reset by peer)
21:40:16FromDiscord<konsumlamm> i don't think he was assigned
21:40:40*flynn joined #nim
21:42:36*kayabaNerve quit (Remote host closed the connection)
21:46:06*Guest68 joined #nim
21:46:31*Guest68 quit (Client Quit)
21:47:51*kayabaNerve joined #nim
21:49:53FromDiscord<Zoom> I remember seeing the dialogue between him an Ar@q somewhere on the forums... He said he's willing to rewrite channels and got a green light.
21:50:55FromDiscord<Zoom> I may be misremembering. Any way, was just interested if someone's actually working on it.
21:51:26*kayabaNerve quit (Remote host closed the connection)
21:51:50*kayabaNerve joined #nim
21:53:34*max22- quit (Quit: Leaving)
22:02:53*flynn quit (Read error: Connection reset by peer)
22:03:59*flynn joined #nim
22:29:40*flynn quit (Remote host closed the connection)
22:30:47*flynn joined #nim
22:57:25*kayabaNerve quit (Remote host closed the connection)
23:01:00*kayabaNerve joined #nim
23:42:48*auxym_ joined #nim