<< 11-12-2024 >>

00:17:10FromDiscord<Robyn [She/Her]> https://bernsteinbear.com/blog/creduce/
01:01:53*xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in)
01:02:41*xutaxkamay joined #nim
01:07:59FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#pasty=xqQXsZfY
01:08:18FromDiscord<4zv4l> the first one take a wrong row somewhow
01:08:22FromDiscord<4zv4l> (edit) "somewhow" => "somehow"
01:54:59*krux02 quit (Remote host closed the connection)
02:03:47*rockcavera quit (Remote host closed the connection)
02:20:09FromDiscord<odexine> those arent equivalent? second one does `sheet[1..^1][x][0] for all indices x` (pseudo ofc)
02:42:29FromDiscord<4zv4l> yeah so thats weird the first one isnt working for me xD
02:42:36FromDiscord<4zv4l> oh wait what
02:42:41FromDiscord<4zv4l> not equivalent ?
02:44:11FromDiscord<Elegantbeef> What type does the `[](sheet, 1..^1)` return?
02:44:20FromDiscord<Elegantbeef> If it's not a `seq[T]` or similar of course those are different
02:47:36FromDiscord<4zv4l> oh I think I get it
02:48:08FromDiscord<4zv4l> yeah it makes sense
03:25:49FromDiscord<maxtachine> how can I use choosenim for switching to 32bit nim?
03:33:28FromDiscord<bostonboston> Install a 32 bit gcc (or compiler of choice) and modify your nim.cfg to look for gcc.exe in the 32bit bin when you define i386.↵↵At least that's what I do
03:50:54FromDiscord<bostonboston> (sorry I am assuming you can actually run the 64bit executable and just need to compile 32bit binaries)
03:58:31*Batzy quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
04:42:00*Batzy joined #nim
08:47:29*redj_ quit (Quit: No Ping reply in 180 seconds.)
08:49:00*redj joined #nim
11:20:55*modev joined #nim
11:27:43*kotrcka joined #nim
11:35:02*coldfeet joined #nim
11:39:05*disso-peach joined #nim
12:01:10*kotrcka quit (Remote host closed the connection)
12:04:16*coldfeet quit (Quit: Lost terminal)
12:07:16*bcksl quit (Quit: \)
12:07:16*end quit (Quit: end)
12:22:47FromDiscord<Robyn [She/Her]> In reply to @bostonboston "(sorry I am assuming": Yeah 64 bit Nim can produce 32 bit binaries if you set the cpu arch correctly and use a compiler that outputs 32 bit binaries
12:22:54FromDiscord<Robyn [She/Her]> Zig CC makes this a breeze :P
12:23:48*bcksl joined #nim
12:28:58*end joined #nim
13:35:21FromDiscord<whorf> sent a code paste, see https://play.nim-lang.org/#pasty=AfhuaLrR
13:51:20FromDiscord<whorf> oh, this maybe isn't possible? <https://forum.nim-lang.org/t/1773>
13:53:00FromDiscord<pmunch> Hmm, don't we have a memset equivalent in Nim?
13:53:18FromDiscord<pmunch> @whorf, no that's not possible. Types doesn't really exist on runtime
13:53:58FromDiscord<pmunch> What exactly are you trying to achieve by having a sequence of types?
14:09:33FromDiscord<whorf> sent a code paste, see https://play.nim-lang.org/#pasty=ZRqzBEPj
14:10:10FromDiscord<whorf> (edit) "https://play.nim-lang.org/#pasty=JBYrOngB" => "https://play.nim-lang.org/#pasty=CAYBFxTd"
14:10:25*nils` quit (Ping timeout: 260 seconds)
14:30:58FromDiscord<pmunch> Well you wouldn't really use anything other than a variable
14:32:33FromDiscord<pmunch> sent a code paste, see https://play.nim-lang.org/#pasty=vHFVMoyW
14:42:47FromDiscord<whorf> I figured that would be the answer, but I really didn't want a massive switch statement. Dynamic approach feels so much cleaner.
14:43:10FromDiscord<whorf> (edit) "I figured that would be the answer, but I really didn't want a massive switch statement. Dynamic approach feels so much cleaner. ... " added "Thanks for the help tho 👍"
15:07:32*modev quit (Quit: WeeChat 4.4.2)
15:15:30FromDiscord<nocturn9x> uhm
15:15:36FromDiscord<nocturn9x> is it possible that just calling a function segfaults?
15:16:02FromDiscord<nocturn9x> I've tried debugging with gdb but the point where it says the crash occurred is wrong, because `echo` statements before it do not get executed
15:16:15FromDiscord<nocturn9x> the last point where I can definitely say something is happening is before calling a specific function
15:16:19FromDiscord<nocturn9x> then it segfaults
15:16:21FromDiscord<nocturn9x> what the fuck?
15:16:36FromDiscord<nocturn9x> context: I'm passing a ~290KiB `object` around
15:16:39FromDiscord<odexine> do you have the (prolly preferably full) code for this
15:16:52FromDiscord<nocturn9x> In reply to @odexine "do you have the": if you want to read thousands of lines of code, yes
15:16:57FromDiscord<nocturn9x> lol
15:17:01FromDiscord<odexine> min repro
15:17:07FromDiscord<nocturn9x> that is not possible
15:17:21FromDiscord<nocturn9x> it would take as much effort to make a reproducible example as it would to just revert the change I made
15:17:30FromDiscord<odexine> well then what is the change
15:17:52FromDiscord<nocturn9x> I've turned a bunch of `ref`s into objects and only pass them around as `var` parameters when I need to mutate them
15:18:01FromDiscord<nocturn9x> it was all going well until I changed one object and now everything broke
15:18:20FromDiscord<odexine> well there should not be any problem with that from just hearing it
15:18:29FromDiscord<nocturn9x> yeah, hence my confusion
15:18:44FromDiscord<nocturn9x> I've also tried increasing the stack size to 64MB just to ensure I wasn't just hitting stack size limits
15:18:58FromDiscord<odexine> okay hit us with the full code, loc be damned
15:19:05FromDiscord<nocturn9x> let me push to the branch
15:20:06FromDiscord<nocturn9x> <https://git.nocturn9x.space/nocturn9x/heimdall/src/branch/refactor>
15:20:32FromDiscord<nocturn9x> diff: <https://git.nocturn9x.space/nocturn9x/heimdall/compare/master..refactor>
15:20:38FromDiscord<nocturn9x> (it's alot
15:20:40FromDiscord<nocturn9x> (edit) "alot" => "a lot)"
15:21:09FromDiscord<nocturn9x> the problem occurs in `search.nim`: inside `pickMoves` I iteratively call `getEstimatedMoveScore`. The call segfaults
15:21:30FromDiscord<nocturn9x> I tried importing `std/segfaults` to hopefully turn the segfault into a defect and figure out where it's coming from, but that's not working
15:21:46FromDiscord<odexine> that module kinda doesnt work yeah
15:21:56FromDiscord<nocturn9x> it has worked most of the time I've used it
15:23:20FromDiscord<nocturn9x> hopefully someone with a bit more experience than me can at least figure out where the segfault is _actually_ happening
15:23:43Amun-Rahave you played with sanitizers?
15:24:05FromDiscord<nocturn9x> nope
15:24:11Amun-Raand/or checked core file?
15:24:20FromDiscord<nocturn9x> they will probably complain about a lot of crap since I use `{.cast(gcsafe).}`
15:24:21Amun-Raturn asan/ubsan on and recheck
15:24:51FromDiscord<nocturn9x> will do
15:25:12FromDiscord<nocturn9x> hm
15:25:17FromDiscord<nocturn9x> my linker can't find ASAN
15:25:59FromDiscord<nocturn9x> ah, linker flags need `-fsanitize=address` as well
15:26:12Amun-Ra-fsanitize=address,undefined
15:26:33Amun-Raand add -lasan -lubsan (some compilers do that for you automagically)
15:27:27FromDiscord<nocturn9x> nope, nothinmg
15:27:29FromDiscord<nocturn9x> (edit) "nothinmg" => "nothing"
15:27:31FromDiscord<nocturn9x> still just segfaults
15:27:47Amun-Rahmm
15:27:51FromDiscord<nocturn9x> I bet it has something to do with the object I'm passing around being nearly 300KiB in size
15:28:05FromDiscord<nocturn9x> but I have extended the stack size to 64MB
15:28:06Amun-Rainspect corefile
15:28:08FromDiscord<nocturn9x> that should be plentyful
15:28:17FromDiscord<nocturn9x> In reply to @Amun-Ra "inspect corefile": no core dump is generated
15:28:29FromDiscord<nocturn9x> nor would I know how to inspect it anyway
15:28:42Amun-Raperpahps it's turned off
15:28:51Amun-Raulimit -c unlimited
15:29:40FromDiscord<nnsee> In reply to @nocturn9x "it would take as": pro tip for minimal effort reproducers: concat everything into one file and use https://github.com/csmith-project/creduce
15:29:56FromDiscord<nocturn9x> In reply to @nnsee "pro tip for minimal": it's nearly 5500 lines of nim code
15:30:08FromDiscord<nnsee> yes. creduce is really good
15:30:08FromDiscord<nocturn9x> again, building a reproducible example out of this will take me as much time as just undoing shit
15:30:28FromDiscord<nocturn9x> hm
15:30:40FromDiscord<nocturn9x> even the concatenation process itself will take me eons
15:30:58FromDiscord<nocturn9x> unless you expect me to concat the C code, which would take even more time and wouldn't tell me where the crash is actually happening
15:31:49FromDiscord<nocturn9x> In reply to @Amun-Ra "ulimit -c unlimited": still does not generate a core dump
15:32:38FromDiscord<nocturn9x> meh whatever I'll just start undoing stuff until it works again
15:35:11FromDiscord<nocturn9x> oh, I managed to get it to core dump
15:35:17FromDiscord<nocturn9x> only in danger mode though
15:35:21FromDiscord<nocturn9x> how do I inspect it?
15:36:55FromDiscord<nocturn9x> still prints the wrong thing https://media.discordapp.net/attachments/371759389889003532/1316428510587523132/image.png?ex=675b0316&is=6759b196&hm=2922d78558eac938ef437e6c97fb124ef2c755290db951bc4c363d2b3de17aa7&
15:39:46*ntat joined #nim
15:44:09*GreaseMonkey quit (Ping timeout: 260 seconds)
15:48:06*nils` joined #nim
15:57:23*greaser|q joined #nim
16:16:47*GnuYawk6 quit (Quit: The Lounge - https://thelounge.chat)
16:17:09*GnuYawk6 joined #nim
16:22:54FromDiscord<Robyn [She/Her]> In reply to @nnsee "pro tip for minimal": there should be a tool that concats Nim code from massive projects into one file
16:23:23FromDiscord<nocturn9x> it would need to resolve imports
16:23:29FromDiscord<nocturn9x> or, worse, turn them all into `include`s
16:24:14FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "it would need to": Yeah
16:24:21FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "or, worse, turn them": That would just break
16:24:28FromDiscord<nocturn9x> most likely, yes
16:42:26FromDiscord<nocturn9x> question
16:43:21FromDiscord<odexine> answer
16:43:24FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=FyVKJagL
16:43:26FromDiscord<odexine> sorry i had to it was mildly funny
16:43:29FromDiscord<nocturn9x> and this doesn0t
16:43:32FromDiscord<nocturn9x> (edit) "doesn0t" => "doesn't"
16:43:43FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=IjdReiwJ
16:43:46FromDiscord<nocturn9x> it says there's a type mismatch
16:43:48FromDiscord<nocturn9x> the fuck?
16:44:40FromDiscord<nocturn9x> also, if I make `session` a var parameter instead, then Nim generates invalid C code
16:44:49FromDiscord<nocturn9x> which is an incredibly annoying problem I've spotted in a few places
16:45:03FromDiscord<odexine> you cant have a var inside a tuple
16:45:12FromDiscord<odexine> plus that would kinda be fucky with the thread pragma as well
16:45:13FromDiscord<nocturn9x> well then the compiler should warn me about it lol
16:45:21FromDiscord<nocturn9x> what about `ptr`
16:45:32FromDiscord<nocturn9x> why is it saying there's a type mismatch when the type is literally correct
16:45:34FromDiscord<odexine> i think you need to be careful with ptrs passed to threads
16:45:55FromDiscord<nocturn9x> believe me I am acutely aware
16:45:58FromDiscord<nocturn9x> this is not my problem
16:46:02FromDiscord<nocturn9x> the problem is it doesn't compile and it should
16:46:12FromDiscord<odexine> type mismatch sounds like the wrong error, seems like a compiler or stdlib bug maybe yes
16:46:25FromDiscord<nocturn9x> bruh
16:47:05FromDiscord<nocturn9x> so I can't pass pointers to threads?
16:47:43FromDiscord<odexine> im pretty sure you should be able to, especially in that manner (of course being careful that the function doesnt exit before the thread does...)
16:47:52FromDiscord<nocturn9x> that is already ensured
16:48:00FromDiscord<nocturn9x> so why exactly is the nim compiler being retarded here
16:48:25FromDiscord<nocturn9x> see it's bugs like these that make me think nim will never go mainstream
16:48:31FromDiscord<nocturn9x> like, this is trivial crap
16:48:33FromDiscord<nocturn9x> and it doesn't work
16:48:47FromDiscord<nocturn9x> why the fuck is araq bothering with new features when the shit that's already there is, well, shit
16:50:31FromDiscord<odexine> sent a code paste, see https://play.nim-lang.org/#pasty=uCeEUzQI
16:50:37FromDiscord<odexine> https://media.discordapp.net/attachments/371759389889003532/1316447058541936640/image.png?ex=675b145d&is=6759c2dd&hm=90d68ac7597f8d76b59b3dd1bacf1b4e582082f2a6cbd7d3d17f022d8cc5b825&
16:50:38FromDiscord<nocturn9x> nim version?
16:50:41FromDiscord<odexine> 2.2
16:50:47FromDiscord<nocturn9x> I'm using 2.0.4
16:50:51FromDiscord<nocturn9x> perhaps the bug was fixed then
16:50:53FromDiscord<nocturn9x> let me try
16:51:07FromDiscord<odexine> same thing https://media.discordapp.net/attachments/371759389889003532/1316447184748544011/image.png?ex=675b147b&is=6759c2fb&hm=ccabd39c4bec0fbf22da647fb5f8458abe10c9792327c4bbb569cce769e03c95&
16:51:22FromDiscord<nocturn9x> bruh
16:51:44FromDiscord<odexine> ill look at ucisession wait
16:51:57FromDiscord<nocturn9x> try making UCIsession an `object`
16:52:01FromDiscord<nocturn9x> and add fields
16:52:19FromDiscord<odexine> can you point me to the file where that type is located
16:52:47FromDiscord<nocturn9x> <https://git.nocturn9x.space/nocturn9x/heimdall/src/branch/master/heimdall/heimdallpkg/uci.nim>
16:52:49FromDiscord<nocturn9x> at the very top
16:52:55FromDiscord<odexine> ok
16:53:15FromDiscord<odexine> `ptr Atomic[bool]` makes me suspicious for some reason
16:53:19FromDiscord<odexine> ah
16:53:21FromDiscord<odexine> `seq`
16:53:29FromDiscord<nocturn9x> is the sequence the problem?
16:53:29FromDiscord<odexine> hello gc type
16:53:48FromDiscord<odexine> on arc/orc heaps are thread local
16:53:51FromDiscord<nocturn9x> I mean, does it matter? It shouldn't prevent the thing from compiling
16:53:57FromDiscord<nocturn9x> In reply to @odexine "on arc/orc heaps are": I'm using atomicArc
16:53:58FromDiscord<odexine> thats true
16:54:01FromDiscord<nocturn9x> also afaik no
16:54:05FromDiscord<nocturn9x> they are not in fact thread local
16:54:08FromDiscord<odexine> weird still it doesnt compile then hm
16:54:12FromDiscord<nocturn9x> that's the whole point of me using ARC
16:54:22FromDiscord<nocturn9x> none of my engine would work if that were the case
16:54:32FromDiscord<odexine> i was pretty sure it was mentioned to be thread local but i might be on way outdated knowledge
16:55:50FromDiscord<odexine> yeah no i forgot its backwards indeed, refc is thread local
16:56:06FromDiscord<odexine> thats besides the point its still strange that it does not compile
16:56:22FromDiscord<odexine> it might be the atomic but the type mismatch doesnt make sense at all
16:58:26FromDiscord<nocturn9x> I know I'm doing some pretty horrible stuff here
16:58:38FromDiscord<odexine> nope i dont judge this at all lol
16:58:38FromDiscord<nocturn9x> but all of the awful stuff is to work around nim's broken threading model
16:58:48FromDiscord<odexine> doesnt look awful to me imo
16:59:03FromDiscord<odexine> im just as baffled by the error as you are i guess
16:59:06FromDiscord<nocturn9x> well it does to the compiler, I have to use `{.cast(gcsafe).}` pretty extensively
16:59:19FromDiscord<nocturn9x> In reply to @odexine "im just as baffled": meh I'll just work around it and make `UCISession` a `ref` and see if that does it
17:00:03FromDiscord<odexine> the min repro compiles even at nim 1.0.10 lol
17:00:11FromDiscord<odexine> got no clue at all
17:06:55FromDiscord<nocturn9x> 🤷
17:40:36*krux02 joined #nim
18:28:05*beholders_eye joined #nim
19:42:45FromDiscord<pmunch> AoC stream is up https://www.twitch.tv/pmunche and https://www.youtube.com/watch?v=qUK3SOb0NqM
19:52:05*vukung left #nim (Leaving)
20:05:39*beholders_eye quit (Ping timeout: 252 seconds)
20:13:46*greaser|q quit (Changing host)
20:13:46*greaser|q joined #nim
20:13:48*greaser|q is now known as GreaseMonkey
21:22:49*rockcavera joined #nim
21:40:52*ntat quit (Quit: Leaving)
21:41:03*rockcavera quit (Remote host closed the connection)
21:42:46FromDiscord<whorf> sent a code paste, see https://play.nim-lang.org/#pasty=vmiPxLKY
21:42:53FromDiscord<whorf> (edit) "https://play.nim-lang.org/#pasty=GBKWzAxH" => "https://play.nim-lang.org/#pasty=GoeAjmup"
21:43:44FromDiscord<whorf> (edit) "https://play.nim-lang.org/#pasty=wPCHqPSM" => "https://play.nim-lang.org/#pasty=hRfKHzDS"
21:48:11*rockcavera joined #nim
21:49:03FromDiscord<System64 ~ Flandre Scarlet> Does Nim have something for Lua please?
21:54:01FromDiscord<griffith1deadly> In reply to @sys64 "Does Nim have something": https://github.com/search?q=lua+language%3ANim&type=repositories&s=stars&o=desc
21:58:02FromDiscord<System64 ~ Flandre Scarlet> In reply to @griffith1deadly "https://github.com/search?q=lua+language%3ANim&type": Oh, there is an official one!↵https://github.com/glassesneo/spellua↵This one looks good too
22:36:46FromDiscord<Elegantbeef> @whorf it feels a bit manual cause it's memory unsafe write a `getValue` that does it internally then you can just `db.getValue[: seq[float]]`
22:36:57FromDiscord<Elegantbeef> Same for inserting
23:03:09*attah quit (Ping timeout: 244 seconds)
23:04:57*attah joined #nim
23:52:13*pmp-p quit (Read error: Connection reset by peer)
23:52:18*pmp-p joined #nim