<< 08-05-2020 >>

00:00:11skrylar[m]lol
00:06:07FromDiscord<dom96> > hmmm, @dom96 i'm working on writing a test case for the PR i put up and i'm curious as to why the test site for nimble is setup to run the binary and interpolate the behavior/output rather than attaching tests to the interfaces directly
00:06:08FromDiscord<dom96> @queersorceress there are tests that run functions directly too in some files.
00:07:46FromDiscord<queersorceress> mmm, i noticed that. i was just curious if there was a technical reason why some parts aren't done that way -- as the part i'm attempting to write a test for isn't as easy to do
00:08:17skrylar[m]https://gist.github.com/Skrylar/7b91149530800117300a54ac59df9b60 dunno if this is how chronicles did it, but neat.
00:10:06*krux02_ quit (Remote host closed the connection)
00:12:54*lritter quit (Ping timeout: 256 seconds)
00:16:51*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
00:35:08FromDiscord<Rika> why could i mutate `self` here but not in the other?
00:35:08FromDiscord<Rika> can: `proc aProc*[T: X or Y or Z](self: var T)`, cannot: `proc aProc*(self: var X or var Y or var Z)`
00:38:49FromDiscord<exelotl> hmm maybe its a bug / missing feature?
00:39:21FromDiscord<Rika> undocumented* feature
00:40:02FromDiscord<exelotl> feels like the compiler should be able to do some static analysis to know that all possibilities are mutable in the second example
00:40:28FromDiscord<queersorceress> @dom96 okay, pushed up the test and remaining minor change, PR #800 is ready for final review.
00:40:56skrylar[m]i thought the syntax was [T: X|Y|Z]
00:41:14FromDiscord<Auriel> what about
00:41:20FromDiscord<Rika> `|` and `or` is interchangeable
00:41:30FromDiscord<Auriel> ```nim
00:41:30FromDiscord<Auriel>
00:41:30FromDiscord<Auriel> type
00:41:30FromDiscord<Auriel> A = object
00:41:30FromDiscord<Auriel> B = object
00:41:30FromDiscord<Auriel> C = A or B
00:41:31FromDiscord<Auriel>
00:41:31FromDiscord<Auriel> proc test(t: var C) = discard
00:41:32FromDiscord<Auriel> ```
00:41:49skrylar[m]if you paste in to discord, the irc and matrix users will lynch you
00:41:50FromDiscord<Auriel> oh sorry forgot to put on pastebin
00:41:55FromDiscord<Rika> https://play.nim-lang.org/#ix=2lcy here
00:41:56FromDiscord<exelotl> Oh yeah that's a nice solution
00:41:57FromDiscord<Auriel> 3am here
00:42:17FromDiscord<Rika> i still prefer generics
00:42:30FromDiscord<Rika> that other one's indirect here
00:42:54FromDiscord<exelotl> It's too late auriel, the velociraptors have already been released
00:43:40FromDiscord<Rika> the helicopters have been dispatched
00:46:13FromDiscord<Auriel> maybe try var A or B looks like its compiles successfully on playground
00:46:59FromDiscord<Rika> definitely successful to me
00:46:59FromDiscord<Rika> https://cdn.discordapp.com/attachments/371759389889003532/708117710223179786/unknown.png
00:47:09FromDiscord<Auriel> nope
00:47:15FromDiscord<Auriel> var X or Y
00:47:34FromDiscord<Rika> mmmmmm
00:47:34FromDiscord<Rika> https://cdn.discordapp.com/attachments/371759389889003532/708117861117329428/unknown.png
00:47:46FromDiscord<treeform> @mratsim more from just use threads camp: https://news.ycombinator.com/item?id=23107945
00:58:29*ptdel joined #nim
01:01:21Yardanicobtw guys os any is awesome
01:01:28Yardaniconim c --gc:arc --os:any -d:posix -d:danger --opt:size --cc:clang --panics:on --clang.exe"=test.sh" --clang.linkerexe="test.sh" --passC:"-target x86_64-linux-musl" --passL:"-target x86_64-linux-musl" -r hello.nim
01:01:32Yardanicothe binary after stripping is 20kb
01:01:35Yardanico(hello world)
01:01:51Yardanicowith no some panicoverride tricks
01:02:53Yardanicobtw is it intended that nim doesn't allow for --clang.exe to contain spaces?
01:03:11Yardanicoit runs the command as 'zig cc' command
01:03:17Yardaniconotice the quotes
01:07:54skrylar[m]it looks like you have an equals sign transposed in that
01:08:07skrylar[m]--clang.exe"=test.sh"
01:11:17*ertp07 quit (Read error: Connection reset by peer)
01:12:24*ertp07 joined #nim
01:12:24*dadada quit (Ping timeout: 256 seconds)
01:17:06FromDiscord<Yardanico> Well yeah that's not the problem here though :)
01:17:38FromDiscord<Yardanico> I mean if you have --clang.exe="zig cc" it won't work
01:28:04*fredrikhr quit (Ping timeout: 246 seconds)
01:33:23FromGitter<deech> Has the Nim compiler gotten noticeably slower for anyone else? I'm compiling from HEAD.
01:37:19FromDiscord<Varriount> @deech might be due to https://github.com/nim-lang/Nim/issues/14179
01:39:27FromDiscord<Varriount> Deech: What flags did you compile the compiler with?
01:39:43Yardanicoyeah the nim compiler itself (the nim compilation step) is pretty fast usually
01:40:04Yardanicoit takes ~4-4.5s for me to do the nim compilation step for the compiler
01:42:39Yardanicooh actually with LTO the binary gets to 16kb
01:42:40*ertp07 quit (Read error: Connection reset by peer)
01:42:44Yardanicothat's without any panicoverride stuff :)
01:42:50Yardaniconim c --gc:arc --os:any -d:posix -d:danger --opt:size --cc:clang --panics:on --clang.exe="test.sh" --clang.linkerexe="test.sh" --passC:"-target x86_64-linux-musl -flto" --passL:"-ta
01:42:50Yardanicorget x86_64-linux-musl -flto" -r hello.nim
01:42:53*ertp07 joined #nim
01:42:58Yardanicotest.sh is just calling "zig cc"
01:43:05Yardanicoand we get a fully static 16kb binary
01:44:07*chemist69 quit (Ping timeout: 260 seconds)
01:45:58*chemist69 joined #nim
01:46:16FromGitter<deech> Varriount: just the default `nim c ...`, granted I'm doing a bunch of compile time stuff in the VM but the same code has become noticeably.
01:47:56FromGitter<deech> Compiler was built with `./koch boot -d:release`.
01:48:28Yardanicois there a way I can make nim insert my compiler flags after nim's own compiler flags?
01:48:40Yardanicofor c
01:48:42Yardanicocompiler
01:59:15zacharycarterjust blame disruptek for any slowdowns in compiliation times
01:59:30zacharycarteric actually means incrementally slower compliation
02:04:54FromDiscord<Rika> ic means inhibited compilation
02:06:38skrylar[m]hey writing compilers sucks :^
02:07:04Yardanicoso I can't go any lower than 16kb I guess, can't think of any other tricks
02:07:12Yardanicowithout changing the nim source code or using --os:standalone ;)
02:07:19FromDiscord<Rika> there's even a whole branch of science for compilers!
02:07:26Yardaniconim c --gc:arc -f --os:any -d:posix -d:danger --opt:size --cc:clang --panics:on --clang.exe="test.sh" —clang.linkerexe="test.sh" --passC:"-target x86_64-linux-musl -flto" --passL:"-target x86_64-linux-musl -flto" -r hello.nim
02:07:30Yardanicothat's the current command
02:08:29FromDiscord<Rika> what does the posix define do?
02:08:44Yardanicoso that osalloc.nim uses posix's page allocation APIs
02:09:04Yardaniconim allocator doesn't use malloc, it uses page allocation by the OS directly (unless you pass -d:useMalloc)
02:09:55Yardanicohttps://github.com/nim-lang/Nim/blob/devel/lib/system/osalloc.nim#L194
02:10:05Yardanicoposix define also does other things in other places
02:14:25Yardanicowait what is going on, when I use same compiler flags in nim.cfg the binary is bigger
02:14:25Yardanicowat
02:15:40*dddddd quit (Ping timeout: 246 seconds)
02:17:38skrylar[m]wellsee you made it do more work by having to read another file :^
02:18:02Yardanicoskrylar[m]: I think the issue is that when I pass options directly they're the top priority (?) and otherwise nim reads config files first or something
02:18:07YardanicoC command seems to be the same
02:18:14YardanicoI mean c compiler invocation
02:18:23skrylar[m]it does read other config files (theres a config hint for that)
02:18:29Yardanicoyeah i know
02:18:40Yardanicobut the binary size becomes 48kb instead of 24kb (before stripping)
02:18:46Yardanicowith literally same arguments in cmdline/nim.cfg
02:19:09skrylar[m]is it actually using the cfg file from there?
02:19:12Yardanicoyes
02:19:18skrylar[m]oh.
02:19:32Yardanicowith direct options: CC: stdlib_io.nim: test.sh -c -w -target x86_64-linux-musl -flto -Os -I/home/dian/.nim/lib -I/home/dian/Projects/data -o /home/dian/.cache/nim/hello_r/stdlib_io.nim.c.o /home/dian/.cache/nim/hello_r/stdlib_io.nim.c
02:19:38Yardanicowith cfg: CC: stdlib_io.nim: test.sh -c -w -target x86_64-linux-musl -flto -Os -I/home/dian/.nim/lib -I/home/dian/Projects/data -o /home/dian/.cache/nim/hello_r/stdlib_io.nim.c.o /home/dian/.cache/nim/hello_r/stdlib_io.nim.c
02:19:43*muffindrake quit (Ping timeout: 260 seconds)
02:20:19Yardanicoseems like in this case it doesn't apply -d:danger for some reason
02:21:52*muffindrake joined #nim
02:22:00Yardanicoif I put all switches for disabling checks which are defined for danger to nim.cfg it has the same size
02:23:10skrylar[m]sounds like a bug
02:27:16Yardanicoskrylar[m]: It's also rather easy to replicate
02:27:36Yardanicotry to do "nim c -d:danger yourfile.nim" and then "nim c yourfile.nim" when you have -d:danger in your nim.cfg
02:27:54Yardanicoand compare binary sizes :)
02:30:38skrylar[m]https://pastebin.com/ZAvu0Lis
02:30:46Yardanico:DD
02:30:49Yardanicoreally weird
02:31:08Yardanicoguess -d:danger doesn't define -d:release if it's in a config so files which use defined(release) don't get it?
02:31:10Yardanicoor something like that
02:32:45Yardanicohttps://github.com/nim-lang/Nim/issues/14272
02:34:18Yardanicoseems like -d:danger doesn't define -d:release when put in a config file lol
02:36:07Yardanicohttps://forum.nim-lang.org/t/5878 is related
02:36:11YardanicoI thought it was fixed since then lol
02:37:03Yardanicomy life is a lie now if I ever compiled apps with -d:danger in config files /s
02:37:15zedeushm I got hello world down to 12kb
02:37:21Yardanicozedeus: with what?
02:37:29Yardanicodo you link statically?
02:37:38YardanicoIn my case 16kb was static linking with musl
02:37:48zedeusah no that was dynamic
02:38:03zedeus28kb static
02:38:09skrylar[m]taped on the replication script
02:38:30Yardanicoskrylar[m]: you forgot main.nim :D
02:38:42Yardanicoand what is test-line
02:38:48Yardanicoah I see main.nim sorry
02:38:57Yardanicoah sorryI'm stupid
02:38:59YardanicoI can't read bash
02:39:27skrylar[m]bash may have been invented by satan's toilet paper, but if i put a fish script up there nobody will know what to do with it
02:39:40*theelous3 quit (Ping timeout: 256 seconds)
02:39:50Yardanicohey I use fish
02:40:10Yardanicoupdated the title again btw
02:40:12skrylar[m]then you are doing it right ><^>
02:41:02skrylar[m]mu looks like an average vm with a couple type hints bolted on
02:41:20Yardanicowell nim vm isn't exactly bad either :P
02:41:24Yardanicoit's register based
02:41:29skrylar[m]which i guess is nice since some of those hints are for gc trace points; wasm is like .. hey we know this is to be used with a gc language but whats a gc
02:42:20zedeuswith your command I get 14464 bytes without zig
02:42:28Yardanicozedeus: with clang or ?
02:42:37YardanicoI mean I didn't count the bytes
02:42:45zedeussame command but I removed the test.sh args
02:42:50zedeus16kb
02:42:54Yardanicostatic?
02:42:57Yardanicowith -static or how?
02:43:17zedeusnim c --gc:arc --os:any -d:posix -d:danger --opt:size --cc:clang --panics:on --passC:"-target x86_64-linux-musl -flto" --passL:"-target x86_64-linux-musl -flto" -r hello.nim
02:43:21Yardanicoit's actually 13312 for me
02:43:24Yardanicowith zig
02:44:12Yardanicosorry, after stripping
02:44:21Yardanico(strip -s)
02:44:30Yardanicobefore that it's 20768
02:44:50Yardanicoah I know how to reduce it even further
02:45:11Yardanico-d:noSignalHandler
02:45:20Yardanicoafter stripping I get 11832
02:46:45Yardanico"strings" gives almost no strings
02:47:17zedeushmm that doesn't seem to do anything for me
02:47:17YardanicoI only see elf section names, c compiler/linker versions, hello world itself, "out of memory" and "/dev/null"
02:47:23Yardanicoweird
02:47:36Yardanicoit's supposed to remove default signal handlers
02:48:31YardanicoI'm using nim c --gc:arc -f --os:any -d:posix -d:danger --opt:size --cc:clang --panics:on -d:noSignalHandler --clang.exe="test.sh" --clang.linkerexe="test.sh" --passC:"-target x86_64-linux-musl -flto" --passL:"-target x86_64-linux-musl -flto" -r hello.nim
02:49:52*zacharycarter quit (Ping timeout: 256 seconds)
02:50:42zedeushmm it goes from 14464 to 14360, so it's doing something
02:50:50Yardanicomaybe different compiler options and stuff :0
02:50:55*jds_dizzy_ joined #nim
02:50:56Yardanicoalso zig embeds clang/lld 10
02:51:38YardanicoI wonder if you can even know the binary was made in nim at this point :D
02:51:45Yardanicoliterally nothing in the binary points to it
02:52:45jds_dizzy_Any resources on asyncnet other than documentation. Struggling
02:52:48zedeusgot 12664 now
02:53:05zedeususing --cc:zig (behind devel by a few commits so it's still there)
02:53:14Yardanicozedeus: you can get around ~150 bytes smaller but it'll change source code
02:53:15FromGitter<sealmove> Guys, do you know any bitstream implementation?
02:53:17skrylar[m]didn't there used to be part of the manual about custom arenas on pointers
02:53:22Yardanicoproc start {.exportc: "main"} = echo "Hello world"
02:53:27Yardanicoand add --noMain
02:53:37skrylar[m]@sealmove a bit too vague
02:54:08zedeuswoah
02:54:13zedeus5840
02:54:40Yardanicowat
02:54:42Yardanicobruh
02:54:46Yardanicohow even?
02:54:57FromGitter<sealmove> I need procs for read/writing arbitary number of bits. It should be initializable from an `seq[byte]`.
02:56:24skrylar[m]ah no i don't know of one
02:58:03FromGitter<sealmove> Trying to implement one gave me headache
03:00:36skrylar[m]lidgren has one (C#) and its uh, a bit counter and a little buffer int
03:00:36*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
03:01:39FromGitter<sealmove> Yeah, I want something like this, can you link it?
03:02:21skrylar[m]https://github.com/lidgren/lidgren-network-gen3/blob/master/Lidgren.Network/NetBuffer.Write.cs
03:03:12FromGitter<sealmove> thanks
03:08:46FromGitter<sealmove> So should I inherit stdlib's `Streams`?
03:09:32FromGitter<sealmove> Docs say something about *overriding* proc fields: https://nim-lang.org/docs/streams.html#StreamObj
03:09:50FromGitter<sealmove> How does this work in Nim?
03:10:01FromGitter<ynfle> (https://files.gitter.im/nim-lang/Nim/3gQA/Screen-Shot-2020-05-07-at-10.40.27-PM.png)
03:10:10FromGitter<ynfle> Can anyone help me with this?
03:10:16*Condor quit (Ping timeout: 256 seconds)
03:10:18Yardanicoshow the error
03:10:25Yardanicoah I see
03:10:29FromGitter<ynfle> I'm getting `Error: undeclared identifier: 'JsonTestResult'`
03:10:30Yardanicoah no
03:10:42Yardanico@ynfle you declared it as JsonTestReslt
03:10:46Yardanicothe ide even highlights that for you
03:11:37FromGitter<ynfle> @Yardanico 45 minutes of debugging at least
03:11:39FromGitter<ynfle> Thx
03:11:42Yardanicowat
03:11:53skrylar[m]@sealmove think its more that you need to store a bit offset and if its 8 you can just copy to the output stream, if its not 8 you have to sit and bit twiddle
03:13:41*Tlongir quit (Remote host closed the connection)
03:14:07FromDiscord<Rika> sealmove: overriding here means that there's a default implementation stored in the object, and you can change that in the initialization of the object, so its more like "changing the function the actual flush procs use"
03:14:30FromDiscord<Rika> its not static overriding but its what we got
03:22:01jds_dizzy_Any resources on asyncnet other than doc
03:22:55Yardanicowhat do you exactly want to know?
03:24:55jds_dizzy_Get a better understanding of how the asynchronous-ness works so I can control it, rn I’m trying to set up a basic client server app and can’t seem to get the data to back to the client
03:25:10FromDiscord<Rika> yardanico the bot died i assume
03:25:26Yardanicoit restarts itself
03:25:31FromDiscord<Rika> i know
03:25:45FromDiscord<Rika> its a notification so you can check what triggered the crash
03:26:32FromGitter<sealmove> Rika: But what's an example? How do I make a custom stream that uses the interface? I have never used interfaces in Nim.
03:26:47Yardanico@sealmove inherit your stream type from Stream
03:27:04Yardanicoand assign procs to your implementations on your stream object creation (e.g. in newStreamType() proc)
03:27:16Yardanicoyou can always check src of the stdlib
03:27:17Yardanicoit's not hard
03:27:29Yardanicohttps://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/streams.nim#L1188
03:27:34Yardanicohttps://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/streams.nim#L1255
03:28:19FromGitter<sealmove> oh nice! thanks
03:31:47skrylar[m]humm was thinking about state changes in gl and probably need an object to hold target state and do comparisons .. then realized probably should just have it store the hash instead .. bleh. should finish the xxhash port i guess
03:31:49FromGitter<sealmove> So I guess I should implement these procs *and* also add new ones for working with bits
03:38:16*ptdel joined #nim
03:39:15*zacharycarter joined #nim
03:42:22*rockcavera quit (Remote host closed the connection)
03:43:32*zacharycarter quit (Ping timeout: 246 seconds)
03:50:37FromDiscord<codic> What's `long` in nim?
03:50:44FromDiscord<codic> c_long?
03:52:20FromGitter<bung87> clong
03:52:55*jwm224 quit (Quit: WeeChat 2.9-dev)
03:53:44FromDiscord<codic> seems so
03:53:50FromDiscord<codic> how do I initialize a clong?
03:53:51Yardanico@bung86 c_long == clong :P
03:54:02Yardanico!eval var test: clong = 5; echo test
03:54:05NimBot5
03:54:06FromGitter<bung87> how to write proc param : TypeA or Typeb in Nim?
03:54:07Yardanicovoila
03:54:15Yardanicobung87 typeB
03:54:18FromGitter<bung87> Yardanico ok I use to using clong
03:54:21Yardanicoor wait
03:54:24YardanicoI don't understand you
03:54:26Yardanicoyou mean return type?
03:54:40FromGitter<bung87> params type (A|B)
03:54:52*jwm224 joined #nim
03:54:53Yardanicocan you post full proc definition
03:54:54*thomasross quit (Ping timeout: 240 seconds)
03:54:55zedeusproc foo(bar: TypeA | TypeB)
03:55:05*jds_dizzy_ quit (Ping timeout: 246 seconds)
03:55:05FromDiscord<codic> i did `var a:clong = 10295019204912
03:55:05FromDiscord<codic> `
03:55:16FromDiscord<codic> and got `stdin(12, 15) Error: type mismatch: got <int64> but expected 'clong = int'
03:55:16FromDiscord<codic> `
03:55:19FromGitter<bung87> @zedeus it's supported?
03:55:23FromDiscord<codic> clonglong maybe
03:55:24zedeusyes
03:55:54FromGitter<bung87> I havnt try before, let me try this
03:56:06Yardanico@codic var a = clong(10295019204912)
03:56:21zedeushttps://nim-lang.github.io/Nim/manual.html#generics-type-classes
03:56:50FromDiscord<codic> I got it with clonglong
03:56:51FromDiscord<codic> but new problem
03:56:53FromDiscord<codic> 41241241241241241241243
03:56:56FromDiscord<codic> doesnt fit in clonglong
03:56:57FromDiscord<codic> XD
03:57:03Yardanicowhat's your use case?
03:57:07FromDiscord<codic> I wouldnt suppose y'all have a clonglong?
03:57:13FromDiscord<codic> Make that three longs
03:57:18Yardanicoyou can use https://github.com/status-im/nim-stint
03:57:21FromDiscord<codic> my use case is `41241241241241241241243 ^ 10295019204912`
03:57:27Yardanicoehm
03:57:36FromDiscord<Rika> thats humongous
03:57:43FromDiscord<Rika> ^ == **? or `or?
03:57:47FromDiscord<Rika> *`or`
03:57:47Yardanicothat's +inf
03:57:51Yardanicono need to compute
03:57:53Yardanicoit's just +inf
03:58:06Yardanicounless you spend days and use bignums :)
03:58:28FromDiscord<codic> :|
03:58:48FromGitter<bung87> @ zedeus ok I get it , it should be write in generic part
03:59:12FromDiscord<codic> according to someone c can have `long long long long long long` (as many longs as ya want)
03:59:18FromDiscord<codic> any equivalent in nim?
03:59:31Yardanico@codic no
03:59:32Yardanicothat won't work
04:00:06Yardanicoand you don't know how many longs you'll need
04:00:08Yardanicoand you'll need A LOT
04:00:31FromDiscord<codic> won't even work in c?
04:00:55FromDiscord<codic> dammmn
04:00:56Yardanicoyou understand that expression needs ~1.3396525e+14 digits?
04:01:01Yardanicothat's 1.3 * 10 ^ 14
04:01:05FromDiscord<codic> Yeah
04:01:11FromDiscord<codic> I was just trying to push the limits of nim
04:01:14Yardanicothat is MANY longs
04:01:17Yardanicolike realllllllllyyyyyyyyyyyyyyyyyyyyy a lot
04:01:19FromDiscord<codic> See how long it takes to calculate
04:01:20Yardanicoyou can't do it in C either
04:01:27Yardanicounless you do you own types
04:01:37Yardanicotry to use gmp
04:02:01FromDiscord<codic> A friend has challenged himself to try it in c lol
04:02:01FromDiscord<codic> isn't that the gnu something?
04:02:13Yardanicoit is, so?
04:02:16FromDiscord<codic> Gnu multi precision
04:02:17Yardanicohttps://gmplib.org/
04:02:19FromDiscord<codic> Yeah, was just curious
04:02:33Yardanico"arbitrary precision arithmetic" that's what you need
04:02:36Yardanicogmp is the fastest out there really
04:02:41FromDiscord<Rika> you're probably gonna need a certain amount of powerr, perhaps a low end super computer to calc that
04:02:41Yardanicoit's hand optimized
04:02:48Yardanicoyeah
04:02:50nisstyreI'm getting this error with Nim 1.0.99 https://gist.github.com/weskerfoot/bd452f04e88ac8be4e3fcc536d664443
04:02:52Yardanicoyou also might want to parallelize
04:02:58Yardaniconisstyre: what is that nim version?
04:03:03Yardanicoyou should either use 1.0.6 or 1.2.0
04:03:07Yardanico1.2.0 is much preferred
04:03:10Yardanico1.0.99 is not stable
04:03:20nisstyreYardanico: ah, ok, maybe that's why
04:03:27FromDiscord<codic>
04:03:27FromDiscord<codic> https://cdn.discordapp.com/attachments/371759389889003532/708167154150932621/unknown.png
04:03:33FromDiscord<codic> can irc view images?
04:03:37Yardanicoyes
04:03:42Yardanicobut he's wrong anyway
04:03:52Yardanicoit won't "just work", there's no c compiler which supports that
04:04:01FromDiscord<codic> ¯\_(ツ)_/¯
04:04:09nisstyreYardanico: yep I had nim-git installed for some reason
04:04:11nisstyrecan't remember why
04:04:44Yardanicoand unsigned long long int var is MUCH smaller than what you need
04:05:29FromDiscord<Rika> any calculator would output `infinity` for that number
04:05:34FromDiscord<Rika> any regular calculator, rather
04:05:50FromDiscord<Rika> where did you source that number anyway
04:06:02*supakeen quit (Quit: WeeChat 1.9.1)
04:06:28FromDiscord<codic> smashing my keyboard
04:06:30FromDiscord<codic> :p
04:06:42*supakeen joined #nim
04:06:45nisstyreYardanico: still getting it with nim 1.2.0 installed though
04:06:47FromDiscord<codic> anyways if ruby counts as a calulator `=> Infinity`
04:06:53Yardaniconisstyre: have a code to reproduce?
04:06:54FromDiscord<codic> if python counts as a calculator, it just hangs
04:07:03Yardanico@codic because python has bignum support builtin
04:07:05Yardanicoit doesn't hang
04:07:08Yardanicoit actually starts to calculate that
04:07:11nisstyreYardanico: yes, I do, one second
04:07:30FromDiscord<codic> oh
04:07:34FromDiscord<codic> well
04:07:50FromDiscord<codic> I ctrl c out of it anyways
04:07:53FromDiscord<codic> ol
04:07:55FromDiscord<codic> *lol
04:08:15nisstyreYardanico: sorry I don't have a smaller test case, https://github.com/weskerfoot/Nimwin but it was this commit that's causing issues https://github.com/weskerfoot/Nimwin/commit/82fd585396327c1c3f4afa512f13a8b9e0e2d555
04:08:58nisstyreI can try to come up with a smaller test case later I suppose
04:10:19Yardanicoyeah I can reproduce it
04:10:58Yardanicoit's from /home/dian/Projects/data/Nimwin/src/nimwin.nim line 95-97 just as expected
04:11:20Yardanicoas a fix you can do if anyIt(toSeq(getProperties(display, win.win)), it in ignored): intead
04:11:23Yardanicoinstead*
04:11:25YardanicoI'll try to reproduce it
04:11:32Yardanicowith a shorter example
04:11:33nisstyreYardanico: I'll try that, thanks
04:11:36PrestigeWoo I just made a lot of progress on my wm
04:11:46FromGitter<bung87> `Node | null` == `Node | jsNull` ? or should I using nil?
04:12:15FromGitter<bung87> when transpile ts 2 nim
04:12:28Yardanicoyou didn't understand something though
04:12:33Yardaniconim's generics are compile-time
04:12:35Yardaniconot runtime
04:12:44Yardanicowhat does "Node | null" mean in ts?
04:13:01FromGitter<bung87> variable a could be Node or null
04:13:11zedeusnull is not a type
04:13:37Yardanico@bung87 in Nim you'll be able to just pass Node as nil if it's a ref object
04:13:38Yardanicoor a pointer
04:14:53FromGitter<bung87> ok then I declare it as ref Node seems fit the use case
04:15:08Yardanicoyou can have it as "Node = ref object"
04:17:32FromGitter<bung87> that's make more complicated, I should manage whole project Node param, choose between Node or ref Node
04:17:39Yardanicono?
04:17:44YardanicoJust use ref object everywhere then I guess
04:18:14Yardanicoanyway TS doesn't have user-definable value types right
04:18:24Yardanicoso you'll probably have to use "Node = ref object" everywhere
04:20:49FromGitter<bung87> you mean declare it as variable? not `type` ?
04:20:55Yardanicono?
04:20:59Yardanico"type Node = ref object"
04:21:47FromGitter<bung87> ok let me check the Node used in ts
04:21:59YardanicoI doubt ts has real value types (which can be defined by users)
04:22:02Yardanicoso it's always references
04:23:20FromGitter<bung87> https://github.com/google/incremental-dom/blob/master/src/core.ts
04:23:49Yardanico"let currentNode: Node | null = null;" for nim you'll have your "Node" type as " ref object"
04:23:54FromGitter<bung87> it's also everywhere in this module, `type Node = ref object` seems fine
04:24:03Yardanicoand initially declare it as var currentNode: Node = nil
04:24:30FromDiscord<Rika> @codic just for fun, i started pypy up and made it calculate the number you gave
04:24:43YardanicoI doubt pypy will have much benefit in this, but ok
04:24:44FromDiscord<Rika> it's probably going to take literal days or weeks
04:24:46Yardanicotry with julia
04:24:54FromDiscord<Rika> ill spin that up too then
04:25:03FromGitter<bung87> ok that's simple now, no generic required , I can using simple tranpile logic.
04:25:29FromDiscord<Rika> damn it openblas and blas are conflicting, is openblas a drop in replacement?
04:25:33Yardanicoah nvm
04:25:37Yardanicobig"41241241241241241241243" ^ big"10295019204912"
04:25:43Yardanicogmp: overflow in mpz type
04:25:49Yardanicoso even gmp gives up
04:26:03FromDiscord<Rika> dude, where the hell did this number even come from
04:26:17Yardanicolemme calculate how many bits you need to store it
04:26:50FromDiscord<KingDarBoja> Did anyone said Julia? 😄
04:27:38Yardanicoso if my calculation are right
04:27:47Yardanicoyou'll need ~3.592342911249377062174420113931943895280048793985194139447965374298833127476692e+39133899436317 bits to store that number
04:27:54Yardanico3.6 * 10 ^ 39133899436317 basically
04:28:02FromDiscord<Rika> I CANT EVEN SIGTERM PYPY
04:28:53FromDiscord<Rika> accidentally sigkill'ed yakuake... LMAO
04:34:59*nsf joined #nim
04:37:12*Senketsu joined #nim
04:49:47Yardaniconisstyre: I reproduced it to minimal example, I'll also run git bisect (because it seems to work on 0.19.6 and broke in 0.20.0) and submit the issue, thanks
04:50:14leorizeI got some basic code coverage stuff working for Nim
04:50:20nisstyreYardanico: sounds good, thanks for the help
04:55:07*ertp07 quit (Ping timeout: 244 seconds)
04:55:25*ertp07 joined #nim
04:56:44Yardaniconisstyre: I didn't bisect it yet but https://github.com/nim-lang/Nim/issues/14273
04:56:47disbotC compiler error with sequtils.any with an iterator ; snippet at 12https://play.nim-lang.org/#ix=2leg
05:03:17*terps joined #nim
05:10:12*ptdel quit (Remote host closed the connection)
05:22:25*exelotl quit (Ping timeout: 264 seconds)
05:38:14*letto quit (Quit: Konversation terminated!)
05:40:44*terps quit (Quit: WeeChat 2.6)
05:41:27*silvernode joined #nim
05:42:23*narimiran joined #nim
05:50:24*letto joined #nim
05:51:58*silvernode quit (Ping timeout: 246 seconds)
05:54:58voltistWould people be interested in a markdown based static website generator written in Nim? I'm thinking of open sourcing mine, but idk if it's worth putting much effort into documentation/presentation
05:56:06FromDiscord<Rika> you can open source it w/o all of that
05:56:56voltistTrue
06:01:40PrestigeThat sounds pretty cool. How does it work with css etc?
06:05:33voltistBasically there is an html template (I'll add support for multiple later), and it substitutes in values from a config file and the target markdown file. Any css in or linked to by the template will apply to the content
06:06:58voltistThere is html generation with nim-markdown
06:08:24voltist!repo nim-markdown
06:08:25disbothttps://github.com/soasme/nim-markdown -- 9nim-markdown: 11A Beautiful Markdown Parser in the Nim World. 15 48⭐ 4🍴 7& 3 more...
06:12:32Yardanicooh nice I finally got same binary size as zedeu_ did
06:12:41Yardanico5968 hello world binary with _no_ code changes in nim
06:12:45Yardanicojust compiler switch magic
06:13:03Yardanicoand it's all 100% static :P
06:19:51ZevvIve been lowe
06:19:53Zevvr
06:20:10Zevvbut it's pretty sweet, right?!
06:20:19Yardanicozedeus: ye :P
06:20:23YardanicoZevv: ye :P
06:20:29Zevvwhat, static even?
06:20:30Yardanicoalthough I didn't do any source changes
06:20:34YardanicoZevv: yes
06:20:35Yardanicolol
06:20:38Yardanicomusl statically linked
06:20:42Zevvnice
06:20:54Yardanicohttps://file.io/JXrFqxwO binary
06:21:11Yardanicoalso it won't really be possible to figure out it was written in Nim :P
06:21:19Yardanicoand you can save around ~150 bytes by explicitly having your own main proc
06:21:23Yardanicoexportc I mean
06:21:31Yardanicobut I did what I could without modifying the source
06:22:44YardanicoZevv: binary which uses npeg with your first example (and dynamic input from stdin.readLine) is 50kb
06:23:00Yardanicowith this config
06:24:36Zevvmwoah not even *that* bad
06:24:54*solitudesf joined #nim
06:24:58Zevvthat pulls in a lot of stuff already
06:25:38Yardanicousing --noMain and exportc for main proc saves 1.5kb lol
06:25:47Yardanicoit's 48504 bytes
06:26:05*waleee-cl quit (Quit: Connection closed for inactivity)
06:27:07Zevvwhat are your flags?
06:27:33YardanicoZevv: https://ix.io/2lff
06:27:40*dadada joined #nim
06:27:42Yardanicotest.sh just calls "zig cc $@" because it was removed from compiler
06:27:52Yardanicoand nim rn doesn't support spaces in compiler exe paths
06:28:01Yardanicoah wiat
06:28:04*dadada is now known as Guest45865
06:28:04Yardanicoit was --gc:arc sorry
06:28:06Yardaniconot --gc:none
06:28:28Yardanicowith that I get 48504 bytes
06:28:34Zevvnone is sooo 2019
06:28:48Yardanicofor this https://gist.github.com/Yardanico/d292d3565f3e27a5580f52f1584ffc85
06:29:06Yardanicoupx does 2x compression on the binary as well but that's cheating :P
06:29:12Zevvyaah
06:29:36Yardanicolemme see if I can make the compiler not care about errors at all
06:30:04skrylar[m]speaking of gc:none i could have sworn memory regions used to be a thing
06:30:12Yardanico--gc:regions ?
06:30:14Zevvthats sooo 2018
06:30:19Yardanico--gc:v2 gang
06:30:22YardanicoXD
06:30:55skrylar[m]eh it was in the docs where you had pointer[foo] or something
06:31:29Zevvaraq has this funny new dogma: arc is for libs and orc is for apps. but how should that work anyway, i can't compile part of the code with arc and other parts with orc, right?
06:32:06Yardanicogot down to 48104 with a custom stack trace proc override
06:32:07skrylar[m]i guess its for libs that are to be used outside the nim ecosystem, like a VST
06:32:21YardanicoZevv: arc cares a lot about dll interop
06:32:24Yardanicoso that you can mix dlls and stuff
06:32:27Yardanicoand it *just works* :P
06:33:11skrylar[m]i am so confused as to what we're supposed to be doing these days. one day it was Nim: Oxidized Edition (newruntime), then its arc, now orks are involved.
06:33:25skrylar[m]now elfs are being compiled with orks and my damn system has turned in to an unruly kingdom
06:34:31Zevvah right of cours, arc would finnaly allow portble lib development with nim, never thought of that
06:34:36Yardanicowe need goblins
06:34:41Zevvso I should make a C api on npeg!
06:34:45YardanicoZevv: also don't forget it's shared heap ^_^
06:35:24YardanicoI mean I can create a C API for my smol mathexpr lib easily since it's not a lot to do
06:35:32Yardanicoit's much tinier than tinyexpr
06:35:35Yardanicobut much easier to read imo
06:36:36Yardanicotime to dig nim stdlib and compiler for useful compiler defines
06:37:24skrylar[m]people making all these big fancy libs and i'm just here dealing with hashes and low level game engines :f
06:37:45Yardanico--gc:generational
06:37:54Yardanicoskrylar[m]: your stuff is much more impressive than mine :)
06:38:18FromDiscord<Rika> ._. rest in peace me
06:39:06skrylar[m]one thing that seemed weird with Mu is that i guess its stack based, but it doesn't really say much about data other than "it goes in variables and stuff." its like its just meant to be IR for a jit or somesth
06:39:25skrylar[m]but unlike wasm it does let you deal with traced or untraced pointers, so
06:42:47Yardaniconim be like
06:42:50Yardanicoelif doslikeFileSystem or defined(atari): "$1.dll"
06:42:54Yardanicoelif defined(MorphOS): "$1.prc"
06:42:59Yardanicoelif defined(PalmOS): "$1.prc" # platform has lib$1.so
06:43:22skrylar[m]aren't those all dead platforms
06:44:23FromDiscord<Rika> why not support them?
06:44:39*PMunch joined #nim
06:45:01skrylar[m][[because i'm not paid to]]
06:45:07*ertp07 quit (Ping timeout: 260 seconds)
06:45:25Yardanicowe have a define androidNDK in io.nim btw
06:45:36Yardanicoto redirect echo to logcat on android
06:46:01skrylar[m]Hm. someone's running android stuff?
06:46:07Yardanicoyes, some people aree?
06:46:18Yardanicokwin
06:46:18Yardanicowhat
06:46:20Yardanicokwin define
06:46:21skrylar[m]hashlink and mu look awfully similar tho
06:47:01PMunchskrylar[m], I have run Nim on Android before. But that was many moons ago
06:47:12YardanicoPMunch: nim is in termux packages now
06:47:14Yardanicoofficially
06:47:18Yardanicolmao it's actually for kwin's JS API
06:47:19PMunchOh really?
06:47:21PMunchCool!
06:47:29Yardanicojssys.nim line 354
06:47:35Yardanicoa version of rawEcho for kwin :D
06:47:42PMunchI kinda want to write my own launcher though, now that ZLauncher seems to have been completely dropped
06:48:03Yardanico@rika btw
06:48:26Yardanicohttps://github.com/nim-lang/Nim/blob/devel/lib/system/platforms.nim#L46
06:48:30Yardanicohttps://github.com/nim-lang/Nim/blob/devel/lib/system/platforms.nim#L74
06:50:37YardanicoZevv: with -d:useMalloc the binary is 44584 bytes
06:50:48Yardanicobut -d:useMalloc is worse for performance (but I guess if you really care about size you can use it)
06:51:06Yardanicoand with that I can remove -d:posix
06:51:10FromDiscord<Rika> DAMN thats a lot
06:51:54Yardanicothat file was mostly untouched for 6 years tho
06:52:00Yardanicohttps://github.com/nim-lang/Nim/commit/c7664e7025cb63adb29f44bda8a8d41d4f65a967
06:53:56*idf joined #nim
07:05:51skrylar[m]Yardanico: is all of this just curiosity or are you trying to hit a size limit
07:09:59*tane joined #nim
07:11:54FromDiscord<Yardanico> It's curiosity since https://hookrace.net/blog/nim-binary-size/ is already there
07:12:49FromDiscord<Yardanico> But I have 6kb *with* memory handing
07:13:42FromDiscord<Rika> `(1 byte smaller than in Rust)` LMAOOO
07:13:51FromDiscord<Rika> damn! one byte!
07:15:22FromDiscord<Yardanico> On the scale of 150 it really matters
07:15:30FromDiscord<Yardanico> And you have to understand that ELF itself has overhead
07:17:05PMunchHmm, I'm looking at the hash table implementation, specifically the OrderedTable. (by the way, have anyone benchmarked the Table implementation?) I realise that if they had `prev` as well as `next` you would be able to reorder things
07:17:20FromDiscord<Yardanico> ELF header is 64 bytes on x64
07:17:38*konvertex joined #nim
07:18:09FromDiscord<Rika> i mean, this is almost to the level of pixel peeping wrt. video encoding
07:18:18FromDiscord<Rika> this is awfully intensely optimized
07:22:36*Jjp137 quit (Ping timeout: 272 seconds)
07:23:37*exelotl joined #nim
07:25:23*terps joined #nim
07:25:29*ertp07 joined #nim
07:33:08*konvertex quit (Ping timeout: 256 seconds)
07:34:14*terps quit (Quit: WeeChat 2.6)
07:34:57*terps joined #nim
07:35:27*terps quit (Client Quit)
07:43:27FromGitter<sealmove> hey, I think I lost my nimble token
07:43:35FromGitter<sealmove> what happens if I use a new one?
07:49:43*Guest45865 is now known as dadada
07:52:57PMunchNimble token?
07:53:32FromDiscord<Yardanico> That's a GitHub token and it's only really used for publishing packages with nimble publish
07:54:59*Vladar joined #nim
07:57:12FromGitter<sealmove> yes, what happens if I change it? nothing right?
08:13:33FromDiscord<Yardanico> Nothing of course
08:16:37*avatarfighter quit (Ping timeout: 244 seconds)
08:17:33*Jjp137 joined #nim
08:21:06dadadawhat do I import to use when linux?
08:21:30FromDiscord<Yardanico> Nothing
08:21:38dadadaundeclared identifier: 'linux'
08:21:40FromDiscord<Yardanico> when defined(linux):
08:21:57dadadaah, copied some wrong code from somewhere then :-)
08:27:12*terps joined #nim
08:27:16*terps quit (Client Quit)
08:27:26FromDiscord<Yardanico> By the way are there any guidelines of what might be allowed to be added to Fusion and what is not?
08:29:50*NimBot joined #nim
09:16:03FromDiscord<mratsim> @codic for 41241241241241241241243 ^ 10295019204912, it's not modular?
09:25:11dadadais something missing from Nim's stdlib to port this? https://play.nim-lang.org/#ix=2lfB
09:25:30*ertp07 quit (Read error: Connection reset by peer)
09:26:32*exelotl quit (Ping timeout: 256 seconds)
09:27:40*ertp07 joined #nim
09:27:47FromDiscord<Rika> not that i know of
09:27:50PMunch@Araq, @cooldome, am I missing something obvious here? https://github.com/nim-lang/Nim/pull/14258 Or should this check me moved to later in the chain so that sfImportc is available? Sorry, not very well versed in the compiler internals..
09:27:51disbotAllow let to not have value when using importc
09:30:36*Trustable joined #nim
09:35:01*ertp07 quit (Ping timeout: 264 seconds)
09:36:20skrylar[m]@Yardanico nimble publish: where it inevitably butchers the push and dom makes you fix it manually
09:37:00*ertp07 joined #nim
09:37:13skrylar[m]i wonder if the matrix people missed some opportunities by marketing to dead irc cultures instead of marketing to corpodoods who were looking to replace their chat engines :ponder:
09:40:48PMunchWhat do you mean by "dead IRC cultures"?
09:41:33*Senketsu quit (Quit: WeeChat 2.8)
09:41:35skrylar[m]ircs not a lively place to market an irc clone to
09:41:58PMunchHaha, true
09:42:25skrylar[m]outside of some foss hardliners everyones ditched to discord tbh
09:42:56skrylar[m]corporate users still want stuff they can host and they prolly could have marketed to those, but i just pulled some threads of people saying yeah we tried matrix but synapse sucks
09:43:20skrylar[m]oh well.
09:43:25PMunchSynapse?
09:44:15skrylar[m]the reference server for matrix is a slog of a python app. i think rocket is that too. mattermost is just a go binary you plop and run. zulip you have to dedicate a server to because its a stack (message queue, web server, ..., though everyone says its worth it)
09:45:49skrylar[m]altho with everyone complaining about the web apps being bad... wonder how to get away with writing android apps without java xD
09:48:53skrylar[m]it would admittedly be interesting to be able to use nim to write phone apps o.O although i have no idea how clean adding backends is
09:49:50PMunchI did try some simple game stuff in Android
09:49:57PMunchWorked fairly well
09:50:04skrylar[m]games are mostly going to run on NDK
09:50:12PMunchBut that was without using any of the Java libraries
09:50:29PMunchYeah, it was basically a Java shell to just set up the app and then pass everything over to the NDK
09:50:31skrylar[m]android doesn't like if you try to use ndk to drive the native apis... which are sadly necessary for non-games
09:50:41skrylar[m]haxe can transpile to java i think
09:52:11PMunchReally?
09:59:05skrylar[m]well 2/3rds of xxhash stuff ported, kindof
09:59:35skrylar[m]probably won't do any more after this. blake, spooky and xx are more than enough
10:01:28*konvertex joined #nim
10:04:30FromDiscord<clyybber> https://github.com/yglukhov/jnim
10:05:11Yardanicoso guys from IRC does https://media.discordapp.net/attachments/456504845642235914/708257345205174282/2020-05-08-12-57-50_grim.png open for you without discord authorization?
10:05:14skrylar[m]eh no, thats JNI
10:05:45skrylar[m]Yardanico: discord images aren't private afaik
10:05:52Yardanicoskrylar[m]: well pls click the url :P
10:06:02skrylar[m]i did but i also have cookies
10:06:05Yardanicouh
10:06:15skrylar[m]works in private windows too, so.
10:06:21Yardanicowell I guess it should work ow that I'm using proxy_url instead of just url
10:11:33*theelous3 joined #nim
10:11:52*Trustable quit (Remote host closed the connection)
10:19:02*dddddd joined #nim
10:25:14*dadada quit (Ping timeout: 260 seconds)
10:25:42*abm joined #nim
10:31:39dom96Haxe "transpiles" to everything lol
10:32:57FromDiscord<Recruit_main707> https://tenor.com/view/pewdiepie-can-you-do-this-but-can-you-do-this-gif-14948439
10:33:01FromDiscord<Recruit_main707> `macro`
10:34:17FromGitter<alehander92> it seems haxe has macros
10:34:43FromGitter<alehander92> compile time execution/macros is really coming to mainstream these days
10:35:59FromGitter<alehander92> even c# added `Source Generators`(even if limited)
10:42:42*fredrikhr joined #nim
10:48:57*exelotl joined #nim
10:56:28*couven92 joined #nim
10:56:40*fredrikhr quit (Ping timeout: 272 seconds)
10:56:48*couven92 is now known as fredrikhr
10:58:20*ertp07 quit (Ping timeout: 256 seconds)
10:58:34FromDiscord<RaycatWhoDat> Correct. Haxe transpiles to both Java sourcecode and JVM bytecode. It also has macros.
11:00:07*ertp07 joined #nim
11:00:13FromDiscord<RaycatWhoDat> Also, hello again. Recently hopped the fence from Haxe to Nim.
11:00:19FromDiscord<Recruit_main707> nice
11:00:47FromDiscord<RaycatWhoDat> Eh. It causes more grief than you'd expect.
11:00:50*krux02 joined #nim
11:01:16FromDiscord<Recruit_main707> i meant the fact of you coming to nim :P
11:01:30FromDiscord<RaycatWhoDat> Ah. Right, right.
11:03:23FromDiscord<Rika> so what do you miss from haxe?
11:04:04Yardanicomost people coming from languages with (at least some) duck typing miss it in typed languages at first :P
11:04:32YardanicoI mean https://haxe.org/manual/types-dynamic.html ,although I don't really know how much it's used in real haxe code
11:04:53FromDiscord<RaycatWhoDat> Nah, people avoid Dynamic like the plague
11:04:57FromDiscord<Recruit_main707> whats duck typing?
11:04:58Yardanicothen it's ok
11:05:08Yardanico@Recruit_main707 https://en.wikipedia.org/wiki/Duck_typing
11:05:34supakeen@Recruit_main707: Basically, if you get an object you just try to use it in a certain way and see if it works.
11:05:39Yardanicoye :D
11:05:39supakeenIf it fails you get an error anyways.
11:05:42FromDiscord<RaycatWhoDat> @Rika The Lua target is a big one but I can manage. After that, metadata annotations and the cross-platform guarantee
11:05:47Yardanicoyou don't know if it will work tho xd
11:06:02supakeenIt's part of the look before you leap vs easier to ask for forgiveness idiom.
11:06:15Yardanico@RaycatWhoDat wdym by metadata annotations?
11:06:20FromDiscord<Rika> was gonna ask
11:06:25Yardanicoand cross-platform guarantee -> nim is pretty cross-platform
11:06:35Yardanicomost of the stdlib works on all major OSes and even on less known ones
11:06:40Yardanicolike there are PRs for Haiku and Genode
11:06:40FromDiscord<Rika> you know what's interesting to me? structural typing
11:06:53FromDiscord<RaycatWhoDat> Right
11:07:04FromDiscord<Rika> its like some half compromise between duck and static or something
11:07:05FromDiscord<RaycatWhoDat> What's the pattern matching like here?
11:07:19Yardanicowe have case statements, we have macros so you can do stuff like https://github.com/alehander92/gara
11:07:21FromDiscord<Rika> pattern matching? dont think we have that at all w/o a package
11:07:28Yardanicoand https://github.com/andreaferretti/patty
11:07:45Yardanicoidk if macros in haxe can do what nim macros can :D
11:08:07FromDiscord<RaycatWhoDat> The macros are full-on macros
11:08:13*ertp07 quit (Ping timeout: 260 seconds)
11:08:19FromDiscord<RaycatWhoDat> Probably comparable.
11:08:32Yardanicowell you know nim macros have a lot of interesting stuff in them as well :)
11:08:57Yardanicofor stuff like https://code.haxe.org/category/macros/add-git-commit-hash-in-build.html for example you don't need to use macros in nim at all
11:09:10Yardanicobecause nim has compile-time execution
11:09:42leorizegara should be updated to use case statement macros imo
11:09:51*ertp07 joined #nim
11:10:09Yardanicoalso lol
11:10:18Yardanicoyeah sorry but haxe macros aren't as powerful as nim ones ->
11:10:19Yardanico"While the former requires a known type in order to determine used functions, macros execute before typing on plain syntax."
11:10:41FromDiscord<Rika> nim has both typed and untyped
11:10:57Yardanicoyeah
11:11:07Yardanicomacros can be run after the compiler checked all types
11:11:15Yardanicosomething like that
11:11:33FromDiscord<RaycatWhoDat> Re: metadata annotations, in Haxe, you can do this:
11:11:34FromDiscord<RaycatWhoDat> ```haxe
11:11:34FromDiscord<RaycatWhoDat> package;
11:11:34FromDiscord<RaycatWhoDat>
11:11:34FromDiscord<RaycatWhoDat> @author('Me')
11:11:34FromDiscord<RaycatWhoDat> class A {
11:11:35FromDiscord<RaycatWhoDat> trace(haxe.Rtti.get('author')) // 'Me'
11:11:36FromDiscord<RaycatWhoDat> }
11:11:37FromDiscord<RaycatWhoDat> ```
11:11:41Yardanicoyou have pragmas in nim
11:11:43Yardanicowhich do the same thing
11:11:47PMunchPlease don't paste code into Discord..
11:11:52YardanicoPMunch: for now :P
11:11:54FromDiscord<Rika> rest in peace irc
11:11:59PMunchHaha, for now yeah
11:12:01FromGitter<alehander92> ok
11:12:03FromDiscord<RaycatWhoDat> Oh, right
11:12:04Yardanicopragmas can be used for types/fields/procs/variables/etc
11:12:06FromDiscord<Rika> what is Rtti?
11:12:07*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
11:12:09FromGitter<alehander92> my nim process fails without an error
11:12:12Yardanicoruntime type information basically
11:12:22FromDiscord<RaycatWhoDat> Runtime Type Information, I'd imagine
11:12:24FromDiscord<Rika> i mean i want to know the meaning of the abbr.
11:12:26FromDiscord<RaycatWhoDat> yeah
11:12:27FromDiscord<Rika> i see
11:12:37PMunchalehander92, sure it just didn't run to completion? :P
11:12:38Yardaniconim has that but with ARC it's mostly getting removed
11:12:41PMunchYardanico, when do you think the new bot is ready?
11:13:00YardanicoPMunch: I think right now it's almost ready, most features are there and it's already quite stable (and can restart easily on crash :P)
11:13:12Yardanicoat most around one week I guess, just need to run it for some time to see how stable it is
11:13:20leorizehave you fixed the pinging issue?
11:13:34Yardanicoleorize: of course
11:13:45Yardanicoah right I need to change contains to startsWith
11:13:47Yardanicothanks for reminding
11:14:01Yardanicoso "@human" doesn't match for "@somehuman"
11:14:23PMunchHaha
11:14:24Yardanicoalso you don't need to auth to view discord images rn I think
11:14:29Yardanicobecause I use proxy_url instead of just url
11:14:35FromGitter<alehander92> PMunch i mean
11:14:36FromGitter<alehander92> :P
11:14:36PMunchBut you want @Yard to match Yardanico?
11:14:38leorizeyea, I can view that image you sent
11:14:38FromGitter<alehander92> it returns status 1
11:14:42YardanicoPMunch: that's the problem
11:14:43FromGitter<alehander92> but it doesnt show any error
11:14:45YardanicoI don't know
11:14:47FromGitter<alehander92> which is confusing
11:14:49Yardanicoprobably no?
11:14:58leorizeYardanico: can't you just match the name until the `#`?
11:14:58FromGitter<alehander92> its like the mixed signals meme :)
11:15:03FromDiscord<clyybber> alehander92: I closed this arc issue, I think backtraces with line information are a bit complicated so definitely deserving of their own issue
11:15:08Yardanicoleorize: # ?
11:15:14PMunchalehander92, is it running with debug? Or in release?
11:15:29Yardanicohmm I think I can definitely get full username, just need to restructure some code
11:15:32leorizeYardanico: isn't discord names are like: Nick#some_id_thingy?
11:15:33FromGitter<alehander92> ok, sorry, then a new issue is needed ! even a line info for the last node affected is good
11:15:38FromGitter<alehander92> clyybber
11:15:44Yardanicoleorize: I don't send the discriminator anyway
11:15:50Yardanicoand it's not needed for mentions
11:15:50FromGitter<alehander92> PMunch danger :D
11:15:55FromDiscord<Rika> usernames are not unique in discord though
11:15:58Yardanicoyes
11:16:02FromGitter<alehander92> i am rebuilding a debug one
11:16:03Yardanicobut imagine typing a discriminator
11:16:06Yardanicomaybe I can make it optional
11:16:10FromDiscord<clyybber> alehander92: Yeah, I can only imagine that it gets a bit tricky when you have lets say the nodes after injectdestructors
11:16:17FromGitter<alehander92> but i still expect some kind of a system error
11:16:19PMunchHaha, there's your issue alehander :P
11:16:25FromGitter<alehander92> clyybber hm, why
11:16:36FromGitter<alehander92> well still shouldn't happen :P
11:16:45PMunchThere are some cases that just ends up quitting
11:16:51PMunchI don't know what, but I've seen it before
11:17:00leorizeYardanico: why do you need startsWith then?
11:17:10Yardanicoleorize: so "@human" doesn't match "@somehuman"
11:17:12*pbb joined #nim
11:17:17YardanicoI use "in" rn :D
11:17:18FromDiscord<clyybber> alehander92: Because we insert new nodes. And its potentially non-trivial to associate them with the code that caused a certain transformation
11:17:24leorizeYardanico: I mean why do you even need it?
11:17:24FromDiscord<clyybber> especially for passes like transf.nim
11:17:42leorizecouldn't you do direct match?
11:17:48Yardaniconot with discord api I believe
11:17:54*konvertex quit (Read error: Connection reset by peer)
11:18:12FromGitter<alehander92> clyybber hm, but how do you preserve debug info
11:18:13PMunchHow about highlight == name[0..highlight.high]
11:18:17leorizeYardanico: I'm still confused, what are you using to compare the nicks with?
11:18:30PMunchThat way you could use both with and without discriminators
11:18:33YardanicoI cache last 5 users who wrote a message on discord so I don't have to fetch full user list for the channel each time someone mentions someone
11:18:56Yardanicoand iterate over these ones and check if usernames match, if they do - send the id thingie to discord
11:19:05Yardanicodiscord needs ID of the user
11:19:08Yardaniconot username
11:19:23leorizethen you can do an equal match instead of startsWith?
11:19:38Yardanicoleorize: well yeah I think I can, just need to make it handle spaces somehow
11:19:39FromDiscord<clyybber> alehander92: Yeah, we should use the same mechanism, my point was more that it doesn't necessarily help the user
11:19:44FromDiscord<RaycatWhoDat> @Rika To finish answering your question, the documentation fragmentation, the necessity of classes, and the way JSX is handled steered me away.
11:19:44Yardanicodiscord usernames can contain space
11:19:46Yardanicoor any utf8 characters
11:19:49Yardanico(almost)
11:19:53FromDiscord<clyybber> Because it doesn't tell you *how* to work around it
11:20:02leorizeYardanico: use a custom matcher :P
11:20:15Yardanicoso I don't think mentioning with spaces will be good for IRC
11:20:19PMunchAha, spaces as well..
11:21:10leorizestores the position of `@` from the irc message, then just scan from there for each of the nicks?
11:21:36FromGitter<alehander92> PMunch i found it
11:21:45FromGitter<alehander92> its a vm assert but it seems
11:21:49PMunchAah
11:21:50FromGitter<alehander92> instantiationInfo is empty
11:21:54PMunchHuh
11:21:59Yardanicoleorize: the issue is that we have 879 people in nim discord
11:22:07FromGitter<alehander92> and thats why i see no error maybe
11:22:07PMunchSo VM asserts are also affected by danger?
11:22:11Yardanicoand what if someone wants to ping someone who didn't write a message in last few minutes?
11:22:17FromGitter<alehander92> no i still get the assert indebug
11:22:30FromGitter<alehander92> but it only shows a stacktrace the message itself might be empty?
11:22:32PMunchYardanico, build a Trie?
11:22:32Yardanicowell I think I might've found a way to solve it
11:22:39*konvertex joined #nim
11:22:43FromGitter<alehander92> oh wait this doesnt make sense
11:22:54FromDiscord<Rika> @RaycatWhoDat i dont think the docs are much better here, but the code sure is easier to read (for me, at least)
11:23:08Yardanicolet's see how discord.py does it
11:23:17FromGitter<alehander92> clyybber but the debug info
11:23:19Yardanicothey have a function named get_member_named
11:23:38FromGitter<alehander92> should usually makes sense anyway, otherwise this means that the generated code can't be debugged as well
11:23:57*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
11:24:04FromDiscord<clyybber> alehander92: Sure, I just don't see the value for users generally
11:24:16FromDiscord<clyybber> For compiler dev it's certainly handy
11:24:23FromDiscord<clyybber> Or for minimizing testcases
11:24:42*pbb joined #nim
11:25:29FromGitter<alehander92> it's huge value
11:25:37FromGitter<alehander92> right now i am doing exactly this as a user
11:25:49FromGitter<alehander92> i just hit a vm assert and i have no idea to which node is it related to
11:25:55FromGitter<alehander92> to at least workaround it in my own code
11:26:05FromGitter<alehander92> and it happens with other ice-s as well
11:26:21FromDiscord<RaycatWhoDat> @Rika That's a fair stance.
11:26:22FromGitter<alehander92> yeah, i add debug statements to the compiler and rebuild, but this is very slow
11:27:43*couven92 joined #nim
11:28:09FromGitter<alehander92> i am sorry, i realize its a bit niche, but i can add it to the compiler if its accepted
11:28:19*couven92 quit (Client Quit)
11:28:38*couven92 joined #nim
11:29:10*fredrikhr quit (Disconnected by services)
11:29:15*couven92 is now known as fredrikhr
11:29:35*couven92 joined #nim
11:29:43FromDiscord<clyybber> no, I agree. It certainly has value
11:30:00planetis[m]hi , i was experimenting with archtypes and needed a way to implement a dynamic programming AnyMap type, but this won't compile https://play.nim-lang.org/#ix=2lgb Can it be fixed somehow?
11:30:57FromDiscord<clyybber> alehander92: I just feared the implementation a bit, but maybe its possible to implement it without changing all the node transformation parts in the compiler
11:31:09FromDiscord<clyybber> .s/changing/touching
11:31:44FromGitter<alehander92> clyybber if its useful for better debugging locations somehow, thats even better
11:32:06FromGitter<alehander92> can you give a short example of line which would require such a transf
11:33:11planetis[m]basically ArchPayload1, ArchPayload2 need to go but how can i access the members without them?
11:35:09FromDiscord<clyybber> alehander92: I thought you wanted to debug where the nodes came from themselves, not only the LOC info
11:35:24FromDiscord<clyybber> alehander92: I think we retain the debug/loc info across transformations
11:35:32FromDiscord<clyybber> So yeah, it probably won't be an issue
11:35:49FromDiscord<clyybber> are you gonna make a PR?
11:35:51FromGitter<alehander92> alehander92: ah ok, otherwise yeah where they come from would be also useful
11:36:00FromGitter<alehander92> i misunderstood, sorry
11:36:20FromDiscord<clyybber> it was me who misunderstood :D
11:36:27FromGitter<alehander92> in my case i just saw its in strformat, but still wasnt enough
11:37:14FromGitter<alehander92> so , nodes do carry some kind of links to their instantiation contexts, right
11:37:24FromGitter<alehander92> (or is that the comesFrom thing i saw)
11:37:56FromGitter<alehander92> otherwise i just changed the assert to a warning echo
11:38:02FromGitter<alehander92> and my code seems to just work, strange
11:38:26FromDiscord<clyybber> alehander92: not sure which comesFrom you are referring to as there are many :p
11:38:35FromGitter<alehander92> ok
11:39:07FromGitter<sheerluck> planetis[m] https://github.com/nim-lang/Nim/issues/9636
11:39:11disbotillegal usages of UncheckedArray are not caught. ; snippet at 12https://play.nim-lang.org/#ix=2lgf
11:39:38FromDiscord<clyybber> there is a field in the VM thats called comesFrom, and its attached to the VM stackframe
11:40:00FromGitter<alehander92> ok, now i get a different one which is about yield not lowered
11:40:05FromGitter<alehander92> iirc there were many cases
11:40:13FromGitter<alehander92> or at least 1 which could be changed there
11:40:35planetis[m]sheerluck: yes I need to get the pointers to the start of each array by hand
11:40:45planetis[m]i'm trying to write a template
11:41:17planetis[m]but still unsure how that can be generalised for other types
11:41:37*couven92 quit (Ping timeout: 246 seconds)
11:42:39*dadada joined #nim
11:43:01*dadada is now known as Guest94017
11:45:21FromGitter<sheerluck> I don't think you should use 2 or more UncheckedArray in one object. That inevitably leads to " flexible array member not at end of struct"
11:46:38PMunchCan you even do that?
11:46:43PMunchI thought they had to be at the end
11:49:48*couven92 joined #nim
11:49:53planetis[m]no you can't but i'm doing is pointer arithmetic by hand
11:52:59planetis[m]this seems to work: https://play.nim-lang.org/#ix=2lgi
11:54:02planetis[m]but its entirely possible i'm still doing it wrong...
12:00:56*liblq-dev joined #nim
12:01:58*solitudesf- joined #nim
12:02:17*fredrikhr quit (Quit: Disconnecting)
12:02:32*couven92 is now known as fredrikhr
12:04:43*solitudesf quit (Ping timeout: 246 seconds)
12:06:02*supakeen quit (Quit: WeeChat 1.9.1)
12:06:45*supakeen joined #nim
12:07:04liblq-devanyone familiar enough with generics and concepts that could help explain a weird issue?
12:07:24liblq-devI asked yesterday but noone responded, so here I go again
12:07:31liblq-devI have this concept defined https://github.com/liquid600pgm/aglet/blob/master/src/aglet/target.nim#L12
12:07:48liblq-devand appropriate implementations of the concept *in other modules*
12:08:09liblq-devwhen compiling, however, I get an error on this line https://github.com/liquid600pgm/aglet/blob/master/src/aglet/target.nim#L33
12:08:14liblq-devstating that the proc is undeclared
12:08:45liblq-devthis is the entire error http://ix.io/2lgp
12:09:49liblq-devthis is my call to that generic proc: https://github.com/liquid600pgm/aglet/blob/master/tests/ttriangle.nim#L50
12:10:57Yardanicoliblq-dev: did you try https://nim-lang.org/docs/manual_experimental.html#concepts-concept-diagnostics ?
12:11:53liblq-devYardanico: yes, but it doesn't really help with anything…
12:12:01liblq-devyou can see {.explain.} in the concept declaration
12:12:10Yardanicoand what about the callsite?
12:13:45liblq-devdoesn't yield anything useful either http://ix.io/2lgr
12:13:49PMunchWhy does your Drawable concept have a T generic?
12:14:02liblq-devthat's what I saw in the manual
12:14:12Yardanico?
12:14:18Yardanicoyou need that only if you check the type
12:14:20PMunchWell yes, but it was using the T in the concept definition
12:14:32liblq-devremoving the generic doesn't help anything
12:14:36PMunchYou only need them if you want to make a generic concept
12:14:39FromGitter<alehander92> i think you dont need it usually
12:14:43FromGitter<alehander92> i mean yeah
12:14:43PMunchDidn't think it would..
12:14:45PMunch:P
12:14:49FromGitter<alehander92> but often you can do concept a, type T
12:14:53FromGitter<alehander92> and do stuff with T
12:15:02FromGitter<alehander92> but now .. i am not sure where the difference is
12:15:06FromGitter<alehander92> as concepts are generic always
12:16:04liblq-devmaking `source` into a type yields another different error http://ix.io/2lgs
12:16:22liblq-devI changed the decl to `Drawable* = concept type S`
12:16:27liblq-devbut it's not really what I want
12:16:44FromGitter<alehander92> but what do you want
12:16:47PMunchAnd `draw` doesn't return anything?
12:16:53liblq-devnope, it's `void`
12:17:02PMunchvoid?
12:17:08liblq-devdoesn't return anything.
12:17:20PMunchOkay, so it doesn't actually have something called void in Nim .P
12:17:37*dv^_^ quit (Ping timeout: 256 seconds)
12:17:39FromGitter<alehander92> so the problem is that Mesh doesnt match Drawable?
12:17:41liblq-devoh void *is* actually a feature
12:17:47liblq-dev@alehander92 yeah pretty much
12:17:52*dv^_^ joined #nim
12:18:15liblq-devI mean it matched, but later there was this error http://ix.io/2lgp
12:19:00PMunchUhm, that error is really weird..
12:19:19FromDiscord<clyybber> Does it work if you put everything in one module?
12:19:41liblq-devdear god please no
12:19:47PMunchIt doesn't show why it didn't match for the draw procedure that takes a two argument..
12:20:10liblq-devit would likely work because it seems like the target.nim module doesn't see the other draw procs
12:20:31PMunchExactly
12:20:45PMunchSuper weird error though..
12:20:49PMunchTry to make a minimal example
12:20:55*rockcavera joined #nim
12:21:04PMunchTo check that is in fact the problem
12:21:27*Vladar quit (Quit: Leaving)
12:22:17FromDiscord<clyybber> liblq-dev: You are calling source with the type OpenGL
12:22:19FromDiscord<clyybber> thats wrong
12:22:34FromDiscord<clyybber> *draw
12:22:44FromDiscord<clyybber> there is no draw that accepts a typedesc as a second param
12:24:27PMunchclyybber, no he isn't?
12:24:42PMunchHe's calling it with target.gl
12:24:52PMunchThe concept is defined as taking the type OpenGL
12:25:05PMunchWhich should be right (although I haven't used concepts much)
12:29:03FromDiscord<clyybber> ah, right
12:31:38liblq-devthat's what I read in the documentation, it's a shorthand for declaring another concept variable and adding `x is T`
12:33:10FromDiscord<clyybber> yeah, does it work when you do it manually?
12:33:39PMunchHmm, this seems to work: http://ix.io/2lgy
12:35:24*s4mu3lbk joined #nim
12:35:30liblq-dev@clyybber: no http://ix.io/2lgz
12:40:43liblq-devthink I managed to reproduce it
12:41:52*samuelb_ joined #nim
12:41:59*s4mu3lbk quit (Read error: Connection reset by peer)
12:43:01FromGitter<alehander92> ops
12:43:06FromGitter<alehander92> `await a(await expandValue())` is broken
12:43:12liblq-devhttp://ix.io/2lgE/nim
12:43:13FromGitter<alehander92> by my PR
12:43:22FromGitter<alehander92> huge ops
12:44:50YardanicoZevv: if I apply some of def- tricks (like using syscalls directly) but still include the C library and stuff (so arc and --os:any works) it's 39kb
12:45:29Yardanicoactually 44kb sorry, need to have a syscall for read :D
12:55:04Zevvhaha
12:56:29FromGitter<alehander92> hm, how can i solve it
12:56:35FromGitter<alehander92> this is a big bug
13:04:25*zacharycarter joined #nim
13:09:01*Guest94017 is now known as dadada
13:10:14dadadaquick hint: if you're using vscode, install the file-icons extension, cause it makes nim file icons look very cool, this alone makes it worth it
13:10:35dadadait becomes easier to discern files in the explorer
13:10:37PMunchWhat do they look likE?
13:10:40PMunchThe crown?
13:10:44dadadayep
13:10:47PMunchNeat
13:11:03dadadayou can choose if you want colors or not
13:11:09PMunchThat reminds me, we were talking about making Nim paper crowns for next years FOSDEM
13:11:30FromDiscord<clyybber> lqdev: You don't have a correct exec defined
13:11:44FromDiscord<clyybber> Your exec is unary
13:11:53FromDiscord<clyybber> The non generic one I mean
13:12:25PMunchHmm, I wonder if sheets of yellow craft paper could be laser-cut and coloured along the edges to make the processing easier
13:13:09PMunchs/processing/manufacture
13:13:42FromDiscord<clyybber> liblq-dev: See above, pinged your old name
13:15:17dadadawrong thinking there, Steve said you should think big, or was that IBM?, anywho, real crowns it must be, the royal ones are the only ones that really count, (the insane asylum just called, I'm not allowed to write more)
13:15:56dadadagold + diamonds > paper + scissors
13:16:43FromDiscord<clyybber> I'm sure there are more scissors and paper than there is gold and diamonds :p
13:17:10dadadaquantity vs quality
13:17:51PMunchgold.value + diamonds.value > paper.value + scissors.value
13:18:10dadadajust imagine the looks on the faces of the other FOSDEM participants, when all Nim people walk around in gold + diamonds + real royal crowns from top to bottom
13:18:13FromGitter<codenoid> i want you to stay
13:18:17PMunchHaha :P
13:18:22dadadathey'll wanna join us, trust me
13:18:23FromGitter<codenoid> stay safe nim folks <3
13:18:25PMunchThe Nim crown is pretty understated though..
13:18:48PMunchI think just a solid gold crown would work fine
13:18:54*fredrikhr quit (Ping timeout: 240 seconds)
13:18:59FromGitter<alehander92> oh man this is a bad bug
13:20:47dadadathen it's settled, all Nim people will appear in solid gold crowns, gold can be made one atom thick by the way, so this would be a slick way for producing solid-gold-crowns that are still in the payable range
13:20:58PMunchHmm, is the Nim crown 8 or 6 pronged?
13:21:35PMunchdadada, gold is unfortunately not very solid. So a one atom thick layer would just crumble away..
13:22:01FromDiscord<clyybber> PMunch: 6 afaict
13:22:25leorize[m]https://codecov.io/gh/alaviss/Nim/tree/9d46a5741dd5ceac2b5f4dd5a7424228d73ce6fb
13:22:35leorize[m]looks like the compiler is pretty covered by the test suite
13:22:52leorize[m](you will need to login to view the files)
13:23:00PMunchThe old one definitely has 8
13:23:22PMunchhttps://en.wikipedia.org/wiki/Nim_(programming_language)#/media/File:Nim-logo.png
13:24:41FromDiscord<clyybber> yeah, the one on the website has 6
13:25:10dadadaPMunch: I think gold is not even toxic in low amounts, I want to see Nim developers first appear with solid gold crowns wobble 1-atom-thick on their heads giving talks, and then later just casually eating their crowns (like it's totally normal to do) while in personal talks with other FOSDEM people, this could make Nim developers famous for being more insane than Richard Marcs Stallman, a guy who is known for
13:25:16dadadahaving sex with plants
13:25:20dadadaand this isn't even a joke :D
13:26:28PMunchHaha :P
13:26:38PMunchNot sure if that is the "image" we're going for :P
13:26:42dadadato be fair he's also known for the GPL, emacs, gcc and some other cool stuff
13:27:38FromDiscord<Generic> to match mr stallman we have a long way to go
13:27:46dadadatrze
13:27:46FromDiscord<Generic> we don't even have a song https://www.youtube.com/watch?v=9sJUDx7iEJw
13:27:47dadadatrue
13:28:31dadadaGeneric is challenging us
13:29:02dadadaI have a song by the way
13:29:12FromDiscord<Recruit_main707> 👀
13:30:17dadadahttps://www.youtube.com/watch?v=lNYcviXK4rg
13:34:43FromGitter<alehander92> dadada fun talks are better than bizarre eating paper people!
13:34:46*fredrikhr joined #nim
13:35:44FromGitter<bung87> @alehander92 https://github.com/bung87/ts2nim have you looked at this?
13:37:43dadadaalexander92: and can you imagine the fun talks that follow when people saw something bizarre, sometimes I view life as an art project
13:37:46PMunchCan't the meme-makers auto-tune together some of the Nim talks into a song? :P
13:39:17*fredrikhr quit (Ping timeout: 252 seconds)
13:43:23*fredrikhr joined #nim
13:50:32*wgetch quit (Ping timeout: 256 seconds)
13:50:57*wgetch joined #nim
13:51:30*fredrikhr quit (Ping timeout: 260 seconds)
13:54:04*fredrikhr joined #nim
13:54:13disruptek+1 for moving pathutils into stdlib.
13:56:46liblq-devwell, I need another idea
13:56:58liblq-devif concepts aren't gonna work, then what *is* gonna work?
13:58:04liblq-devI can't just create a "tuple interface" because the Drawable implementer may be generic (like Mesh[V] is)
13:59:17*Romanson joined #nim
14:01:13*lritter joined #nim
14:02:42dom96You can always just forget about concepts and use non-specific generics
14:04:18liblq-devnot really
14:05:56liblq-devbecause then I get the same issue as with concepts
14:06:17liblq-devwhere target.nim needs to import mesh.nim to have access to its draw procs
14:06:43*sagax joined #nim
14:07:47*fredrikhr quit (Quit: Client Disconnecting)
14:20:13liblq-devso, I managed to reproduce that issue I had at the beginning: http://ix.io/2lh4/nim
14:20:32liblq-devany ideas for workarounds?
14:20:53*gangstacat quit (Ping timeout: 272 seconds)
14:23:46liblq-devwait what
14:24:00liblq-devI just added `mixin draw` into my generic proc and huh
14:24:04liblq-devit suddenly started working
14:24:13liblq-devgenerics are confusing.
14:25:08FromGitter<alehander92> @bung87 yes
14:25:13FromGitter<alehander92> no
14:25:21FromGitter<bung87> ok
14:26:26*Vladar joined #nim
14:27:09FromGitter<alehander92> @bung87 sounds good! w
14:27:23FromGitter<alehander92> take a look at https://github.com/mcclure/dts2nim/
14:27:26FromGitter<alehander92> and please
14:27:31FromGitter<alehander92> keep in mind, maybe you dont need this at all
14:27:41*mal`` quit (Ping timeout: 256 seconds)
14:27:50FromGitter<alehander92> i think we mostly need to transpile type definitions
14:27:55*mal`` joined #nim
14:28:06FromGitter<alehander92> because then we can just use the existing typescript code with updates and stuff
14:28:22FromGitter<alehander92> but of course translating more is interesting
14:29:05FromGitter<alehander92> but whatever is fun!
14:30:28PMunchhttp://ix.io/2lh7 <- Parametric Nim crown in OpenSCAD
14:32:57PMunchhttps://uploads.peterme.net/crown.png <- Render
14:34:14FromGitter<bung87> I checked it , 4 years ago , it generate bindings how it import js code?
14:35:44FromGitter<alehander92> no no
14:35:48FromGitter<alehander92> it generated bindings
14:35:56FromGitter<alehander92> but you just import those types
14:35:58FromGitter<bung87> binding cant easy check internal implementations
14:36:03*gangstacat joined #nim
14:36:06FromGitter<alehander92> but you dont want that
14:36:18FromGitter<alehander92> at least in my experience almost all the time
14:36:28FromGitter<alehander92> you just want to use the existing javascript libs
14:36:31disruptek~stream
14:36:32disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
14:36:32FromGitter<bung87> yeah , translating is better I think
14:36:33FromGitter<alehander92> and if possible types for them
14:36:50FromGitter<alehander92> so , no, my point is that just translating the types is better i think
14:36:56FromGitter<alehander92> because transpilation is *much* harder
14:37:07FromGitter<alehander92> and then you need to transpile every update or dependencies etc
14:37:09FromGitter<alehander92> its much harder
14:37:21FromGitter<bung87> I get your point , it's hard
14:37:29FromGitter<alehander92> and the other thing is almost easy
14:37:44FromGitter<alehander92> and its what actual typescript users do anyway iirc
14:37:58FromGitter<alehander92> import the lib in the normal way, and use the types (and if you need, jsffi/cast)
14:38:36FromGitter<alehander92> again, if you find it fun, transpiling is great: i tried to do it for ruby/python etc, but just trying to let you know its mostly for fun, real world usage requires a looot of work
14:38:46FromGitter<alehander92> btw https://github.com/nim-lang/Nim/issues/14279 : broken
14:38:48disbotNested await expressions regression: `await a(await expandValue())` doesnt compile ; snippet at 12https://play.nim-lang.org/#ix=2lhc
14:39:04*liblq-dev quit (Quit: WeeChat 2.8)
14:39:14*liblq-dev joined #nim
14:39:28FromGitter<alehander92> disruptek hey, i used discard asyncCall() several times these days
14:39:30FromGitter<alehander92> how times change
14:40:17FromGitter<bung87> yeah, I checked your project translate ruby to js, not success, seems opal is very closer
14:40:33FromGitter<alehander92> our project was about ruby to nim
14:40:43*krux02 quit (Remote host closed the connection)
14:40:47opalyo
14:40:51FromGitter<alehander92> opal is indeed working for ruby to js, but that's similar to what nim already does
14:40:55FromGitter<alehander92> oh .. hey .. opal
14:40:56FromGitter<alehander92> :D
14:41:15opal:p
14:41:24FromGitter<alehander92> you know about opal? :D
14:41:35FromGitter<bung87> opal ,not easy to handle the ruby regex to js
14:41:59FromGitter<alehander92> yeah but opal for ruby is basically nim for nim: nim already has a javascript backend
14:42:28FromGitter<alehander92> the regex languages that they use: i am not sure about that
14:43:49FromGitter<bung87> the js regex has no named group and ascii mode...
14:43:59PMunchHmm, someone should register the user nim and just have it autojoin various programming channels and log highlights
14:44:21disruptekalehander92: you discarded a future?!
14:44:33PMunchdadada, if you can get enough gold you can now mould the crown: http://ix.io/2lh7 https://uploads.peterme.net/crown.png
14:46:12*PMunch quit (Quit: leaving)
14:50:24*nsf quit (Quit: WeeChat 2.8)
14:52:59opal"you know about opal?" yeah ive come across it
14:53:13opali dont do ruby or js dev though so havent really looked into it deeply
14:53:16zacharycartershashlick: where can I find the generated files that nimterop produces?
14:53:29zacharycarteris there like a default cache dir?
14:54:45FromGitter<kaushalmodi> I add this to the beginning of the nimterop based wrapper: ⏎ ⏎ ```static: ⏎ cDebug()``` ⏎ ⏎ and pipe the compilation output to a foo_wrapper.nim [https://gitter.im/nim-lang/Nim?at=5eb572b5f0377f1631762a8f]
14:55:07FromGitter<kaushalmodi> shashlick: Is this still the best way?
14:55:22zacharycarterah thanks kaushalmodi
14:55:28zacharycarterthat should work
14:56:00FromGitter<kaushalmodi> related feature request: https://github.com/nimterop/nimterop/issues/127
14:56:00disbot[Feature] Option to dump debug in a file
14:57:21zacharycarterthat worked perfectly - should have thought of that
15:00:23FromGitter<kaushalmodi> cool
15:04:42Amun_Rado I get it right? I don't have to call NimMain() if I got GC turned off
15:05:24leorizenope you still have to call it
15:05:35leorizesetting up the gc isn't the only thing that proc does
15:06:22Amun_RaI see, thanks
15:07:38FromDiscord<codic> @Rika Let's see if it can finish in the next 5 days
15:07:39FromDiscord<codic> @mratsim I don't know if it's modular, it's competely random
15:07:47FromDiscord<codic> *completely
15:08:18FromDiscord<Rika> i doubt it will
15:08:38FromDiscord<mratsim> modular exponentiation is easy, otherwise you'll likely run out of memory with the number you try to exponentiate
15:19:33dadadadoes Nim have an iterator that allows to iterate over two items of a simple list (ie seq[string]) at a time
15:19:47leorizeno we don't
15:19:48dadadafor first, second doubleIter(mylist) ????
15:19:58leorizenot that hard to write one fwiw
15:20:04dadadayeah, I know
15:20:18dadadaand will, just don't like to do things only because I don't know something exists
15:21:00leorizerandom fun fact: md5.getMD5(string) have side effects
15:21:18FromDiscord<Rika> why
15:21:20leorizeI'm rather curious why an md5 hashing proc have side effects...
15:22:02FromDiscord<Rika> it doesnt look like it would have
15:23:01leorize!eval import md5; func m(); echo m(); func m() = getMD5("foo")
15:23:03NimBotCompile failed: /usercode/in.nim(1, 28) Error: type mismatch: got <void>
15:23:09leorize!eval import md5; func m(); echo m(); func m(): string = getMD5("foo")
15:23:11NimBotCompile failed: /usercode/in.nim(1, 28) Error: type mismatch: got <void>
15:23:16leorize!eval import md5; func m(): string; echo m(); func m(): string = getMD5("foo")
15:23:18NimBotCompile failed: /usercode/in.nim(1, 46) Error: 'm' can have side effects
15:23:36leorizeit have side effects, and I have no idea why
15:23:54leorizefaulty side effects evaluation?
15:26:34*waleee-cl joined #nim
15:30:45FromGitter<alehander92> disruptek yeah figure
15:31:21FromGitter<alehander92> :D
15:32:08*monokrom joined #nim
15:40:24*ptdel joined #nim
15:40:58*Vladar quit (Quit: Leaving)
15:49:53FromDiscord<dom96> alehander92: are you responding to disruptek on stream?
15:53:34*exelotl quit (Ping timeout: 240 seconds)
15:59:36*someunknownuser joined #nim
16:00:36FromGitter<alehander92> nope
16:00:44FromGitter<alehander92> to an old comment
16:06:55FromDiscord<clyybber> ~stream
16:06:55disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat)
16:06:55disbotstream: 11on btw
16:07:14FromDiscord<clyybber> alehander92: Really interesting programming going on here ^ ^
16:16:50FromGitter<alehander92> i want my normal white background editors back!!!
16:20:55FromDiscord<Rika> how do i perform pointer arithmetic in nim lol
16:21:03Yardanicojust do it 4HEad
16:23:33FromDiscord<Rika> ayy lmao segv
16:23:36leorizeRika: cast it to inv
16:23:38leorizeint*
16:23:47FromDiscord<Rika> am doing so now
16:28:11FromDiscord<Rika> how do i read a cstring if i also have a length? the cstring has nulls in it
16:28:36FromGitter<alehander92> well .. thats not a good cstring
16:28:42FromGitter<alehander92> where do you get it from
16:28:51FromDiscord<Rika> lzma
16:29:28FromGitter<bung87> read it as string
16:29:47FromGitter<alehander92> or as a seq of bytes maybe
16:30:34FromDiscord<Rika> how would i read it as a string?
16:31:10FromGitter<bung87> show the code you get the cstring
16:31:52FromDiscord<Rika> wait
16:31:54FromDiscord<Rika> idea popped up
16:32:02FromGitter<bung87> you may simply declare the type to string ,avoiding using cstring type
16:33:38FromGitter<bung87> if the proc get the cstring that from c just declare the binding proc type to string
16:34:24FromDiscord<Rika> fixed it
16:34:35FromDiscord<Rika> yeah thats what i did
16:35:37FromGitter<bung87> this problem will occurs when you dealing with compress data or image things
16:43:02*abm quit (Ping timeout: 258 seconds)
16:52:59*screens_ joined #nim
17:03:49*abm joined #nim
17:16:52*Trustable joined #nim
17:32:19*Trustable quit (Remote host closed the connection)
17:34:18*Trustable joined #nim
17:49:43*exelotl joined #nim
17:51:44*someunknownuser quit (Quit: someunknownuser)
18:00:53*samuelb_ quit (Quit: Leaving)
18:02:12*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
18:06:54*dadada quit (Ping timeout: 256 seconds)
18:08:53*dadada joined #nim
18:09:14*ertp07 quit (Ping timeout: 240 seconds)
18:09:16*dadada is now known as Guest18755
18:10:45*ertp07 joined #nim
18:12:00FromDiscord<Gary M> I'm doing
18:12:00FromDiscord<Gary M> ```nim
18:12:00FromDiscord<Gary M> extensionNames.setLen(extensionCount)
18:12:00FromDiscord<Gary M> var extNames = extensionNames.allocCStringArray()
18:12:01FromDiscord<Gary M> ```
18:12:01FromDiscord<Gary M> but when I try to deallocCStringArray() afterwards I get `virtualFree failing` Error in the stack trace
18:14:55*ertp07 quit (Read error: Connection reset by peer)
18:20:34leorizeGary M: can I see the code?
18:21:06leorizeRika: newString() can take a length, then you can use that buffer directly
18:22:21FromDiscord<Avatarfighter> ^ when i learned you could do that it was game changing
18:22:58*avatarfighter joined #nim
18:25:33FromDiscord<clyybber> @Gary M I think you have to call vkCreateInstance before freeing it
18:25:51FromDiscord<clyybber> Same for vkCreateDevice
18:26:57FromDiscord<clyybber> And it could be that vulkan takes ownership of the cstringarray until you call vkDestroyInstance
18:36:18*ertp07 joined #nim
18:39:29*ertp07 quit (Read error: Connection reset by peer)
18:42:43*ertp07 joined #nim
18:42:56FromDiscord<Gary M> even trying to deallocate it after vkDestroyInstance isn't working @clyybber
18:43:09FromDiscord<clyybber> hmm
18:43:12FromDiscord<clyybber> weird
18:43:24FromDiscord<clyybber> I never encountered that issue because I never freed it :D
18:43:38FromDiscord<Gary M> lol
18:47:30*terps joined #nim
18:49:15FromDiscord<Rika> Leorize: I already know
18:49:31FromDiscord<Rika> I apparently made a string via that but coerced it into a carding
18:49:35FromDiscord<Rika> Cstring
18:49:53FromDiscord<Rika> Anyway good bye
18:51:19ZevvIs there an easier shortcut to create nim to a shared library, instead of collecing the C sources and passing it to gcc manually?
18:51:47shashlick--app:lib
18:52:01Zevv\o/
18:53:05FromGitter<alehander92> clyybber i did repor that error that you linked to
18:53:11FromGitter<alehander92> and had a fix for one case of it
18:53:20FromGitter<alehander92> but i think the underlying problem is that
18:53:28FromGitter<alehander92> we need to somehow tmp-ize the
18:53:30FromGitter<alehander92> awaits
18:56:44*Romanson quit (Quit: Connection closed for inactivity)
18:58:10ZevvWell that was easy, with arc using NPeg from C or C++ is pretty trivial. Never thought of that, yay!
18:59:28leorize[m]I tried to get coverage data of the entire stdlib
18:59:49leorize[m]and... looks like there isn't enough RAM to process that lol
19:00:09leorize[m]https://github.com/alaviss/Nim/runs/656825742?check_suite_focus=true#step:9:16088
19:05:20*ptdel joined #nim
19:12:32FromGitter<alehander92> :O
19:14:45FromDiscord<clyybber> alehander92: AFAIK yglukhov looked into it, but I haven't heard from him since
19:20:27FromGitter<awr1> `@Gary M` you doing vulkan?
19:20:58*terps quit (Ping timeout: 256 seconds)
19:21:10FromGitter<awr1> for extensions/layers, etc. you just make a seq of cstrings and get addr to first element and cast to cstringArray
19:23:23FromGitter<alehander92> clyybber i think my comments describe what happens
19:23:32FromGitter<awr1> if you're trying to *query* extensions and layers, fairly easy, just get extension count, make a new seq, and tell vulkan to fill the seq in with `vkEnumerateInstanceLayerProperties` or whatever it is
19:23:35FromGitter<alehander92> i just didnt know if we need to handle all similar cases
19:24:07FromGitter<awr1> you shouldn't really be needing to use the cstring allocation stuff
19:24:14FromGitter<alehander92> but yeah in yglukhov surely has a more general/deep knowledge about it
19:24:16FromGitter<alehander92> sorry
19:26:02FromGitter<awr1> and even if you were, that's technically "long-lived data" so really leaks shouldn't matter that much for that.
19:26:54federico3https://github.com/doctorn/micro-mitten have you seen this?
19:27:06FromGitter<awr1> the necessity of manual frees (or resets) in vulkan is more important when you're messing around with command buffers, etc.
19:29:25FromGitter<alehander92> i just saw it today
19:29:28FromGitter<alehander92> looks interesting
19:30:55*exelotl quit (Ping timeout: 260 seconds)
19:34:47FromGitter<sealmove> guys, do you know how to get seq `len` in gdb?
19:35:10FromGitter<sealmove> `print mySeq.len` outputs "There is no member named len."
19:35:26FromGitter<awr1> try calling `len(mySeq)`
19:36:14FromGitter<sealmove> doesn't work :|
19:36:46FromGitter<awr1> you may need to tab-complete len and myseq
19:36:57FromGitter<awr1> b/c they will probably be mangled
19:38:53FromGitter<alehander92> yeah
19:38:56FromGitter<alehander92> or you can
19:39:00FromGitter<alehander92> mySeq->SuP
19:39:08FromGitter<alehander92> and look at len / cap or something like that
19:39:13FromGitter<awr1> actually you may be able to get `len` via the dot
19:39:26FromGitter<awr1> but just remember `mySeq` will probably be mangled
19:40:26FromDiscord<Recruit_main707> this is almost the the finished version of the nim flatbuffers, it would be cool if you had a look at it, i can send it as playfround urls if you want, there are only 2 files
19:40:26FromDiscord<Recruit_main707> https://cdn.discordapp.com/attachments/371759389889003532/708402953416998942/flatbuffers-nim.zip
19:40:47FromGitter<awr1> internal memory layout of seqs is like `struct SeqUnit { NI len, cap; Unit** d; };`
19:41:55FromGitter<sealmove> the variable names don't seem to be mangled
19:42:00FromGitter<awr1> yeah they aren't
19:42:06FromGitter<awr1> oh
19:42:20FromGitter<awr1> i mean that the internal fields aren't mangled
19:42:46FromGitter<sealmove> i can query the variables normally
19:43:01FromGitter<sealmove> it was surprising to me also because I read in an article they are mangled
19:43:12FromGitter<alehander92> nope
19:43:19FromGitter<alehander92> only on top level iirc
19:44:00FromGitter<sealmove> ah i see
19:50:13*ptdel quit (Remote host closed the connection)
19:51:29*ptdel joined #nim
19:52:38*avatarfighter quit (Ping timeout: 260 seconds)
20:13:01*avatarfighter joined #nim
20:15:47*NimBot joined #nim
20:15:55FromGitter<alehander92> i want to run a lot of random code
20:16:11FromGitter<alehander92> so i am ok with just separating my data structures for each call
20:16:57FromGitter<alehander92> and just join in the end, copying some stuff
20:17:14FromGitter<alehander92> can i somehow `#openmp`
20:17:17FromGitter<alehander92> i guess with emit i can
20:17:37FromDiscord<clyybber> alehander92: I would use weave
20:17:43FromDiscord<clyybber> It makes it really simple to do that
20:19:21FromGitter<alehander92> no
20:19:26FromGitter<alehander92> i really want to run random code
20:19:42FromGitter<alehander92> i feel like weave and builtin parallel blocks all require very specific
20:19:50FromGitter<alehander92> notions of code inside, right?
20:20:05FromGitter<alehander92> i literally want to run the nim parser as a lib
20:20:08FromGitter<alehander92> paralelly
20:31:35*exelotl joined #nim
20:32:33*solitudesf- quit (Remote host closed the connection)
20:32:56*solitudesf- joined #nim
20:34:14FromDiscord<clyybber> alehander92: Use threads and spawn
20:34:30FromDiscord<clyybber> And its probably best to use arc too
20:36:26FromGitter<alehander92> hm, but i dont want to
20:36:29FromGitter<alehander92> i mean, i want to
20:36:38FromGitter<alehander92> but i explicitly want to enforce running on n cores
20:36:44FromGitter<alehander92> can i do that without openmp?
20:37:07FromGitter<alehander92> its cpu bound
20:37:14FromGitter<alehander92> so i dont want just threads
20:37:39FromGitter<alehander92> about arc: i can try, good note! does it run the compiler well
20:38:14FromGitter<alehander92> i mean, i run part of the compiler itself(the parser etc)
20:39:53*narimiran quit (Quit: leaving)
20:45:23FromDiscord<clyybber> oh
20:45:28FromDiscord<clyybber> eh I don't think so
20:45:33FromDiscord<clyybber> best to not use it then I guess
20:47:18FromGitter<alehander92> hmm
20:47:23FromGitter<alehander92> otherwise weave might work
20:47:26FromGitter<alehander92> maybe i misjudged it
20:47:38FromGitter<alehander92> but i want to just try
20:47:42FromGitter<alehander92> with openmp directly first
21:01:38leorizeisn't weave supposed to be faster than openmp?
21:01:58*idf quit (Ping timeout: 246 seconds)
21:02:05FromDiscord<clyybber> it is
21:03:03FromGitter<alehander92> i can find both eventually
21:03:14FromGitter<alehander92> i am mostly experiemting
21:03:34FromGitter<alehander92> with writing a small parallel toy compiler for beginning
21:04:24FromGitter<alehander92> later maybe making it bigger or generalizing it
21:04:55FromGitter<alehander92> but .. for now just figuring out uni 2nd year basics :D
21:04:58FromGitter<alehander92> probably
21:08:28*solitudesf- quit (Ping timeout: 272 seconds)
21:09:05FromGitter<Bennyelg> Alloah
21:09:29FromGitter<Bennyelg> How I can patch procedure for testing purposes ?
21:17:58FromGitter<Bennyelg> 1) What is the right hierarchy for tests? dedicated folder or next to the module itself ?
21:19:07*terps joined #nim
21:19:13FromGitter<kaushalmodi> @Bennyelg For more modules, there are `t*.nim` files
21:24:33FromGitter<kaushalmodi> e.g. `<nim repo>/tests/collections/ttables.nim`
21:27:39*Trustable quit (Remote host closed the connection)
21:28:23*ptdel quit (Remote host closed the connection)
21:31:35*idf joined #nim
21:32:57*liblq-dev quit (Ping timeout: 260 seconds)
21:34:07*avatarfighter quit (Ping timeout: 260 seconds)
21:34:55*liblq-dev joined #nim
21:39:18*krux02 joined #nim
21:44:14*terps quit (Ping timeout: 240 seconds)
21:45:53*thomasross joined #nim
21:48:54*idf quit (Ping timeout: 260 seconds)
21:49:22*ertp07 quit (Ping timeout: 260 seconds)
21:49:53*idf joined #nim
21:59:54*avatarfighter joined #nim
22:14:18*idf quit (Ping timeout: 256 seconds)
22:46:05FromGitter<matrixbot> `TheManiac™` Hi folks, Quick question... If I have successfully run `if f of Foo`, how do I call `Foo` methods on `f``? Should I use `cast`, or is there some other way?
22:46:35FromGitter<matrixbot> `TheManiac™` * Hi folks, Quick question... If I have successfully run `if f of Foo`, how do I call `Foo` methods on `f`? Should I use `cast`, or is there some other way?
22:48:39*tane quit (Quit: Leaving)
22:52:12krux02you can just to conversion
22:52:37krux02Foo(f).method(arg1,arg2)
22:52:58FromGitter<matrixbot> `TheManiac™` Aha. Thank you!
22:53:32leorizealso, you can join us on IRC at #freenode_#nim:matrix.org
22:53:56leorizeI'm pretty sure we got this linked on our homepage :/
23:00:41PrestigeCan I somehow retrieve an element of an OrderedSet by index?
23:00:45Prestigeother than iteration
23:02:17*liblq-dev quit (Quit: WeeChat 2.8)
23:18:32krux02no
23:18:40krux02maybe this should be documented
23:19:10krux02this ist not the first time somebody asks
23:22:44*Guest18755 quit (Ping timeout: 272 seconds)
23:22:45*avatarfighter quit (Ping timeout: 240 seconds)
23:23:13PrestigeI'm wanting to get the element from a set after a currently matched element - trying to not produce more code than necessary to do so
23:24:26krux02so you get an element fron an ordered set and then you want to get the next element that would come afterwards
23:24:35krux02from the order that the set defines
23:24:39PrestigeRight, essentially
23:25:42Prestigehttps://play.nim-lang.org/#ix=2lkn <- small example
23:26:23PrestigeI could try caching the previous element and iterate in reverse, or maybe set a flag to grab the element on the next iteration, I suppose
23:29:10krux02I looked at the implementation, and it looks like the implementation could provide such a functionality, but it doesn't provide it.
23:29:35PrestigeYeah I was thinking the same. Wish I can access to "data"
23:30:38PrestigeMaybe I could submit a PR for a proc to get by index
23:31:13krux02no don't do by index
23:31:36krux02hash sets do not have an index.
23:31:41*dadada joined #nim
23:32:04*dadada is now known as Guest15243
23:32:07*TheManiac[m] joined #nim
23:32:20krux02The order of items in hash sets and maps is conceptually random.
23:32:49krux02(in the language Go it is actually random)
23:33:35krux02that means that you should not do such a thing such as index. Especially not, when the index doesn't math the position that you get with the `items*` iterator.
23:34:05Prestigein OrderedSet the data is backed by a seq to maintain insertion order though
23:34:26krux02But something like ``proc next[T](s: OrderedSet[T], key: T): T`` i would approve
23:34:39krux02no
23:34:41krux02it is not
23:35:02krux02the insersion order is preserved by a linking the items like a linked list
23:36:19Prestigehttps://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/collections/sets.nim#L76 It looks like it's backed by a seq to me
23:36:34krux02it is backed by a seq
23:36:54krux02but the seq does not provide the insertion order
23:37:07krux02look at `forAllOrderedPairs` template
23:37:20krux02(which is used in the items iterator)
23:37:33PrestigeAh interesting
23:37:37PrestigeYeah that could work then
23:37:54krux02the template is not exported
23:38:04krux02it is an implementation detail
23:38:15*konvertex quit (Ping timeout: 260 seconds)
23:38:26PrestigeThat would be nice to have for my particular use case, at least
23:46:44*avatarfighter joined #nim
23:47:43krux02well, as long as you don't have access to change the stdlib source code, you can still copy paset it to a file in your own project and use it there instead.
23:48:16krux02then you can just export everything you need.
23:55:26*Guest15243 quit (Ping timeout: 258 seconds)
23:56:26*pbb quit (Ping timeout: 244 seconds)
23:56:50*pbb joined #nim
23:58:27*krux02 quit (Remote host closed the connection)