<< 12-12-2022 >>

00:00:12FromDiscord<sOkam!> people go where people are
00:00:22FromDiscord<sOkam!> even if the place is shit 🤷‍♂️
00:06:10FromDiscord<Horizon [She/Her]> In reply to @Elegantbeef "And it's against their": Their ToS for custom clients or client modifications is a pain, agreed with that
00:06:11FromDiscord<Rika> Biggest reason I haven’t moved yeah
00:06:23FromDiscord<Horizon [She/Her]> In reply to @Rika "Biggest reason I haven’t": Same, Revolt is promising imo
00:06:40FromDiscord<Horizon [She/Her]> Just not many people using it, nor a reason for people to use it
00:09:03om3gahi! what may be the error_success: System error : The operation completed successfully. It's under windows
00:10:05om3gaI use sndfile bindings, so it tries to open wav file, sndfile.open
00:10:34FromDiscord<Rika> Sounds related to the library you’re using
00:10:44FromDiscord<Rika> So it’s likely those bindings you mentioned retiring them
00:10:46FromDiscord<Rika> Returning
00:10:47FromDiscord<huantian> Haha funny pun
00:10:55om3gaRika , it might be the reason!
00:10:56FromDiscord<Rika> In reply to @huantian "Haha funny pun": Unintended, fuck
00:11:09om3gaRika thanks!
00:11:40FromDiscord<Rika> It’s hard to tell where else it would be coming from, but I’ve never seen that outside of “bindings from windows”
00:11:44om3gait may be due to outdated dll
00:12:18om3gaI used it in win7, now compiled the code in win10
00:13:28om3gastupid error message....
00:14:32om3gawhy I see such things only in windows, error: no error
00:28:26FromDiscord<Yepoleb> do you not get a line number with your error?
00:35:26om3gayes, I know where that happens
00:36:14om3gaI will try to throw out that dll, and integrate the source of libsndfile into my binary
00:37:09om3galooks like sndfile is unable to open windows paths for some reason
00:37:29om3gaand sndfile.open() returns nil
00:38:22*adium joined #nim
00:46:53FromDiscord<albassort> I really think accessing registers which have not been reallocated but have been freed should be a read from nil error
00:47:48FromDiscord<albassort> Even if you can technically read data for the type you are casting it to
00:48:02FromDiscord<albassort> Or at least add this in -d to debug
00:50:43FromDiscord<albassort> In my current GC bug, I have a sequence of a type, and after I read a value from one of those objects, It sends the variable by reference down the iterator, to then be freed on the iteration
00:51:43FromDiscord<albassort> If I use that object again, and read the string, it would read ""
00:51:57FromDiscord<albassort> This should raise an assertion
00:52:05FromDiscord<albassort> Letting me know that something is wrong
00:52:31FromDiscord<albassort> In reply to @albassort "In my current GC": This being the root cause is conjecture, I'm trying to find it in GDB
00:57:44FromDiscord<Elegantbeef> The error you're mentioning should never happen with a GC
00:58:12FromDiscord<Elegantbeef> That error you're describing is a use after free and can only happen with either a bug or you incorrectly managing resources
01:04:14FromDiscord<Yepoleb> In reply to @albassort "I really think accessing": What do you mean by registers
01:04:48FromDiscord<Elegantbeef> I'm assuming they mean heap allocated data that has the reference count ==0
01:05:00FromDiscord<Elegantbeef> But they dont know how references work so said registers
01:05:03FromDiscord<Elegantbeef> Atleast that's my guess
01:05:13FromDiscord<albassort> Beef is correct
01:05:21FromDiscord<albassort> I don't know much about how gc works
01:06:10FromDiscord<albassort> In reply to @Elegantbeef "The error you're mentioning": Well of course it's a bug and how are we going to find a bug if it isn't reported to us
01:06:43FromDiscord<Yepoleb> Are you manually decreasing references?
01:07:04FromDiscord<Yepoleb> Or freeing memory
01:07:28FromDiscord<albassort> No manual memory management is being done
01:07:41FromDiscord<albassort> It only happens in orc and arc
01:08:21FromDiscord<albassort> I'm technically running some C code, quite a bit
01:08:38FromDiscord<albassort> But apart from that
01:09:27FromDiscord<Yepoleb> You could put a memory breakpoint on the refcount in gdb
01:10:13FromDiscord<Elegantbeef> What's probably happening is since orc/arc are more deterministic your C code is experiencing a use after free
01:10:24FromDiscord<albassort> What is a memory breakpoint, what is refcount
01:10:43FromDiscord<albassort> In reply to @Elegantbeef "What's probably happening is": This code here is quite a bit away from c code
01:10:48FromDiscord<albassort> Everything I'm describing is happening in him
01:10:54FromDiscord<albassort> (edit) "him" => "nim"
01:11:27FromDiscord<albassort> I would like to share a minimal example but I tried to make it, it didn't work, my project is over a thousand lines and has so much dependencies and I'm not ready to package it up yet
01:11:49FromDiscord<Elegantbeef> The only bug i can think of is with threads and if you share a resource across threads that's heap allocated(Threads fight over ownership) but that should result in a double free
01:12:21FromDiscord<albassort> In reply to @Elegantbeef "The only bug i": I'm using threads but threads are only updating a single pointer on the shared heap
01:12:25FromDiscord<Elegantbeef> Running the code with a memory sanitiser should work
01:12:33FromDiscord<Elegantbeef> `--mm:orc -d:useMalloc`
01:12:42FromDiscord<Yepoleb> In reply to @albassort "What is a memory": It's apparently called a watchpoint, the debugger stops execution when a variable is accessed
01:13:04FromDiscord<albassort> Ah, I could have used that many times
01:13:21FromDiscord<albassort> I'll do that in a minute
01:13:50FromDiscord<Yepoleb> And refcount is the reference counter, i don't know how to explain it further
01:14:27FromDiscord<Elegantbeef> Using valgrind with `-d:useMalloc --debugger:native --mm:orc` should point out where the issue is
01:18:03FromDiscord<albassort> it still exists with malloc and --mm:orc
01:18:06FromDiscord<albassort> going to start up valgrind
01:18:28FromDiscord<Elegantbeef> The point wasnt that it would disappear the point was you need those for valgrind to work 😄
01:18:42FromDiscord<albassort> just making sure >:O
01:18:57FromDiscord<Elegantbeef> Nim's default allocator does not work with valgrind, but malloc does
01:21:12FromDiscord<albassort> beef what options should i use for valgrind
01:21:34FromDiscord<Elegantbeef> `--tool=memcheck` i believe, though i think default valgrind also might work
01:21:55FromDiscord<albassort> hmm, well, what do I do after i replicate it i mean
01:22:01FromDiscord<albassort> ctrl-c doesn't really help
01:22:26FromDiscord<Elegantbeef> You run the program that exhibits the behaviour and valgrind will give diagnostics
01:23:12FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1051670522276098068/image.png
01:25:13FromDiscord<albassort> ran it again, but exploited the error more, and,no different in the leak
01:25:47FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iny
01:25:59FromDiscord<albassort> oh those
01:26:11FromDiscord<albassort> yea not getting those
01:26:30FromDiscord<Elegantbeef> Well then you likely dont have a use after free
01:27:24FromDiscord<Elegantbeef> You do have leaks though
01:27:38FromDiscord<Elegantbeef> But given you terminated the process that's probably the cause of that
01:27:48FromDiscord<albassort> well if the leak size is the same
01:27:51FromDiscord<albassort> then its not here
01:28:47FromDiscord<Elegantbeef> Well valgrind has not detected a use after free, which means whatever is happening is 'memory safe'
01:29:07FromDiscord<Elegantbeef> What is the current behaviour you're experiencing?
01:30:14FromDiscord<Elegantbeef> Oh right you already explained
01:30:42FromDiscord<Elegantbeef> > variable by reference down the iterator↵What do you mean by this
01:30:46FromDiscord<albassort> sent a long message, see http://ix.io/4inz
01:31:13FromDiscord<Elegantbeef> Ok so the issue is that an incorrect destructor is inserted
01:31:23FromDiscord<albassort> (edit) "http://ix.io/4inz" => "http://ix.io/4inA"
01:31:47FromDiscord<Elegantbeef> compile with `--expandArc:myIterator --mm:orc`
01:31:58FromDiscord<Elegantbeef> Actually that might not work
01:32:06FromDiscord<Elegantbeef> You may need to do `--expandArc:myProc --mm:orc`
01:32:36FromDiscord<albassort> should i put this into a proc
01:32:52FromDiscord<Elegantbeef> Well you need to call it inside a proc to expand arc on it
01:32:58FromDiscord<albassort> okkkk
01:33:27FromDiscord<Elegantbeef> Can i see the verbatim iterator?
01:34:09FromDiscord<albassort> the code is like 2% polished
01:35:03FromDiscord<Elegantbeef> I cannot tell if that's a no or a yes
01:36:54FromDiscord<albassort> i put it in a proc and its gone
01:37:03FromDiscord<albassort> :notLikeThis:
01:37:21FromDiscord<Elegantbeef> Welcome to move semantic global hell
01:38:09FromDiscord<Elegantbeef> There is still probably a bug so it'd be nice to actually see the code
01:38:25FromDiscord<Elegantbeef> Also i this #devel or stable?
01:38:29FromDiscord<Elegantbeef> If stable try devel
01:39:14FromDiscord<albassort> i was gonna try devel
01:39:24FromDiscord<albassort> because it mightve already been fixed
01:39:50FromDiscord<Elegantbeef> Yea, devel has a better algorithm for destructors iirc
01:42:36FromDiscord<albassort> cant compile on devel
01:42:37FromDiscord<albassort> neat
01:42:48FromDiscord<Elegantbeef> 2.0 will be fun
01:43:08FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4inB
01:43:14FromDiscord<albassort> cool
01:43:18FromDiscord<albassort> uhhhhhhhhhhhhhhhhhhhhhhhh
01:43:23FromDiscord<albassort> guess not?
01:43:37FromDiscord<Elegantbeef> Reinstall
01:43:40FromDiscord<Elegantbeef> that was fixed in august
01:43:48FromDiscord<Elegantbeef> But they didnt use semver properly
01:44:02FromDiscord<albassort> yaml guy?
01:44:10FromDiscord<Elegantbeef> https://github.com/flyx/NimYAML/commit/a5552a1a18bdb7b8bb95c0d037706874a7d4bfe8
01:44:15FromDiscord<albassort> ah ok
01:44:15FromDiscord<Elegantbeef> Yea it was fixed in august
01:44:26FromDiscord<Elegantbeef> Actually seems it's on their devel branch and not master
01:44:36FromDiscord<Elegantbeef> So you might need to target that branch specifically for 2.0
01:47:46FromDiscord<albassort> yep its not in 2.0
01:47:51FromDiscord<albassort> no worth in figuring it out then
01:48:34FromDiscord<emanresu3> Hi, is it possible to copy an entire proc's signature? with`getTypeImpl` I got the proc's parameters and types, but I'd like to also get the default parameter values and generics if possible
01:52:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4inD
01:55:51FromDiscord<emanresu3> That's it thanks a lot
02:57:15FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4inI
02:59:14FromDiscord<Yepoleb> are you using semicolons as parameter separators in the real code?
02:59:29FromDiscord<sOkam!> in function declarations, yeah
02:59:53FromDiscord<sOkam!> but not in function calls, obviously, since that would mean newline
03:00:18*brettgilio joined #nim
03:00:25FromDiscord<Yepoleb> i didn't know that just works
03:00:49FromDiscord<Yepoleb> show us how you are using the proc
03:01:14FromDiscord<Yepoleb> do you get an error or is another proc used instead?
03:01:23FromDiscord<sOkam!> another proc is used
03:01:31FromDiscord<Yepoleb> which one?
03:01:38FromDiscord<MilesTheFox> Is it possible to work with Discord API from Nim?
03:02:03FromDiscord<sOkam!> well, another one with the same register name
03:02:08FromDiscord<sOkam!> but using a different type
03:02:24FromDiscord<Yepoleb> In reply to @MilesTheFox "Is it possible to": https://github.com/krisppurg/dimscord
03:02:46FromDiscord<sOkam!> "type mismatch, got `VBO[vmath.Vec3]`, but expected one of ...."
03:03:09FromDiscord<Yepoleb> expected what?
03:03:42FromDiscord<sOkam!> expected this, which is right above it↵proc register (vao :var VAO) :void=
03:03:50FromDiscord<sOkam!> (edit) "it↵proc" => "it↵`proc" | ":void=" => ":void`"
03:04:19FromDiscord<sOkam!> well, technically its the same proc from which the code is called
03:05:44FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4inP
03:06:59FromDiscord<Yepoleb> can you rename the vbo proc to rule out a parameter mismatch?
03:07:10FromDiscord<Yepoleb> both the signature and the calling part
03:07:29FromDiscord<sOkam!> what do you mean by signature and calling?
03:07:52FromDiscord<sOkam!> i understand if i change the name it will avoid using the same, but which is signature and which is calling?
03:08:05FromDiscord<Yepoleb> change the name and also change it where you use
03:08:06FromDiscord<Yepoleb> (edit) "change the name and also change it where you use ... " added "it"
03:08:10FromDiscord<sOkam!> k
03:08:27FromDiscord<Yepoleb> sorry for the confusing description
03:09:23FromDiscord<sOkam!> ah i think its wanting a var vbo
03:10:00FromDiscord<sOkam!> i thought that giving it a var of the superior type would be enough to get the interior to be var too? 🤔
03:10:28FromDiscord<Yepoleb> what do you mean by interior type?
03:11:31FromDiscord<sOkam!> well, if one type is contained in another, its inside
03:16:00FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4inV
03:16:42FromDiscord<Elegantbeef> What's the typedef of vao?
03:17:21FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4inW
03:19:11FromDiscord<Elegantbeef> Can you provide a runnable version of this?
03:20:24FromDiscord<sOkam!> i don't have one. this is the best i have https://media.discordapp.net/attachments/371759389889003532/1051700014549839922/meshRework.nim
03:23:21FromDiscord<sOkam!> with how messy it is right now, i think the simplified version will be much better to test. but maybe it helps 🤷‍♂️
03:23:35FromDiscord<Elegantbeef> Well i mean i just wanted a single file i could run to see the error
03:23:43FromDiscord<sOkam!> yeah, but i dont have one
03:23:52FromDiscord<sOkam!> im seeing the error with the lsp
03:24:17FromDiscord<Elegantbeef> I'm asking for a min repro
03:24:37FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4inZ
03:25:23FromDiscord<ElegantBeef> It might work
03:28:11FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=4io0 works but i dont know exactly your API is doing causing the error
03:28:46FromDiscord<Elegantbeef> Can you provide the entire error please
03:29:21FromDiscord<sOkam!> i cannot read it, because its to the right of the screen and i have to make the font really tiny (and cannot copy it)
03:29:46FromDiscord<Elegantbeef> So it compiles?
03:29:56FromDiscord<Elegantbeef> If so this is just a nimsuggest bug
03:31:03FromDiscord<sOkam!> i cannot compile the code, i have nothing that uses this
03:31:17FromDiscord<Elegantbeef> What?
03:31:26FromDiscord<Elegantbeef> You have the file
03:31:29FromDiscord<Elegantbeef> Compile the file
03:31:39FromDiscord<sOkam!> and it will do nothing, since it has no function calls
03:31:40FromDiscord<Elegantbeef> If there is any semantic issues the compiler will error
03:31:45FromDiscord<sOkam!> or am i misunderstanding?
03:31:56FromDiscord<Elegantbeef> If it doesnt compile then the nimsuggest has a bug
03:32:01FromDiscord<Elegantbeef> I mean if it does compi;le
03:32:01FromDiscord<sOkam!> i thought if there are no function calls, the code would just be ignored
03:32:06FromDiscord<sOkam!> kk
03:32:09FromDiscord<Elegantbeef> No it's still semantically checked
03:32:27FromDiscord<Elegantbeef> Generics are lightly checked
03:32:54FromDiscord<Elegantbeef> But if nimsuggest errors that's either a bug or semantic analysis erroring
03:33:01FromDiscord<Elegantbeef> Nimsuggest isnt magic
03:33:29FromDiscord<sOkam!> yeah, but so far it mostly says exactly the same thing that the compiler says
03:33:40FromDiscord<sOkam!> like in 99% of the cases
03:33:56FromDiscord<Elegantbeef> Sure but there are some nim suggest bugs that emit false errors
03:34:12FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4io1
03:35:09FromDiscord<Elegantbeef> Well there you go 😄
03:35:24FromDiscord<sOkam!> i dont get that though
03:35:30FromDiscord<Elegantbeef> What is line 171?
03:35:37FromDiscord<sOkam!> well that line i mentioned
03:35:45FromDiscord<sOkam!> the same that nimsuggest complains about
03:35:53FromDiscord<Elegantbeef> What is on that line
03:36:07FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4io3
03:36:13FromDiscord<Elegantbeef> Ok so the template is wrong
03:36:53FromDiscord<Elegantbeef> `vbo.id`
03:36:55FromDiscord<Elegantbeef> there you go
03:37:08FromDiscord<sOkam!> ?
03:37:10FromDiscord<Elegantbeef> template parameters are replaced verbatim inside of a template
03:37:22FromDiscord<Elegantbeef> So `vbo.id` isnt `vbo.id` it's `vbo.0`
03:37:28FromDiscord<Elegantbeef> since your template parameter is `id`
03:37:51FromDiscord<Elegantbeef> Why register 2 is even a template is a bit confounding
03:38:41FromDiscord<sOkam!> because its calling a bunch of opengl functions in a row, that could might as well be separate code and they always are in all code i find online that is similar
03:38:53FromDiscord<Elegantbeef> Why isnt it a proc
03:38:59FromDiscord<MilesTheFox> In reply to @Yepoleb "https://github.com/krisppurg/dimscord": Thank you!
03:38:59FromDiscord<sOkam!> so I was trying to not create 10 function calls to just do a list of bind/gen/etc
03:39:38FromDiscord<Elegantbeef> bleh just use procs
03:39:40FromDiscord<sOkam!> in essence that's all they are doing, they are abstracting a list of bind/gen/enable function calls
03:39:51FromDiscord<Elegantbeef> If it's needed to be inlined it'll be
03:48:31FromDiscord<sOkam!> the issue was inside the template, it seems↵I was assigning to a filed that is stored in the type above, so it didn't exist
03:50:39FromDiscord<sOkam!> Nimsuggest still gets confused about this, it seems↵https://i.imgur.com/j1vhVAi.png
03:50:55FromDiscord<sOkam!> But the file compiles now
03:51:30FromDiscord<sOkam!> i didn't know you could compile empty files even without correct code. that's extremely helpful to know 👀
03:51:42FromDiscord<sOkam!> (edit) removed "empty"
03:52:07FromDiscord<sOkam!> (edit) "i didn't know you could compile ... files" added "disastrous" | removed "even" | "correct" => "a single line of applicable/correct"
03:54:50FromDiscord<Elegantbeef> The world of static typing!
04:02:10FromDiscord<Yepoleb> We need someone who punishes people for premature optimization
04:02:57FromDiscord<Rika> They already punish themselves by wasting time
04:04:13FromDiscord<Yepoleb> In reply to @sOkam! "so I was trying": If you inline too much you destroy your instruction cache performance, which costs you much more than a few calls
04:05:27*sagax joined #nim
04:06:41FromDiscord<Yepoleb> In reply to @Rika "They already punish themselves": But that's not satisfying to watch
04:08:08FromDiscord<Elegantbeef> It doesnt matter how many times people say it's bad people still do it↵(@Yepoleb)
04:09:12FromDiscord<sOkam!> ok ok, i get it
04:09:15FromDiscord<sOkam!> 😄
04:11:47FromDiscord<Yepoleb> In reply to @Elegantbeef "It doesnt matter how": Yes that's exactly where the punishment comes into play
04:57:19*arkurious quit (Quit: Leaving)
05:46:30*rockcavera quit (Remote host closed the connection)
06:38:32NimEventerNew Nimble package! update_nimble_version - Cli tool to update the nimble version of a package., see https://github.com/philolo1/update_nimble_version
06:45:12*ltriant quit (Ping timeout: 256 seconds)
07:07:41*kenran joined #nim
07:10:19*kenran quit (Remote host closed the connection)
07:38:25FromDiscord<albassort> experiencing strange behaviour with gtk
07:40:28FromDiscord<albassort> my program isn't working in the same as in my main program as it is on the side
07:40:40FromDiscord<albassort> hmm lemme include
07:42:39*PMunch joined #nim
07:44:53FromDiscord<albassort> no... ugh probably a gtk problem?
07:52:55FromDiscord<amadan> Is there a way to read a file using the JS backend (running with node)?
07:53:30FromDiscord<amadan> Thought `readFile` would do it but that just trys to call `fopen`
07:56:12FromDiscord<Elegantbeef> https://github.com/juancarlospaco/nodejs
08:13:09FromDiscord<amadan> neat, thanks 👍
09:35:27FromDiscord<jmgomez> Is there a way to instrospect/bindSyms that arent visible in the macro scope?
09:37:58FromDiscord<Elegantbeef> Pass them in
09:38:18FromDiscord<Elegantbeef> There is dynamic bindsym but dont think it works how you want
09:39:46FromDiscord<jmgomez> I only know the literal at that point, you mean the experimental dynamicBindSym?
09:40:21FromDiscord<Elegantbeef> the literal?
09:40:42FromDiscord<jmgomez> the name of the type
09:52:31FromDiscord<Elegantbeef> Yea the experimental thing, though i dont think it works that way
09:52:40FromDiscord<Elegantbeef> I always forget I attempt to use it so seldom
09:58:15*ltriant joined #nim
10:03:09FromDiscord<jmgomez> Ok, yeah I didnt. Lucky for me I already had a list of those types somewhere else in the project
10:14:10FromDiscord<<She>Horizon</Her>> What's simd used for, and what uses does it have in Nim?
10:15:21FromDiscord<Elegantbeef> Simd allows larger than 64 bit registers with specialised operations
10:15:38FromDiscord<Elegantbeef> This means you have a single cycle that can do things like addition for a more numbers at once
10:16:28FromDiscord<Elegantbeef> The uses it has in Nim is wherever you have a lot of data that can be thrown into a single register and do more at once
10:16:44FromDiscord<Elegantbeef> Much like multi threading or GPU acceleration it's for specialised tasks
10:17:11FromDiscord<Elegantbeef> You can speed up many things using it, it's used with pixie for speeding up drawing. It can be used to speed up string searching
10:17:32FromDiscord<Elegantbeef> Modern SIMD instructions have 512 bit registers
10:17:35FromDiscord<<She>Horizon</Her>> Hm that's good to know, thanks Beef!
10:17:39FromDiscord<Elegantbeef> So just imagine the speed
10:17:59FromDiscord<Elegantbeef> It's best to look at instruction sets if you want to understand more
10:28:28FromDiscord<Vendethiel> o/, I'm looking for a `span` function in nim. Basically a combination of `takeWhile` + `dropWhile` that I could i.e. find in `itertools`
10:28:36FromDiscord<Vendethiel> (I have a list I want to split at some point with a predicate)
10:42:12FromDiscord<albassort> In reply to @Elegantbeef "Modern SIMD instructions have": so does it have 8 64 bit buses for these registers or a big chunky 512 bus
10:57:20FromDiscord<planetis> In reply to @Vendethiel "o/, I'm looking for": Sounds like how parseutils work but only for openarray char.
11:04:09FromDiscord<luteva> In reply to @Elegantbeef "It's best to look": is there a simd lib in nim? i can't find anything about simd in the std nim lib... i only know of the cuda bindings.... so any link would be great!
11:04:45FromDiscord<luteva> (edit) "great!" => "great!↵https://github.com/SciNim/nimcuda"
11:04:57FromDiscord<luteva> (edit) "any" => "a"
11:06:44FromDiscord<ShalokShalom> In reply to @albassort "experiencing strange behaviour with": welcome 😄
11:06:58FromDiscord<ShalokShalom> this is reality, may I bring you some drinks? 😄
11:07:23FromDiscord<albassort> gtk being a nonsensical baby ?
11:07:44FromDiscord<albassort> everything on my end is the same
11:07:51FromDiscord<albassort> something is mutating in the gtk code
11:08:05FromDiscord<albassort> im gonna track it down... eventually
11:08:17FromDiscord<ShalokShalom> 🙏
11:12:28FromDiscord<Vendethiel> In reply to @planetis "Sounds like how parseutils": I ended up rewriting span with takeWhike + slice
11:16:26FromDiscord<auxym> In reply to @luteva "is there a simd": https://github.com/guzba/nimsimd
11:16:44FromDiscord<auxym> also arraymancer uses a lot of simd stuff under the hood
11:37:02arkanoidI've just found that in nim a bool is 1 byte, but I'm quite surprised this stands for seq and Tensor too
11:37:07arkanoidnim> newTensorWith([4,4,4], true).size # 64 == type Natural
11:40:04arkanoidWhat's the internal memory representation of bool? Is it just 0b0000000[0|1] ?
11:42:39arkanoidCan you confirm that also for seq[bool] each element is 1 byte?
11:51:14FromDiscord<auxym> yes, as far as I know all that is correct.
11:52:46FromDiscord<auxym> there are libraries like https://github.com/treeform/bitty for a more compact representation (but accesses are slower because you need one/a few extra instructions to extract the bit from a larger int)
12:11:12*dtomato quit (Quit: The Lounge - https://thelounge.chat)
12:18:28*junaid_ joined #nim
12:24:01*junaid_ quit (Remote host closed the connection)
12:48:06FromDiscord<Rika> In reply to @albassort "so does it have": 8 64s
12:52:38*dtomato joined #nim
12:58:32*dtomato quit (Quit: The Lounge - https://thelounge.chat)
12:58:57NimEventerNew question by bfontaine: How to pass file lines as argument in Nim?, see https://stackoverflow.com/questions/74771455/how-to-pass-file-lines-as-argument-in-nim
13:02:04*dtomato joined #nim
13:31:17FromDiscord<ajusa> In reply to @treeform "re: "flatty isn't as": Two things - more templates/macros/sugar for parsing and serializing arbitrary file formats, and some sort of stream support - I just want to avoid loading the entire file into memory in certain cases, eg when reading the header of a 4GB file.
13:31:59*jmdaemon quit (Ping timeout: 265 seconds)
13:38:46*eal joined #nim
13:42:35FromDiscord<auxym> In reply to @ambient "why do people recommend": `s[a..b]` creates a copy of the data. `toOpenArray`, creates a "view" to the data, ie just a pointer + length pair
13:44:48FromDiscord<auxym> In reply to @scruz "embedded dev mostly": much smaller ecosystem is likely the biggest downside for embedded atm. All manufacturer libraries (HAL, etc) are C, so it's up to you to bind them in nim (or create your own HAL). Some stuff has been made by the community (nesper for esp32, picostdlib for rp2040, etc) but we're a very small community
13:45:24FromDiscord<auxym> other than that, IMO, tooling. really wish nim had a higher quality LSP and code formatter.
13:45:40FromDiscord<auxym> But the language itself is pretty great, including for embedded
14:02:48FromDiscord<MetuMortis> Is it possible to handle every input from stdin? Something like "on stdin input do bla bla" I don't want to do it using recursion or while looop
14:04:18FromDiscord<Rika> ?
14:04:24FromDiscord<Rika> i'm nto sure what you mean
14:07:17FromDiscord<MetuMortis> Reading from stdin without blocking other things
14:07:44*rockcavera joined #nim
14:08:42*dtomato quit (Quit: The Lounge - https://thelounge.chat)
14:09:02FromDiscord<Rika> async would help had it been possible to use it on stdin
14:09:04*dtomato joined #nim
14:09:18FromDiscord<Rika> usually people would say just make a new thread and manage io there
14:09:30*dtomato quit (Remote host closed the connection)
14:10:15FromDiscord<MetuMortis> I'm a NodeJS dev :d there is no multithread on JS and it is hard to migrate :d
14:19:35FromDiscord<Rika> how would it work in node then?
14:19:42FromDiscord<Rika> what difference would there be because i do not knwo
14:25:31FromDiscord<auxym> afaik (not much) node does everything async
14:26:02FromDiscord<Vendethiel> Node has concurrency but no parallelism
14:27:30FromDiscord<Rika> i believe node does do threads for stdin/stdout because interfacing asyncly with those is very dependent on the os and on windows its just absolutely fucked
14:27:40FromDiscord<Rika> its just not shown to the user
14:27:50FromDiscord<MetuMortis> Probably
14:27:57FromDiscord<Gumbercules> In reply to @Vendethiel "Node has concurrency but": Parallelism is a form of concurrency...
14:28:51FromDiscord<Gumbercules> But yeah async/await will be your friend for I/O bound workloads with Node
14:28:58FromDiscord<Vendethiel> In reply to @Gumbercules "Parallelism is a form": lol
14:29:01FromDiscord<Rika> In reply to @Gumbercules "Parallelism is a form": ?
14:29:06FromDiscord<Vendethiel> Reread what I said
14:29:10FromDiscord<Rika> i dont understand how that invalidates what he said
14:30:24FromDiscord<Gumbercules> I didn't say it invalidated it, but it's a weird way to say the Node runtime is single threaded
14:31:00FromDiscord<Gumbercules> Obviously if there's only one thread it's going to be difficult to parallelize workloads across threads
14:31:07FromDiscord<MetuMortis> In reply to @Rika "usually people would say": Is there any docs or example code about it? I have no idea & had a look to threads but don't have any idea about how can I get input from a thread and use it on my main thread
14:31:28FromDiscord<Vendethiel> In reply to @Gumbercules "I didn't say it": The node runtime has workers
14:31:39FromDiscord<Vendethiel> Anyway, no, it’s a perfectly standard way to talk about it
14:31:47FromDiscord<Gumbercules> In reply to @MetuMortis "Is there any docs": Message passing or synchronization
14:32:25FromDiscord<auxym> In reply to @MetuMortis "Is there any docs": channels
14:32:36FromDiscord<Gumbercules> In reply to @Vendethiel "Anyway, no, it’s a": You're just going to confuse someone who doesn't understand what a thread is
14:32:51FromDiscord<auxym> In reply to @MetuMortis "Is there any docs": https://nim-lang.org/0.20.0/channels.html
14:33:04FromDiscord<Gumbercules> Or concurrency or parallelism for that matter
14:33:32FromDiscord<auxym> oops, old docs↵https://nim-lang.org/docs/channels_builtin.html
14:35:16FromDiscord<MetuMortis> Thanks
14:35:41FromDiscord<Gumbercules> Async / await are your friends if you're targeting Nims JS / Node backend
14:35:52FromDiscord<Gumbercules> @MetuMortis
14:36:12FromDiscord<MetuMortis> Targeting C
14:36:20FromDiscord<Gumbercules> Ah okay
14:36:44FromDiscord<Gumbercules> Message passing has quite a bit of overhead
14:36:59FromDiscord<Gumbercules> Just FYI
14:39:03FromDiscord<Gumbercules> You can also use synchronization primitives to control access to shared memory
14:40:32FromDiscord<auxym> yay raw pointers and locks, just like coding plain C... :S
14:40:46FromDiscord<Gumbercules> I mean
14:41:10FromDiscord<Gumbercules> Shared memory is shared memory
14:41:45FromDiscord<Gumbercules> If your application is near real time or real time you don't have much of a choice
14:42:32FromDiscord<auxym> I'd rather use something higher level (channels, zmq...) unless profiling/benchmarking shows that inter-thread communications is becoming a perf bottleneck. Which it probably isn't if he is reading input from a user typing commands manually...
14:43:10FromDiscord<Gumbercules> Probably not, definitely not suitable for many applications however
14:43:19FromDiscord<auxym> and since we are being pedantic on semantics, real-time =! high throughput 😉
14:43:36FromDiscord<Gumbercules> Might also be slower than utilizing a single thread
14:43:40FromDiscord<auxym> (it only means deterministic / bounded latency)
14:43:58FromDiscord<Gumbercules> I wasn't the one that suggested threads for I/O bound tasks either
14:46:54FromDiscord<auxym> he never said his workload was IO bound, just that he wants to be able to handle stdin IO (responding to user commands) concurrently to doing other stuff. and AFAIK nim doesn't have builtin async IO for stdout/stdin, so threads might be the simplest thing.
14:51:31FromDiscord<Gumbercules> https://forum.nim-lang.org/t/5227
14:51:42FromDiscord<Gumbercules> Unsure if this is still accurate or not...
15:08:28*PMunch quit (Quit: Leaving)
15:27:25FromDiscord<luteva> hi! yes there's an asynch IO example in the "nim in action" book.
15:29:00FromDiscord<luteva> here's the link to the code examples:↵https://github.com/dom96/nim-in-action-code
15:30:15FromDiscord<luteva> it should be in the chat app IIRC
15:34:33FromDiscord<luteva> sent a code paste, see https://play.nim-lang.org/#ix=4iqS
15:34:59FromDiscord<luteva> https://github.com/dom96/nim-in-action-code/blob/a776a247bef10a61697530742d70c1c214ad2a78/Chapter3/ChatApp/src/client.nim#L38
16:33:32FromDiscord<ShalokShalom> ElegantBeef: You said godot-nim does disallow calling Godot libraries from being called as func's↵↵Do you know, how its doing that?
16:43:05FromDiscord<arkanoid> What is the memory representation of a bool?↵ https://github.com/nim-lang/Nim/blob/76c347515aaf1201c1307422b64494514c6301f9/lib/system/basic_types.nim#L15↵↵I can't print it via strutils, so I need to ask
16:43:25FromDiscord<Rika> one byte with bit idx 0 set to 1 as true and 0 as false?
16:44:31FromDiscord<arkanoid> I think the same, but how can I ask nim to print it?
16:48:11*disso_peach quit (Quit: Leaving)
16:49:04FromDiscord<arkanoid> Do you know container that enable storing sequence of bools consuming 1 byte every 8 bools?
16:50:22FromDiscord<arkanoid> boolseq[7] would be most significant bit of first byte, boolseq[8] would be lsb of second byte, and so on
16:54:50*estiquelapice quit ()
16:56:03*estiquelapice joined #nim
16:56:16FromDiscord<Rika> set
16:56:28FromDiscord<Rika> i assume so at least
16:57:00FromDiscord<arkanoid> set?
16:57:18FromDiscord<Rika> !eval echo sizeof {true, false, false, false, false, false, false, false}
16:57:33FromDiscord<Rika> wait no thats dum
16:57:42FromDiscord<Rika> i forget exactly
16:57:49FromDiscord<Rika> the usage
16:58:02FromDiscord<jfmonty2> Yeah doesn't the set need a type with at most 65536 possible values or something?
16:58:18FromDiscord<jfmonty2> Like \`set[char]\` or whatever
16:58:19NimBotCompile failed: <no output>
16:58:27FromDiscord<Rika> sure yes
16:58:34FromDiscord<Rika> set of indices
16:58:45FromDiscord<Rika> technically not a bool sequence but its the same idea
16:59:06FromDiscord<Rika> you put the index in the set and its effectively a boolean sequence
16:59:24FromDiscord<Rika> !eval echo sizeof {0'u8}
16:59:39FromDiscord<jfmonty2> Can you use set with an enum? I feel like you can, right?
17:00:04FromDiscord<Rika> enum sure, integers under i16 too
17:00:24NimBotCompile failed: <no output>
17:00:30FromDiscord<Rika> u8 takes 32 bytes though since 2^8 / 8 -> size
17:00:54FromDiscord<jfmonty2> really convenient if you don't need the overhead of hashing
17:01:20FromDiscord<Rika> In reply to @Rika "u8 takes 32 bytes": but indeed, 256 indices in a set consumes 256 bits
17:01:30FromDiscord<Vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4irf
17:02:10FromDiscord<Rika> no need for the let x no>
17:03:39*estiquelapice quit ()
17:03:45FromDiscord<arkanoid> It prints "01", so yes, it's the lsb
17:04:42FromDiscord<vindaar> no, I suppose not. more habit↵(@Rika)
17:08:03FromDiscord<arkanoid> Writing a custom seq that abstracts away all this bit fiddling to store 8 bools in a single byte seems quite a challenge
17:08:35FromDiscord<Rika> its also not exactly computationally friendly
17:13:23FromDiscord<arkanoid> Would be interesting to know what would be the overhead. It's all about div/mod by 8 in the fastest way possible, plus bitmask and shifting
17:33:00*estiquelapice joined #nim
17:59:39*pro joined #nim
18:00:13*pro quit (Client Quit)
19:09:57*arkurious joined #nim
19:26:16*PMunch joined #nim
19:34:01FromDiscord<auxym> https://github.com/treeform/bitty
19:42:34*xet7 quit (Ping timeout: 260 seconds)
19:45:53*disso_peach joined #nim
19:46:54*disso_peach quit (Client Quit)
19:47:07*disso_peach joined #nim
19:55:40*xet7 joined #nim
19:55:42*xet7 quit (Remote host closed the connection)
19:56:05*xet7 joined #nim
19:59:17FromDiscord<ShalokShalom> Who maintains the forum?
19:59:28FromDiscord<ShalokShalom> I cant recover my password
19:59:37FromDiscord<ShalokShalom> And I should be able to login just fine
19:59:47FromDiscord<ShalokShalom> To me, it seems like my account got just deleted
20:27:41*pro joined #nim
20:38:50*pro left #nim (#nim)
20:53:39*kenran joined #nim
20:54:08*kenran quit (Remote host closed the connection)
21:04:05PMunch@ShalokShalom, what's your nick?
21:04:49FromDiscord<ShalokShalom> ShalokShalom
21:05:23FromDiscord<ShalokShalom> You can see this account here
21:05:23FromDiscord<ShalokShalom> https://forum.nim-lang.org/t/9708
21:05:33FromDiscord<ShalokShalom> Thanks
21:06:36PMunchThere, I manually triggered the password reset e-main, hopefully that helps
21:09:54FromDiscord<ShalokShalom> thanks
21:10:38PMunchDid you get it?
21:10:45FromDiscord<ShalokShalom> fails to login
21:10:50FromDiscord<ShalokShalom> with the newly created password
21:11:04FromDiscord<ShalokShalom> either I am a complete idiot (not impossible) or something is not working
21:13:13PMunchHmm, that's strange
21:14:08PMunchI think araq and dom96 are the only ones with direct database access..
21:17:59*jmdaemon joined #nim
21:22:18FromDiscord<ShalokShalom> All fine
21:25:28FromDiscord<ShalokShalom> Ah, got it!
21:25:34FromDiscord<ShalokShalom> It went through 🙂
21:25:37FromDiscord<ShalokShalom> Thanks
21:29:47*Jjp137 quit (Quit: Leaving)
21:32:05PMunchI think there's something broken about repr on the latest version of Nim..
21:32:47PMunchI get errors like `Error: unhandled exception: value out of range: 36315 notin -32768 .. 32767 [RangeDefect]` whenever I try to use repr on a NimNode or use --expandMacro
21:33:23*Jjp137 joined #nim
21:47:40FromDiscord<amadan> Shit that could be my fault↵Just any NimNode causes that?
21:48:10PMunchWell not every single one
21:48:13PMunchBut a lot of them
21:50:28FromDiscord<amadan> Anything minimal I can test with?
21:54:08PMunchHmm, nothing a can conjure up easily
21:54:27PMunchI was trying to output the output of tmpli from onionhammer templates
21:58:31FromDiscord<amadan> sent a code paste, see https://play.nim-lang.org/#ix=4isp
22:00:10PMunchOh I didn't modify the library, just --expandMacro was enough to trigger it
22:00:19PMunchI just assumed that used `repr` somewhere
22:00:28PMunchMy Nim version is 1.6.10
22:04:35*estiquelapice quit ()
22:05:23*estiquelapice joined #nim
22:06:07PMunchOh well, I'm off to bed
22:06:07*PMunch quit (Quit: leaving)
22:06:37FromDiscord<amadan> Yeah can't reproduce↵Will see if I can somehow break repr lol
22:48:06FromDiscord<sOkam!> how do you convert (or just echo) a `ptr char` coming from C with nim code?
22:48:27FromDiscord<Elegantbeef> Is it a cstring or a ptr char
22:53:26FromDiscord<sOkam!> ptr char
22:54:29FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4isw
22:54:40FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4isw" => "https://play.nim-lang.org/#ix=4isx"
22:54:51FromDiscord<Elegantbeef> So it's a cstring
22:55:28FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4isy
22:55:33FromDiscord<Elegantbeef> `cast[ptr UncheckedArray[char]](message)` gives you an iterable array
22:55:37FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4isy" => "https://play.nim-lang.org/#ix=4isz"
22:56:10FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4isA
22:56:25FromDiscord<sOkam!> tysm 🙏
23:32:00FromDiscord<dani> sent a code paste, see https://play.nim-lang.org/#ix=4isM
23:32:51FromDiscord<dani> (edit) "https://play.nim-lang.org/#ix=4isM" => "https://play.nim-lang.org/#ix=4isN"
23:35:44FromDiscord<Elegantbeef> Nim doesnt have type unions
23:35:47FromDiscord<Elegantbeef> Those are generic constraints
23:38:01FromDiscord<Elegantbeef> There is the idiomatic Nim solution
23:38:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4isO
23:39:00FromDiscord<dani> In reply to @Elegantbeef "Those are generic constraints": Thanks a lot for the feedback! Can be A and B in your example be types as well beyond the enumerated?
23:39:16FromDiscord<Elegantbeef> Nope they have to be an ordinal
23:39:52FromDiscord<dani> Thanks again. I come from typescript. I'm still trying to figure out how to translate stuff
23:40:18FromDiscord<Elegantbeef> There is also https://github.com/alaviss/union
23:41:03FromDiscord<Elegantbeef> Yea unlike typescript `TypeA | TypeB` is a constraint for a generic
23:41:11FromDiscord<Elegantbeef> You can do like `proc doThing(i: int | float)`
23:41:36FromDiscord<Elegantbeef> That makes it a proc that can take an int or float, but it's a monomorphic specialisation
23:41:46FromDiscord<Elegantbeef> Typescript doesnt have an equivalent cause it doesnt have overloads
23:42:34FromDiscord<dani> In reply to @Elegantbeef "That makes it a": I understand they end up being two functions at compile time
23:42:43FromDiscord<dani> In reply to @Elegantbeef "Typescript doesnt have an": Types yes, runtime no
23:42:52FromDiscord<Elegantbeef> Yep, just explaining in case you didnt know
23:43:09FromDiscord<Elegantbeef> I mean afaik if you want a procedure with the same name in TS you have to manually dispatch
23:43:11FromDiscord<dani> Thanks a lot for your kind explanations
23:43:14FromDiscord<Elegantbeef> I could be wrong i've never written TS
23:43:28FromDiscord<dani> In reply to @Elegantbeef "I mean afaik if": you are right
23:45:11FromDiscord<Elegantbeef> Whew always good to know that random knowledge i've acquired is true 😛
23:47:36FromDiscord<ShalokShalom> @dani You can find discriminated unions also in patty
23:48:01FromDiscord<ShalokShalom> https://github.com/andreaferretti/patty#constructing-variant-objects
23:48:24FromDiscord<ShalokShalom> That's what you actually want I assume
23:48:44FromDiscord<Elegantbeef> I mean that's just a object variant so... 😄
23:48:53FromDiscord<ShalokShalom> Yeah, sure
23:48:57FromDiscord<ShalokShalom> Under the hood
23:49:09FromDiscord<ShalokShalom> I mean syntax wise
23:49:12FromDiscord<Elegantbeef> It doesnt even work in their case though
23:49:18FromDiscord<Elegantbeef> Cause they have a duplicate ID field
23:49:19FromDiscord<ShalokShalom> To me, that plays a great role 😄
23:49:28FromDiscord<ShalokShalom> Ah, I see
23:49:36FromDiscord<ShalokShalom> Namespaces?
23:50:07FromDiscord<Elegantbeef> You're going to have to use more words
23:53:59FromDiscord<ShalokShalom> Boah 😮
23:54:41FromDiscord<Elegantbeef> Are you saying prefix it `aID` and `bId`?
23:55:46FromDiscord<.tochka> does 'lent' force something to be passed by pointer? or it could reason about if copy is ok