00:17:10 | FromDiscord | <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:59 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#pasty=xqQXsZfY |
01:08:18 | FromDiscord | <4zv4l> the first one take a wrong row somewhow |
01:08:22 | FromDiscord | <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:09 | FromDiscord | <odexine> those arent equivalent? second one does `sheet[1..^1][x][0] for all indices x` (pseudo ofc) |
02:42:29 | FromDiscord | <4zv4l> yeah so thats weird the first one isnt working for me xD |
02:42:36 | FromDiscord | <4zv4l> oh wait what |
02:42:41 | FromDiscord | <4zv4l> not equivalent ? |
02:44:11 | FromDiscord | <Elegantbeef> What type does the `[](sheet, 1..^1)` return? |
02:44:20 | FromDiscord | <Elegantbeef> If it's not a `seq[T]` or similar of course those are different |
02:47:36 | FromDiscord | <4zv4l> oh I think I get it |
02:48:08 | FromDiscord | <4zv4l> yeah it makes sense |
03:25:49 | FromDiscord | <maxtachine> how can I use choosenim for switching to 32bit nim? |
03:33:28 | FromDiscord | <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:54 | FromDiscord | <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:47 | FromDiscord | <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:54 | FromDiscord | <Robyn [She/Her]> Zig CC makes this a breeze :P |
12:23:48 | * | bcksl joined #nim |
12:28:58 | * | end joined #nim |
13:35:21 | FromDiscord | <whorf> sent a code paste, see https://play.nim-lang.org/#pasty=AfhuaLrR |
13:51:20 | FromDiscord | <whorf> oh, this maybe isn't possible? <https://forum.nim-lang.org/t/1773> |
13:53:00 | FromDiscord | <pmunch> Hmm, don't we have a memset equivalent in Nim? |
13:53:18 | FromDiscord | <pmunch> @whorf, no that's not possible. Types doesn't really exist on runtime |
13:53:58 | FromDiscord | <pmunch> What exactly are you trying to achieve by having a sequence of types? |
14:09:33 | FromDiscord | <whorf> sent a code paste, see https://play.nim-lang.org/#pasty=ZRqzBEPj |
14:10:10 | FromDiscord | <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:58 | FromDiscord | <pmunch> Well you wouldn't really use anything other than a variable |
14:32:33 | FromDiscord | <pmunch> sent a code paste, see https://play.nim-lang.org/#pasty=vHFVMoyW |
14:42:47 | FromDiscord | <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:10 | FromDiscord | <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:30 | FromDiscord | <nocturn9x> uhm |
15:15:36 | FromDiscord | <nocturn9x> is it possible that just calling a function segfaults? |
15:16:02 | FromDiscord | <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:15 | FromDiscord | <nocturn9x> the last point where I can definitely say something is happening is before calling a specific function |
15:16:19 | FromDiscord | <nocturn9x> then it segfaults |
15:16:21 | FromDiscord | <nocturn9x> what the fuck? |
15:16:36 | FromDiscord | <nocturn9x> context: I'm passing a ~290KiB `object` around |
15:16:39 | FromDiscord | <odexine> do you have the (prolly preferably full) code for this |
15:16:52 | FromDiscord | <nocturn9x> In reply to @odexine "do you have the": if you want to read thousands of lines of code, yes |
15:16:57 | FromDiscord | <nocturn9x> lol |
15:17:01 | FromDiscord | <odexine> min repro |
15:17:07 | FromDiscord | <nocturn9x> that is not possible |
15:17:21 | FromDiscord | <nocturn9x> it would take as much effort to make a reproducible example as it would to just revert the change I made |
15:17:30 | FromDiscord | <odexine> well then what is the change |
15:17:52 | FromDiscord | <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:01 | FromDiscord | <nocturn9x> it was all going well until I changed one object and now everything broke |
15:18:20 | FromDiscord | <odexine> well there should not be any problem with that from just hearing it |
15:18:29 | FromDiscord | <nocturn9x> yeah, hence my confusion |
15:18:44 | FromDiscord | <nocturn9x> I've also tried increasing the stack size to 64MB just to ensure I wasn't just hitting stack size limits |
15:18:58 | FromDiscord | <odexine> okay hit us with the full code, loc be damned |
15:19:05 | FromDiscord | <nocturn9x> let me push to the branch |
15:20:06 | FromDiscord | <nocturn9x> <https://git.nocturn9x.space/nocturn9x/heimdall/src/branch/refactor> |
15:20:32 | FromDiscord | <nocturn9x> diff: <https://git.nocturn9x.space/nocturn9x/heimdall/compare/master..refactor> |
15:20:38 | FromDiscord | <nocturn9x> (it's alot |
15:20:40 | FromDiscord | <nocturn9x> (edit) "alot" => "a lot)" |
15:21:09 | FromDiscord | <nocturn9x> the problem occurs in `search.nim`: inside `pickMoves` I iteratively call `getEstimatedMoveScore`. The call segfaults |
15:21:30 | FromDiscord | <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:46 | FromDiscord | <odexine> that module kinda doesnt work yeah |
15:21:56 | FromDiscord | <nocturn9x> it has worked most of the time I've used it |
15:23:20 | FromDiscord | <nocturn9x> hopefully someone with a bit more experience than me can at least figure out where the segfault is _actually_ happening |
15:23:43 | Amun-Ra | have you played with sanitizers? |
15:24:05 | FromDiscord | <nocturn9x> nope |
15:24:11 | Amun-Ra | and/or checked core file? |
15:24:20 | FromDiscord | <nocturn9x> they will probably complain about a lot of crap since I use `{.cast(gcsafe).}` |
15:24:21 | Amun-Ra | turn asan/ubsan on and recheck |
15:24:51 | FromDiscord | <nocturn9x> will do |
15:25:12 | FromDiscord | <nocturn9x> hm |
15:25:17 | FromDiscord | <nocturn9x> my linker can't find ASAN |
15:25:59 | FromDiscord | <nocturn9x> ah, linker flags need `-fsanitize=address` as well |
15:26:12 | Amun-Ra | -fsanitize=address,undefined |
15:26:33 | Amun-Ra | and add -lasan -lubsan (some compilers do that for you automagically) |
15:27:27 | FromDiscord | <nocturn9x> nope, nothinmg |
15:27:29 | FromDiscord | <nocturn9x> (edit) "nothinmg" => "nothing" |
15:27:31 | FromDiscord | <nocturn9x> still just segfaults |
15:27:47 | Amun-Ra | hmm |
15:27:51 | FromDiscord | <nocturn9x> I bet it has something to do with the object I'm passing around being nearly 300KiB in size |
15:28:05 | FromDiscord | <nocturn9x> but I have extended the stack size to 64MB |
15:28:06 | Amun-Ra | inspect corefile |
15:28:08 | FromDiscord | <nocturn9x> that should be plentyful |
15:28:17 | FromDiscord | <nocturn9x> In reply to @Amun-Ra "inspect corefile": no core dump is generated |
15:28:29 | FromDiscord | <nocturn9x> nor would I know how to inspect it anyway |
15:28:42 | Amun-Ra | perpahps it's turned off |
15:28:51 | Amun-Ra | ulimit -c unlimited |
15:29:40 | FromDiscord | <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:56 | FromDiscord | <nocturn9x> In reply to @nnsee "pro tip for minimal": it's nearly 5500 lines of nim code |
15:30:08 | FromDiscord | <nnsee> yes. creduce is really good |
15:30:08 | FromDiscord | <nocturn9x> again, building a reproducible example out of this will take me as much time as just undoing shit |
15:30:28 | FromDiscord | <nocturn9x> hm |
15:30:40 | FromDiscord | <nocturn9x> even the concatenation process itself will take me eons |
15:30:58 | FromDiscord | <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:49 | FromDiscord | <nocturn9x> In reply to @Amun-Ra "ulimit -c unlimited": still does not generate a core dump |
15:32:38 | FromDiscord | <nocturn9x> meh whatever I'll just start undoing stuff until it works again |
15:35:11 | FromDiscord | <nocturn9x> oh, I managed to get it to core dump |
15:35:17 | FromDiscord | <nocturn9x> only in danger mode though |
15:35:21 | FromDiscord | <nocturn9x> how do I inspect it? |
15:36:55 | FromDiscord | <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:54 | FromDiscord | <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:23 | FromDiscord | <nocturn9x> it would need to resolve imports |
16:23:29 | FromDiscord | <nocturn9x> or, worse, turn them all into `include`s |
16:24:14 | FromDiscord | <Robyn [She/Her]> In reply to @nocturn9x "it would need to": Yeah |
16:24:21 | FromDiscord | <Robyn [She/Her]> In reply to @nocturn9x "or, worse, turn them": That would just break |
16:24:28 | FromDiscord | <nocturn9x> most likely, yes |
16:42:26 | FromDiscord | <nocturn9x> question |
16:43:21 | FromDiscord | <odexine> answer |
16:43:24 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=FyVKJagL |
16:43:26 | FromDiscord | <odexine> sorry i had to it was mildly funny |
16:43:29 | FromDiscord | <nocturn9x> and this doesn0t |
16:43:32 | FromDiscord | <nocturn9x> (edit) "doesn0t" => "doesn't" |
16:43:43 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=IjdReiwJ |
16:43:46 | FromDiscord | <nocturn9x> it says there's a type mismatch |
16:43:48 | FromDiscord | <nocturn9x> the fuck? |
16:44:40 | FromDiscord | <nocturn9x> also, if I make `session` a var parameter instead, then Nim generates invalid C code |
16:44:49 | FromDiscord | <nocturn9x> which is an incredibly annoying problem I've spotted in a few places |
16:45:03 | FromDiscord | <odexine> you cant have a var inside a tuple |
16:45:12 | FromDiscord | <odexine> plus that would kinda be fucky with the thread pragma as well |
16:45:13 | FromDiscord | <nocturn9x> well then the compiler should warn me about it lol |
16:45:21 | FromDiscord | <nocturn9x> what about `ptr` |
16:45:32 | FromDiscord | <nocturn9x> why is it saying there's a type mismatch when the type is literally correct |
16:45:34 | FromDiscord | <odexine> i think you need to be careful with ptrs passed to threads |
16:45:55 | FromDiscord | <nocturn9x> believe me I am acutely aware |
16:45:58 | FromDiscord | <nocturn9x> this is not my problem |
16:46:02 | FromDiscord | <nocturn9x> the problem is it doesn't compile and it should |
16:46:12 | FromDiscord | <odexine> type mismatch sounds like the wrong error, seems like a compiler or stdlib bug maybe yes |
16:46:25 | FromDiscord | <nocturn9x> bruh |
16:47:05 | FromDiscord | <nocturn9x> so I can't pass pointers to threads? |
16:47:43 | FromDiscord | <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:52 | FromDiscord | <nocturn9x> that is already ensured |
16:48:00 | FromDiscord | <nocturn9x> so why exactly is the nim compiler being retarded here |
16:48:25 | FromDiscord | <nocturn9x> see it's bugs like these that make me think nim will never go mainstream |
16:48:31 | FromDiscord | <nocturn9x> like, this is trivial crap |
16:48:33 | FromDiscord | <nocturn9x> and it doesn't work |
16:48:47 | FromDiscord | <nocturn9x> why the fuck is araq bothering with new features when the shit that's already there is, well, shit |
16:50:31 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#pasty=uCeEUzQI |
16:50:37 | FromDiscord | <odexine> https://media.discordapp.net/attachments/371759389889003532/1316447058541936640/image.png?ex=675b145d&is=6759c2dd&hm=90d68ac7597f8d76b59b3dd1bacf1b4e582082f2a6cbd7d3d17f022d8cc5b825& |
16:50:38 | FromDiscord | <nocturn9x> nim version? |
16:50:41 | FromDiscord | <odexine> 2.2 |
16:50:47 | FromDiscord | <nocturn9x> I'm using 2.0.4 |
16:50:51 | FromDiscord | <nocturn9x> perhaps the bug was fixed then |
16:50:53 | FromDiscord | <nocturn9x> let me try |
16:51:07 | FromDiscord | <odexine> same thing https://media.discordapp.net/attachments/371759389889003532/1316447184748544011/image.png?ex=675b147b&is=6759c2fb&hm=ccabd39c4bec0fbf22da647fb5f8458abe10c9792327c4bbb569cce769e03c95& |
16:51:22 | FromDiscord | <nocturn9x> bruh |
16:51:44 | FromDiscord | <odexine> ill look at ucisession wait |
16:51:57 | FromDiscord | <nocturn9x> try making UCIsession an `object` |
16:52:01 | FromDiscord | <nocturn9x> and add fields |
16:52:19 | FromDiscord | <odexine> can you point me to the file where that type is located |
16:52:47 | FromDiscord | <nocturn9x> <https://git.nocturn9x.space/nocturn9x/heimdall/src/branch/master/heimdall/heimdallpkg/uci.nim> |
16:52:49 | FromDiscord | <nocturn9x> at the very top |
16:52:55 | FromDiscord | <odexine> ok |
16:53:15 | FromDiscord | <odexine> `ptr Atomic[bool]` makes me suspicious for some reason |
16:53:19 | FromDiscord | <odexine> ah |
16:53:21 | FromDiscord | <odexine> `seq` |
16:53:29 | FromDiscord | <nocturn9x> is the sequence the problem? |
16:53:29 | FromDiscord | <odexine> hello gc type |
16:53:48 | FromDiscord | <odexine> on arc/orc heaps are thread local |
16:53:51 | FromDiscord | <nocturn9x> I mean, does it matter? It shouldn't prevent the thing from compiling |
16:53:57 | FromDiscord | <nocturn9x> In reply to @odexine "on arc/orc heaps are": I'm using atomicArc |
16:53:58 | FromDiscord | <odexine> thats true |
16:54:01 | FromDiscord | <nocturn9x> also afaik no |
16:54:05 | FromDiscord | <nocturn9x> they are not in fact thread local |
16:54:08 | FromDiscord | <odexine> weird still it doesnt compile then hm |
16:54:12 | FromDiscord | <nocturn9x> that's the whole point of me using ARC |
16:54:22 | FromDiscord | <nocturn9x> none of my engine would work if that were the case |
16:54:32 | FromDiscord | <odexine> i was pretty sure it was mentioned to be thread local but i might be on way outdated knowledge |
16:55:50 | FromDiscord | <odexine> yeah no i forgot its backwards indeed, refc is thread local |
16:56:06 | FromDiscord | <odexine> thats besides the point its still strange that it does not compile |
16:56:22 | FromDiscord | <odexine> it might be the atomic but the type mismatch doesnt make sense at all |
16:58:26 | FromDiscord | <nocturn9x> I know I'm doing some pretty horrible stuff here |
16:58:38 | FromDiscord | <odexine> nope i dont judge this at all lol |
16:58:38 | FromDiscord | <nocturn9x> but all of the awful stuff is to work around nim's broken threading model |
16:58:48 | FromDiscord | <odexine> doesnt look awful to me imo |
16:59:03 | FromDiscord | <odexine> im just as baffled by the error as you are i guess |
16:59:06 | FromDiscord | <nocturn9x> well it does to the compiler, I have to use `{.cast(gcsafe).}` pretty extensively |
16:59:19 | FromDiscord | <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:03 | FromDiscord | <odexine> the min repro compiles even at nim 1.0.10 lol |
17:00:11 | FromDiscord | <odexine> got no clue at all |
17:06:55 | FromDiscord | <nocturn9x> 🤷 |
17:40:36 | * | krux02 joined #nim |
18:28:05 | * | beholders_eye joined #nim |
19:42:45 | FromDiscord | <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:46 | FromDiscord | <whorf> sent a code paste, see https://play.nim-lang.org/#pasty=vmiPxLKY |
21:42:53 | FromDiscord | <whorf> (edit) "https://play.nim-lang.org/#pasty=GBKWzAxH" => "https://play.nim-lang.org/#pasty=GoeAjmup" |
21:43:44 | FromDiscord | <whorf> (edit) "https://play.nim-lang.org/#pasty=wPCHqPSM" => "https://play.nim-lang.org/#pasty=hRfKHzDS" |
21:48:11 | * | rockcavera joined #nim |
21:49:03 | FromDiscord | <System64 ~ Flandre Scarlet> Does Nim have something for Lua please? |
21:54:01 | FromDiscord | <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:02 | FromDiscord | <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:46 | FromDiscord | <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:57 | FromDiscord | <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 |