<< 08-12-2019 >>

00:00:02*junland quit (Quit: %ZNC Disconnected%)
00:01:17*junland joined #nim
00:05:45*tklohna quit (Ping timeout: 252 seconds)
00:06:18*sealmove quit (Quit: WeeChat 2.6)
01:53:47*dwdv quit (Ping timeout: 276 seconds)
02:04:01FromDiscord<exelotl> is this a bug? https://play.nim-lang.org/#ix=23Qq
02:21:16FromGitter<Varriount> exelotl: Either a bug, or simply an ambiguity the compiler doesn't like
02:50:28FromDiscord<Kaynato> Pared down some strange behavior with generic concepts - can't figure out what it takes for the third to match where the second does https://gist.github.com/Kaynato/58cd79b9634e84399bdfadebdfe2d2e8
02:52:13FromDiscord<Kaynato> certainly, concepts aren't interfaces, but short of metaprogramming to generate shared code for a slew of different treeorders I don't see what other elegant (?) solutions there ought to be
03:00:52FromDiscord<exelotl> ouch I spent way too long on advent of code
03:01:12FromDiscord<exelotl> closures created inside loops do not work how I expected them to :(
03:05:42FromDiscord<exelotl> https://play.nim-lang.org/#ix=23Qu
03:06:23*Jjp137 quit (Read error: Connection reset by peer)
03:07:01*Jjp137 joined #nim
03:21:28*endragor joined #nim
03:40:13FromDiscord<Kaynato> It makes complete sense if you consider that it's an inline iterator
03:40:13FromDiscord<Kaynato> try making the inner proc do let v=i; return i
03:43:01FromDiscord<Kaynato> ....huh, still prints all 5s. wonder about trying with a closure iterator
03:55:40*endragor quit (Remote host closed the connection)
04:16:23FromDiscord<Kaynato> just encountered a particularly interesting out of memory during compilation... nim rapidly blew up to eat the entire RAM
04:17:50FromDiscord<Kaynato> I'm going to try and make a minimally reproducible example and see where presumably I must be entering some infinite loop
04:34:16FromDiscord<Kaynato> Oh, that's fun. Nim code that generates a c compiler error
04:55:31FromDiscord<treeform> bug track it
04:55:38FromDiscord<Kaynato> https://gist.github.com/Kaynato/ec1dfc0cbde10c0aab9f2b87bddaa4cd
04:55:46FromDiscord<treeform> Nim community is surprisingly good at fixing bugs
04:56:12FromDiscord<treeform> that looks like a tough one
05:01:34FromDiscord<Kaynato> Looks like the macro was also a red herring
05:02:17*chemist69 quit (Ping timeout: 276 seconds)
05:03:50*chemist69 joined #nim
05:07:06FromDiscord<Kaynato> God, messing with this in any way almost always manages to lead to a gcc error
05:14:11FromDiscord<treeform> macros?
05:21:41FromDiscord<Kaynato> concepts and generic inference
05:21:52FromDiscord<Kaynato> * and inheritance
05:28:58FromDiscord<Kaynato> Here we are: https://github.com/nim-lang/Nim/issues/12841
05:29:00disbotCode causing nimc OOM or producing gcc syntax error @11Kaynato; snippet at https://play.nim-lang.org/#ix=23QO
05:29:56FromDiscord<Kaynato> and for good measure: https://play.nim-lang.org/#ix=23QP
05:50:42*ehmery joined #nim
05:57:39*Hideki_ quit (Remote host closed the connection)
06:29:03*nsf joined #nim
07:00:38*nc-x joined #nim
07:07:51*nc-x quit (Ping timeout: 260 seconds)
07:13:38*solitudesf joined #nim
07:14:31*thomasross_ joined #nim
07:14:31*thomasross quit (Killed (card.freenode.net (Nickname regained by services)))
07:14:31*thomasross_ is now known as thomasross
07:22:47*thomasross_ joined #nim
07:22:47*thomasross quit (Killed (wolfe.freenode.net (Nickname regained by services)))
07:22:47*thomasross_ is now known as thomasross
07:38:06FromDiscord<Kaynato> https://play.nim-lang.org/#ix=23R4 Removing both vars on the proc call also causes the compiler to OOM.
08:00:00*gmpreussner quit (Quit: kthxbye)
08:04:57*gmpreussner joined #nim
08:11:39*gmpreussner quit (Ping timeout: 250 seconds)
08:12:05*Jjp137 quit (Read error: Connection reset by peer)
08:15:59*solitudesf quit (Ping timeout: 276 seconds)
08:27:21*dddddd quit (Remote host closed the connection)
08:33:40*endragor joined #nim
08:40:43*endragor quit (Remote host closed the connection)
08:47:38*endragor joined #nim
08:51:25*Hideki_ joined #nim
08:52:45*endragor quit (Remote host closed the connection)
08:59:33*Hideki_ quit ()
09:01:03*Hideki_ joined #nim
09:01:34*tane joined #nim
09:15:27FromDiscord<mratsim> @treeform Nim is like minimal distro like Gentoo or Arch, after a while you played so much with the internals that you usually have a good ideas of where to look to find a workaround or the source of bug
09:15:46FromDiscord<mratsim> I'm especially impressed by the ability of people to produce minimal working examples
09:27:26*filcuc joined #nim
09:28:07FromDiscord<krptr> hi, is there a way to declare an alias to a template? Tried this (might make no sense) and triggered an internal compiler error: https://play.nim-lang.org/#ix=23Rk
09:33:37*filcuc quit (Quit: Konversation terminated!)
09:33:52*filcuc joined #nim
09:34:09*nsf quit (Quit: WeeChat 2.6)
09:36:34*filcuc quit (Client Quit)
09:36:44*filcuc joined #nim
09:45:02*filcuc quit (Ping timeout: 276 seconds)
09:51:17aeverr[m]kptr, no i dont think so
09:57:00*ng0 joined #nim
09:58:27lqdev[m]@krptr, yeah, just create another template that calls your desired template
09:59:00lqdev[m]templates are not runtime things, so you can't store them in consts/variables
10:00:08lqdev[m]s/not runtime things/not expanded at runtime/
10:01:12*lritter joined #nim
10:05:06*matic joined #nim
10:06:26*ng0 quit (Quit: Alexa, when is the end of world?)
10:11:53*Jjp137 joined #nim
10:12:52FromDiscord<krptr> @lqdev yeah this is what I'm doing at the moment using a template proxy. In any case a compiler error is not what I was expecting either althought the example I posted is silly
10:13:13FromDiscord<mratsim> why don't you just call notice("foo")?
10:13:30FromDiscord<mratsim> yes, you can open an issue for the compiler error
10:13:36FromDiscord<mratsim> the compiler should never crash
10:13:54FromDiscord<krptr> @mratsim this was a minimal example for the sake of the error
10:13:59FromDiscord<mratsim> ah I see
10:14:26FromDiscord<mratsim> the way to declare aliases are template, though there was some proposal to create an "alias" statement
10:14:43FromDiscord<mratsim> maybe there is even one in the sugar module
10:14:48lqdev[m]gosh, please no more keywords
10:15:10lqdev[m]I'm already hurt because `end` is a keyword and it's unused
10:23:33maticHi, how do you overload `[]` and `+=`/`-=` simultaneously for an array type?
10:23:39FromDiscord<krptr> ok, reported, thanks @mratsim
10:24:33*dwdv joined #nim
10:24:55*nim_noob joined #nim
10:26:20aeverr[m]matic, any reason you cant do it with 3 procs
10:27:11aeverr[m]lqdev, does editing in matrix work well with irc?
10:28:13aeverr[m]whatever, ill test it. Test
10:28:16aeverr[m] * whatever, ill test it.
10:28:27aeverr[m]i see
10:29:32maticaeverr: Yeah sure, how? Because `[]` returns an uint8, `+=` throws "but expression 'arr[i]' is of type: uint8".
10:30:00lqdev[m]aeverr: editing is actually a riot.im feature, it's not defined in the matrix protocol
10:30:17lqdev[m]but yeah as you observed it just prepends * to your edited message
10:31:04lqdev[m]which is why I think it's useless, using the sed/vim-like s/a/b/ gives people some more context as to what should be replaced
10:35:57aeverr[m]ooooh i see. that's kinda ass
10:36:17aeverr[m]i'd move client but windows clients is either this, that one gtk one, or the cli one
10:37:00aeverr[m]matic, i think you have to make a `[]=` proc
10:37:37ZevvHmmm, these annoying inconsistencies... `(0..3).mapIt(it)` is ok but `(0..3).map(it => it)` does not compile
10:37:43aeverr[m]huh thats odd, \`\` is escaped for irc to matrix
10:37:57aeverr[m]zevv, did you import sugar
10:38:40aeverr[m]also i think its because mapit is a template, prolly does some other black magic
10:38:46aeverr[m]call toSeq on the range
10:38:47aeverr[m]maybe?
10:40:17nim_noobHey there!Let me explain the issue again. Whenever I try to cross-compile a Win application, I get this error:"/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: unrecognized option '-z' /usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: use the --help option for usage informationcollect2: error:
10:40:17nim_noobld returned 1 exit statusError: execution of an external program failed: '/usr/bin/x86_64-w64-mingw32-gcc -o .../testWinCompilation.exe .../.cache/nim/testWinCompilation_d/stdlib_formatfloat.nim.c.o .../.cache/nim/testWinCompilation_d/stdlib_io.nim.c.o .../.cache/nim/testWinCompilation_d/stdlib_system.nim.c.o
10:40:18nim_noob.../.cache/nim/testWinCompilation_d/@mtestWinCompilation.nim.c.o -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'"
10:40:50*FromGitter quit (Remote host closed the connection)
10:41:08*FromGitter joined #nim
10:41:24nim_noobWell, the message has just messed up...
10:41:52nim_noobAnyway, I do think it's a bag. I've found the same problem and its solution there: https://stackoverflow.com/questions/41877378/mingw32-make-command-unrecognized-option-z.
10:42:22nim_noobHowever, I cannot report this issue on GitHub 'cause I do not want to have an account there
10:42:26Zevvaeverr[m], sure sugar is there. I do know *why* one works and the other doesn't, it just that I ran into it
10:42:32Zevvand felt like whining about it a bit
10:43:30aeverr[m]ah i thought you didnt
10:43:56Zevv:)
10:44:14aeverr[m]nim_noob, any reason for the dislike of creating a github account :V
10:46:09nim_noobaeverr[m], I just don't need it - Gitea all the way
10:47:47maticaeverr: I made a small example: https://play.nim-lang.org/#ix=23RH
10:48:04maticHow do I make the last line work?
10:49:34aeverr[m]hmm im looking into it
10:50:02maticthanks
10:50:39Zevvarr[5] = arr[5] + 0x01
10:51:40Zevvor add your own `+=` for your type
10:52:12*Hideki_ quit (Remote host closed the connection)
10:52:34maticZevv: "add your own `+=` for your type", how do I do that as `[]` is already overloaded?
10:52:36aeverr[m]if its just numerically 1 you can use inc
10:53:10maticaeverr: that's just an example, in my real code there are larger values.
10:54:36aeverr[m]personally, i'd use a name. not `+=`. but thats me, ill continue thinking for now
10:54:42aeverr[m]i dont think its possible tbh
10:54:47aeverr[m]because of how the code is parsed
10:57:01maticOk, good to know. Thanks for the information.
10:57:23*luis_ joined #nim
10:58:59luis_hi, all... I need to build a small app with a simple GUI, but it should be able to run on windows and linux... which gui framework is the most complete today in nim?
11:03:05*luis_ quit (Quit: luis_)
11:03:33*luis_ joined #nim
11:03:44nim_noobIs there any way to unflag '-z'?
11:04:19Araqluis_: I'm looking forward to treeform's UI library, but I think wxWidgets is not a bad choice
11:04:27*Hideki_ joined #nim
11:04:30AraqPMunch knows more when he is around
11:06:34luis_thanks
11:07:38*luis_ quit (Client Quit)
11:08:09*luis_ joined #nim
11:12:01*ng0 joined #nim
11:12:48*Hideki_ quit (Ping timeout: 245 seconds)
11:16:51*sealmove joined #nim
11:17:39nim_noobSo, with ' --passL:OPTION' I can pass an option to the linker, but how can I pick the '-z' option out?
11:18:29aeverr[m]ping Araq maybe plsdontkillmeoholyone
11:19:33planetis[m]matic: you need a second overload for `[]` that has this signature: ```proc `[]`*(self: MyArray, i: int): var uint8```
11:20:19aeverr[m]`Error: overloaded '[]' leads to ambiguous calls`
11:20:35aeverr[m]you cant overload if they have the same argument signature
11:20:44aeverr[m]its either non-var or var
11:21:27*luis_ quit (Ping timeout: 250 seconds)
11:21:55nim_noobOr can I specify a linker somehow?
11:22:52planetis[m]try this: ```proc `[]`*(self: var MyArray, i: int): var uint8```
11:23:54aeverr[m]matic: ^ this works
11:24:19*krux02 joined #nim
11:25:22maticplanetis, aeverr: Excellent, thank you!
11:25:45aeverr[m]TIL too, nice
11:26:09aeverr[m]man, nim is so insane
11:27:22*kungtotte joined #nim
11:38:09*luis_ joined #nim
11:41:32nim_noobnim.cfg contains: "gcc.options.linker %= "${gcc.options.linker} -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now". Shouldn't it be specific for each mingw's linker?
11:44:22nim_noobI mean, I have 2 of them: the first one is in "/usr/bin/x86_64-w64-mingw32-ld", WHICH ought to be used because it has '-z' flag
11:45:00nim_noobAnd the 2nd one is in "/usr/x86_64-w64-mingw32/bin/ld"
11:45:24nim_noobIs that even OK?
11:48:22*nsf joined #nim
11:48:43lqdev[m]what does -z even to?
11:48:47lqdev[m]s/to/do
11:49:36lqdev[m]and afaik /usr/bin/x86_64-w64-mingw32-ld should be a symlink to /usr/x86_64-w64-mingw32/bin/ld
11:54:26nim_nooblqdev[m], what is, "-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"?
11:55:42nim_noobIt is in the error: "Error: execution of an external program failed: '/usr/bin/x86_64-w64-mingw32-gcc -o /home/myname/progs/testWinCompilation.exe /home/myname/.cache/nim/testWinCompilation_d/stdlib_formatfloat.nim.c.o /home/myname/.cache/nim/testWinCompilation_d/stdlib_io.nim.c.o
11:55:42nim_noob/home/myname/.cache/nim/testWinCompilation_d/stdlib_system.nim.c.o /home/myname/.cache/nim/testWinCompilation_d/@mtestWinCompilation.nim.c.o -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'"
11:56:11nim_noobI guess these are the flags for the linker
11:56:52nim_noob'Cause it had said, "/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: unrecognized option '-z' /usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: use the --help option for usage information"
12:00:16nim_noobAnd there's no '-z' option in /usr/x86_64-w64-mingw32/bin/ld
12:02:01*tyler569 quit (Ping timeout: 265 seconds)
12:02:31*tyler569 joined #nim
12:03:34nim_noobBut common ld has got it: https://linux.die.net/man/1/ld
12:03:39nim_noobSo idk
12:03:46nim_noobWhat the problem is
12:04:25nim_noobAnd idk if only I have got the issue
12:05:04nim_noobDoes Win cross-compilation works properly on Linux?
12:05:58nim_noobOh, I need to chill out
12:11:33*tklohna joined #nim
12:11:42luis_Araq: what about https://github.com/yglukhov/nimx ? Looks promising?
12:12:23aeverr[m]that face is so intimidating...
12:16:46Araqluis_: nimx is good too but iirc doesn't use native widgets and is more focussed on gamedev
12:17:22luis_ok, thanks
12:18:23Araqnim_noob: use a CI (travis, azure, appveyor) to build your software for Windows/linux
12:18:38Araqeasier than the GCC cross compile toolchains IME
12:23:55*letto quit (Quit: Konversation terminated!)
12:24:25*letto joined #nim
12:25:22nim_noobI'll try, Araq, thanks
12:27:09*tklohna quit (Ping timeout: 252 seconds)
12:38:05*luis_ quit (Quit: luis_)
12:38:29*luis_ joined #nim
12:39:34*luis_ quit (Client Quit)
12:39:59*tklohna joined #nim
12:40:35*luis_ joined #nim
13:01:07*luis_ quit (Quit: luis_)
13:08:35*njoseph quit (Ping timeout: 252 seconds)
13:10:59*luis_ joined #nim
13:15:17sealmovewtf: Error: type mismatch: got <seq[myType]> but expected 'seq[myType]'
13:15:32sealmovethis error is confusing, anyone can guess what's going on?
13:16:25sealmoveI guess I shouldn't use "include"
13:21:12*nim_noob left #nim (#nim)
13:21:55dom96yes, you shouldn't
13:22:26dom96but that error should be improved as well
13:23:35*solitudesf joined #nim
13:24:34*njoseph joined #nim
13:36:04FromDiscord<mratsim> @Araq, How would you go to make "spawn" be discardable only if it returns Flowvar[void]?
13:36:46FromDiscord<mratsim> this way people wouldn't have to return a dummy bool to await a spawn
13:41:28*endragor joined #nim
13:46:54FromGitter<auxym> quick Q: `seqs` are passed by value, right? Is there a quick/easy way to pass by ref, other than declaring a wrapper `ref object` type?
13:47:55FromDiscord<mratsim> they are not
13:48:08FromDiscord<mratsim> only the ref + len are passed
13:48:25FromDiscord<mratsim> they have value semantics though, so copies are deep
13:49:56FromGitter<auxym> nice, ty
13:50:27*endragor quit (Remote host closed the connection)
13:51:21*luis_ quit (Remote host closed the connection)
13:52:33*luis_ joined #nim
14:19:19*luis_ quit (Quit: luis_)
14:23:29Araqmratsim: I don't know. is that even a good idea? you still might want to sync with the thread anyway
14:27:34*filcuc joined #nim
14:36:36*sealmove quit (Quit: WeeChat 2.6)
14:44:15*thomasross quit (Ping timeout: 250 seconds)
14:45:49*thomasross joined #nim
14:58:53*ng0_ joined #nim
14:59:45*Hideki_ joined #nim
15:00:44*ng0 quit (Ping timeout: 260 seconds)
15:01:26*ng0_ is now known as ng0
15:08:43*sealmove joined #nim
15:09:46*nsf quit (Quit: WeeChat 2.6)
15:18:17*Boko_aebee joined #nim
15:20:46*Boko_aebee quit (Read error: Connection reset by peer)
15:32:31FromDiscord<mratsim> in the current threadpool you get nothing
15:32:37FromDiscord<mratsim> so you need to return a dummy
15:32:53*filcuc quit (Ping timeout: 268 seconds)
15:33:57*filcuc joined #nim
15:34:25*Trustable joined #nim
15:35:32FromDiscord<mratsim> for example, for a parallel heat diffusion equation: https://github.com/mratsim/weave/blob/2eaed0fda6920d1a6454e0f894d7454024ee8054/benchmarks/heat/weave_heat.nim#L133-L141
15:36:33FromDiscord<mratsim> the dummy is just used to make sure the Matrix regios was properly updated, and only the thread that try to take hold of that region will wait there, the other can do anything
15:37:09FromDiscord<mratsim> there is a global sync at the end but otherwise everything is just lazy
15:37:19*Boko_ededa joined #nim
15:39:47*Boko_ededa quit (Write error: Connection reset by peer)
15:41:09*Boko_deaec joined #nim
15:46:51*Boko_deaec quit (Write error: Connection reset by peer)
15:47:19*matic quit (Quit: Leaving)
15:56:15*mibr joined #nim
15:57:07*Boko_bebed joined #nim
16:00:34*Boko_bebed quit (Write error: Connection reset by peer)
16:01:42*Boko_ebdea joined #nim
16:01:54*Boko_ebdea quit (Read error: Connection reset by peer)
16:04:31*Hideki_ quit (Remote host closed the connection)
16:06:31*gmpreussner joined #nim
16:08:06*Hideki_ joined #nim
16:09:37*filcuc quit (Ping timeout: 240 seconds)
16:10:54*dddddd joined #nim
16:12:13*Boko_adeeb joined #nim
16:12:52*Hideki_ quit (Ping timeout: 265 seconds)
16:14:23*Boko_adeeb quit (Write error: Connection reset by peer)
16:14:26*gmpreussner_ joined #nim
16:15:17*gmpreussner quit (Ping timeout: 246 seconds)
16:37:00*Boko_baaea joined #nim
16:39:10*Boko_baaea quit (Write error: Connection reset by peer)
16:42:53*Hideki_ joined #nim
16:43:41*nsf joined #nim
17:07:19*narimiran joined #nim
17:12:55Araqboy do I suck at bitops. silly mistakes
17:16:41FromDiscord<mratsim> try doing some cryptography or bigints for training 😉
17:17:16aeverr[m]im still a firm believer that shift right and shift left are poorly named
17:18:13FromDiscord<mratsim> btw the noUndefined flags is a bit useless due to returning zero for countTrailingZeros and countLeadingZeros, I have yet to see a use-case that doesn't need size of the type instead.
17:18:41FromDiscord<mratsim> in particular it breaks generic code that needs to iterate on multiple limbs of a bigints
17:19:11FromDiscord<mratsim> returning zero when the input is zero*
17:19:42FromDiscord<mratsim> they are named the same as the assembly instructions @aeverr
17:20:17aeverr[m]then the assembly instructions have bad names
17:37:56*gmpreussner_ quit (Ping timeout: 265 seconds)
17:41:20*gmpreussner joined #nim
17:43:16*luis_ joined #nim
17:43:50ZevvHa, Java also does --gc:none! https://blogs.oracle.com/javamagazine/epsilon-the-jdks-do-nothing-garbage-collector
17:44:52FromDiscord<treeform> OMG just spent an hour debugging and its an issue with setTerminate handler again. Why does the setTerminate is like this ghost that hunts me...
17:45:39FromDiscord<treeform> I think I spent days debugging nim's setTerminate handler now. Every one wants some thing different from it and it works for no one.
17:46:53FromDiscord<treeform> I wish there was a way to override nim's std system functions from user code...
17:51:21FromDiscord<Kaynato> another gcc error... even after all these workarounds for generality at the cost of elegance 😰
17:51:22*nc-x joined #nim
17:51:45FromDiscord<Kaynato> time to pare this one down... ugh
17:56:50FromDiscord<Kaynato> Not again. https://play.nim-lang.org/#ix=23TG
17:57:11aeverr[m]F, good luck
17:57:22FromDiscord<Kaynato> I'm going to try avoiding ref object in its entirety and use tuple instead
17:57:31Yardanicodon't forget to report the issue though :P
18:02:03*tklohna quit (Ping timeout: 246 seconds)
18:02:11*nc-x quit (Remote host closed the connection)
18:11:20FromDiscord<Kaynato> https://github.com/nim-lang/Nim/issues/12852
18:11:23disbotMalformed C code produced @11Kaynato; snippet at https://play.nim-lang.org/#ix=23TL
18:11:35FromDiscord<Kaynato> Links the wrong snippet 😒
18:11:57YardanicoBecause you should've embedded the code directly in the issue :)
18:12:22FromDiscord<Kaynato> Ahh, the size really isn't a problem?
18:12:44aeverr[m]its an issue, not a message
18:13:17FromDiscord<Kaynato> Alright then, edited the issue
18:13:42Yardanicoyou can also add nim code highlighting by using ```nim instead of just ```
18:13:58Yardanicoactually I did that for you :)
18:14:10FromDiscord<Kaynato> Ah, thank you! Sorry about that
18:14:17Yardanicodon't worry, it's just a small nitpick :P
18:14:26*nc-x joined #nim
18:14:31FromDiscord<Kaynato> It feels like using concept and ref object together in any sort of way leads to disaster
18:15:10nc-xaraq narimiran: no plans for community survey 2019?
18:15:32narimirannc-x: it is already created, we just haven't released it yet
18:15:39nc-xKaynato: well... there is a reason concepts are experimental :)
18:15:50nc-xnarimiran: 👍🏻
18:17:42nc-xand concepts has a new rfc, so fixing bugs in the current implementation would probably be low priority as of now. though i think internals may not change much with the rfc.
18:18:48*Boko_daddd joined #nim
18:20:09FromDiscord<Kaynato> That makes sense. I did see that RFC and am definitely excited for it.
18:20:48*nc-x quit (Remote host closed the connection)
18:21:03*clyybber joined #nim
18:27:23*Boko_daddd quit (Read error: Connection reset by peer)
18:29:48krux02Kaynato: You are triggering something in me. You way of understanding tuples vs objects is wrong, I guess the tutorials still contain misinformation
18:30:11krux02you should almost always prefer objects over tuples
18:30:20krux02because they have a type symbol
18:31:13disruptekalso notice that no one every replaces an object with a tuple. invariably, when performing maintenance, you "upgrade" tuples to objects.
18:35:32FromDiscord<Kaynato> Mhm. As expected, trying to "downgrade" wasn't remotely alright in the slightest, sorry
18:35:38FromDiscord<Kaynato> I am a bit desperate
18:36:17FromDiscord<Kaynato> I was about to include a type symbol in a distinct tuple ..... before I stopped myself
18:36:26disruptekis the problem explained in #12852?
18:36:30disbothttps://github.com/nim-lang/Nim/issues/12852 -- 3Malformed C code produced with generic concepts and ref object @11Kaynato; snippet at 12https://play.nim-lang.org/#ix=23TT
18:36:55FromDiscord<Kaynato> As in what I am seeking to do?
18:37:42disruptekyep.
18:39:04*NimBot joined #nim
18:39:19*gmpreussner quit (Ping timeout: 265 seconds)
18:40:36disrupteksame same but fewer `ref` gymnastics: https://play.nim-lang.org/#ix=23TU
18:40:56disruptekyou don't really need to make a distinction between refs and normal objects most of the time.
18:42:33*gmpreussner joined #nim
18:42:44FromDiscord<Kaynato> For anything which implements a node-expansion function, it should be possible to implement an ordering which traverses the nodes from some root according to the expansion function. The ordering itself should be generalizable (e.g. by breadth, by depth, with heuristic, etc.) but as it might contain additional information, for example a heuristic measure on the node-type in the case of A*, it should be somehow instantiated. At that point, I
18:43:59FromDiscord<Kaynato> Using the typedescs here is just a stand-in for now, but I want to do something like AStar(heuristic).pathTo(tree, start, goal)
18:44:25FromDiscord<Kaynato> Ideally, tree.by(AStar(heuristic)).pathTo(start, goal)
18:44:34disrupteki just don't understand how your AnyTree works. you are matching V to a tuple...
18:45:33disruptek...but leaves doesn't seem to take a tuple as input.
18:45:42FromDiscord<Fern & Simula (They/Them)> i think i broke something. im sure my code is broken but uhh, i didnt expect that error message https://pastebin.com/5nUxxYuk
18:46:01FromDiscord<Kaynato> The only tuple in that snippet is passed to the BreadthOrder for the sake of tracking the level of the node in the search
18:46:46disruptekfern: there's some kinda broken `$` for Lock. use repr, or something.
18:47:05Yardanicowell, a C compiler error is always worth creating an issue :P
18:47:14FromDiscord<Kaynato> Which is a bit of a messy solution, honestly, but it seems even messier to say, create DepthTrackingBreadthOrder and the like for each plausible ordering
18:47:58disruptekexpand is a proc that returns a tuple that matches the generic of BreadthOrder.
18:48:15disruptekexpand has a transform proc, rather.
18:48:20disruptekit takes a transform proc.
18:49:21FromDiscord<Kaynato> Yes. Expand takes a transform proc since the ordering might be on something other than just the node itself (a messy stand-in for now)
18:49:44FromDiscord<Kaynato> I had a transform-less expand proc on local but it isn't used in this error
18:50:42disruptekokay, i'm starting to get it.
18:58:37Araqhttps://github.com/nim-lang/Nim/pull/12823 it's green
18:58:38disbotARC: cycle detector 👑11Araq
18:59:13sealmove🎉
18:59:18Yardanico📦
18:59:19Araqnow I only need to write actual cycle tests and add optimizations...
18:59:46*sealmove quit (Quit: WeeChat 2.6)
19:02:15FromDiscord<Fern & Simula (They/Them)> ootl: is ARC a better GC?
19:02:23Yardanicobest GC in the world :P
19:03:51FromDiscord<Fern & Simula (They/Them)> awesome :)
19:03:57*krux02 quit (Remote host closed the connection)
19:04:23*luis_ quit (Quit: luis_)
19:07:33AraqConjecture: 'a = b' cannot create a cycle if 'b' is a new() expression.
19:07:48disruptekfair point.
19:08:14AraqConjecture: 'a = b' cannot create a cycle if 'b' cannot alias a.
19:08:42FromDiscord<yewpad> Is there some documentation on concepts, like with code examples etc.? Still don't understand them
19:09:01Araqit's covered in the experimental manual
19:09:10Araqand we have tests in tests/concepts
19:09:34*adeohluwa joined #nim
19:16:32FromDiscord<yewpad> At a first glance, I find the syntax to be somewhat confusing
19:16:41FromDiscord<yewpad> the syntax for concepts in particular
19:19:49FromDiscord<yewpad> Like, I get that the 'a' from this declaration `type
19:19:49FromDiscord<yewpad> Comparable = concept a` refers to the instance of the concept so you can work with it
19:20:13FromDiscord<yewpad> But how does this expression: `(a < a) is bool` correlate to this procedure? `proc myMax(a, b: Comparable): Comparable =`
19:20:52AraqTake a number and get in line.
19:21:08FromDiscord<yewpad> ?
19:21:17disruptekconcepts are experimental and under development.
19:21:22disruptekthey do not satisfy all users.
19:22:04Araqhttps://github.com/nim-lang/RFCs/issues/168
19:22:04FromDiscord<yewpad> It is not about being satisfied. As long as it works and does the job it is meant to do I'm fine with that. I just don't understand it. That doesn't imply that I don't like it
19:22:06disbotConcepts and type-checking generics 👑11Araq; snippet at https://play.nim-lang.org/#ix=23U8
19:22:31disruptekthe point is that the design isn't without flaws.
19:23:22*adeohluwa quit (Remote host closed the connection)
19:23:54Araq`(a < a) is bool` means you need a '<' proc
19:24:15Araqso your myMax requires the involved type to offer '<'
19:24:23FromDiscord<yewpad> A proc that overrides the '<' operator
19:24:24Araqnot sure what else to say
19:24:38Araqnot override. provide.
19:24:59Araqints have < and there is no need to override system.< for ints
19:25:09*nsf quit (Quit: WeeChat 2.6)
19:25:15FromDiscord<yewpad> Oh I get it
19:25:23*vivus joined #nim
19:25:53*tklohna joined #nim
19:29:08FromDiscord<yewpad> I don't know when concepts are supposed to get finally included, like being released, but I sure do hope that the syntax get's an overhaul because that's just straight up confusing. I'm not saying that I don't like it, I'm just saying "Dude, this may actually cause a whole lot of confusion" because we read more code than we write
19:29:40YardanicoWell, I've used some concepts in the past when they weren't experimental (before 1.0) and the syntax is quite understandable IMO
19:29:49*Kaynato joined #nim
19:29:58Yardanicoyou just write the things that should be implemented by the type to satisfy that concept
19:30:02*mibr quit (Remote host closed the connection)
19:32:09FromDiscord<yewpad> Yeah, I think the opinions quite differ here. I don't actually want to discuss this because this may just cause a big war on what is readable and what not etc. and that's just wasted energy
19:32:38Yardanicosome people even hate indentation-based syntax for some ideological reasons :P
19:32:39disrupteknot really; confusion from illegible code wastes much more energy.
19:32:59clyybberyewpad: Its actually really simple. IMO it just needs to be explained better.
19:33:03FromDiscord<yewpad> I was about to send in an image and to ask you to explain to me what this concept thingy means
19:33:30FromDiscord<yewpad> Well, explaining it is one thing but code should mostly speak for itself without a whole lot of documentation
19:33:41clyybberIt should be explained as: When the body of the concept compiles for a type T than that type T *is*/matches that concept
19:33:51FromDiscord<yewpad>
19:33:51FromDiscord<yewpad> https://cdn.discordapp.com/attachments/371759389889003532/653318340449796106/unknown.png
19:33:56FromDiscord<yewpad> Yeah
19:33:57FromDiscord<yewpad> Gotcha
19:35:04FromDiscord<yewpad> Somebody please explain me this concept. Just line by line
19:35:04FromDiscord<yewpad> https://cdn.discordapp.com/attachments/371759389889003532/653318640166240262/unknown.png
19:35:10FromDiscord<yewpad> I really would like to understand it
19:35:11clyybberyewpad: I can't think of any other syntax that would be as powerful as the current one
19:35:16FromDiscord<yewpad> But i can't figure it out by myself
19:35:29clyybberyewpad: Ok, I'll explain:
19:35:40disruptekdiscord attachments are practically illegible for me.
19:35:45AraqI can't imagine to live the existing syntax to remain forever, it's just too messy.
19:35:51Araq*live with
19:36:03Kaynatothe concept Stack[T] matches some type for which is defined:
19:36:14clyybberoh, well too many people explaining
19:36:20Kaynatoah, sorry, go ahead
19:36:22clyybberdo you want to go ahead Kaynato :?
19:36:25clyybberlol
19:36:38Araqok guys, how can I draw ascii art graphs?
19:37:03AraqI know you have emacs plugins for it, but I'm a poor vscode user
19:37:27KaynatoI found https://ascii-uml.github.io/
19:37:38Kaynatowait, this is useless
19:37:44clyybberAraq: http://asciiflow.com/
19:37:52Zevvor ditaa
19:37:54Yardanicowhat about https://textik.com ?
19:37:54Araqok thanks
19:38:42KaynatoOk, so yewpad, a type SomeType[T] would match Stack[T] if there existed
19:39:01Kaynatoproc pop[T](s: SomeType[T]): T
19:39:14Kaynatoproc push[T](v: var SomeType[T], value: T)
19:39:23Kaynatowell, honestly these don't need to be procs, sorry
19:39:33*FromGitter quit (Read error: Connection reset by peer)
19:39:46Kaynatobasically everything in the concept body, as said before, should compile for the type you match, whether it be via proc or template or what have you
19:39:52*FromGitter joined #nim
19:40:06clyybberto continue, there must also be a:
19:40:21clyybberlen proc template or macro which returns and ordinal
19:40:40clyybberand an items iterator that yields T
19:41:19Kaynatoand the difference between s and v in the body is to distinguish which things must compile for just SomeType[T] or var SomeType[T]
19:41:27Kaynatothat's all there is to that example
19:41:35clyybberYeah
19:41:44*narimiran quit (Ping timeout: 276 seconds)
19:41:51Araqyes but notice how Kaynato translated it back into proc header syntax...
19:42:11Araqif that's not an indication what the syntax should be like then I dunno what is
19:42:18KaynatoI do think that header syntax is the least ambiguous
19:42:35clyybberAraq: Its the same thing as if I call a proc, I need to know it exists
19:43:00clyybberAnd how its header looks to understand what I do
19:43:20disruptekbut that's a limitation you're adding to dispatch, isn't it?
19:43:34Kaynatothe only question is if you would allow proc header syntax to match, say, templates and macros
19:44:05FromDiscord<yewpad> tbh, I always felt like "Nim, a lotta easy than everything else I currently know of" like I came from Rust and was so happy to not mentally track anything anywhere anymore, which lifetimes existed, where they started and stopped etc... And now I read about concepts, was happy to have some form of "interface(s)" and they seem so complicated etc. that I rather prefer to avoid them and do copy paste because copy paste is cheap and easy
19:44:59*tklohna quit (Ping timeout: 276 seconds)
19:45:11Araqno need for copy&paste either, Nim's generics don't need concepts, you can simply avoid concepts without any of these tradeoffs
19:45:24Yardanico@yewpad Well, nim has a lot of advanced features and tutorial/manual specifically tells you to not use them unless you really need to
19:45:24FromDiscord<yewpad> Yeah, generics have done the job so far
19:45:24disruptekright.
19:45:28FromDiscord<yewpad> forgot to mention that
19:46:45YardanicoI wonder why this is written after "Case-Of Macro" though - https://nim-lang.org/docs/manual.html#macros-caseminusof-macro
19:46:49Yardanico"Style note: For code readability, it is the best idea to use the least powerful programming construct that still suffices. So the "check list" is:"
19:47:02Yardanicoconcepts aren't even mentioned in that list lol :P
19:47:36FromDiscord<yewpad> `put(var db, KeccakHash, string) is bool` what does that 'is bool' mean? Is the proc required to return a bool?
19:47:38Yardanico@yewpad, also, you can implement interface-like objects without any concepts - see https://github.com/nim-lang/Nim/blob/version-1-0/lib/pure/streams.nim#L107
19:47:46Yardanico@yewpad return value of that put proc is bool
19:47:47clyybberyewpad: Exactly
19:49:09FromDiscord<yewpad> That's what I meant. It so unusual to say 'is bool' because everyone is used to the `proc x(): bool` syntax. I know that the `is bool` thingy is related to the either compiler's or the syntax's "limitations" but idk
19:49:26Yardanicowell, it's because you specify the requirements
19:49:37Yardanicoso you basically say "that proc should return bool"
19:49:46*luis_ joined #nim
19:49:53Araqclyybber: any progress?
19:49:54Yardanicoat least that's how I see it
19:51:12clyybberclyybber: currently figuring out where I disable the initialization in the backend
19:51:22clyybberSo I can make it explicit in injectdestructors
19:51:38clyybberAraq: meant to tag you, not myself lol
19:52:14FromDiscord<yewpad> I'm gonna stop now. I was just wondering about concepts. Just one last note: Nim's syntax has been straightforward ever since. It's easy to understand. The concept syntax is not straightforward. It is confusing and I know that you mentioned that it should only be used when absolutely necessary but that doesn't change the fact
19:52:42Yardanicowell, I guess different people have different opinions, I understand that :)
19:52:56YardanicoI'm just saying that personally I wasn't really confused by concept syntax
19:53:16*njoseph quit (Ping timeout: 265 seconds)
19:53:20Yardanicomaybe because I didn't have a lot of experience with languages like Java or C++ to start with :P
19:55:04clyybberI don't have any problem with the syntax either
19:55:40FromDiscord<yewpad> Yeah, but you two gentlemen are not the majority. Just saying
19:55:48clyybberyewpad: Ummm
19:56:15KaynatoNo problem with the syntax on my end either, moreover with errors resulting from the implementation :/
19:56:52clyybberyewpad: We don't know who is the majority, but in the sample of IRC users who have expressed their opinion, clearly we are the majority
19:56:54clyybber3 vs 1
19:56:59YardanicoXD
19:57:13Yardanicodemocracy at its finest
19:58:13Kaynatotrying to figure out a nice way to use compile-time expansion to achieve TreeOrder.treeAlgo(tree, params)... via static enum matching into templates
19:58:23KaynatoI'm not sure if this is advised at all
19:59:49clyybberKaynato: Care to elaborate?
20:01:03KaynatoA tree/graph algorithm, say, to find the path between two nodes, requires a way to traverse through the tree - e.g. by depth or breadth or by heuristic as in the case of A*
20:01:30KaynatoI want to be able to use notation such as AStar(heuristic).findPath(tree, start, end)
20:01:50KaynatoOr BreadthOrder.findDepth(tree, root, node)
20:01:59clyybberAh, gotcha.
20:04:34clyybberKaynato make treeAlgo's first param a static enum?
20:05:05KaynatoYep, that's what I'm trying right now
20:06:25Kaynatothat doesn't exactly work for treeorders that take parameters, hm
20:06:41*Hideki_ quit (Ping timeout: 268 seconds)
20:07:51KaynatoWhat I had been trying to do earlier with concepts was to have some concept TreeOrder so I could implement BreadthOrder.treeAlgo with a template on a static enum that returns a TreeOrder, and AStar(heuristic) being a proc that returns a TreeOrder
20:09:14KaynatoMaybe then TreeOrder(tree, orderParams).treeAlgo(params) would make more sense?
20:11:45Kaynato(by "returns a TreeOrder" I mean that it returns a type which matches the TreeOrder concept)
20:25:19*Trustable quit (Remote host closed the connection)
20:26:09*luis_ quit (Read error: Connection reset by peer)
20:27:39KaynatoOh, it turns out I'm basically trying to implement a visitor pattern.
20:30:36*clyybber quit (Ping timeout: 240 seconds)
20:33:08*njoseph joined #nim
20:37:06*tane quit (Quit: Leaving)
20:48:35*clyybber joined #nim
21:04:48Araqclyybber: what's the question again? what do you need, 'var x = undef' or 'always skip initialization'?
21:05:48clyybberclyybber: I want to use the dfa to elide initialization.
21:06:32clyybberSo I make initialization explicit in injectdestructors and want to skip initialization in the backend
21:06:47clyybberAraq: Damnit, why do I keep taggin myself
21:06:53Araqthe idea was to produce 'var x = default(T)' and disable the backend logic altogether
21:07:06clyybberYeah, thats what I want to do
21:07:10Araqthere is still disabled code for that
21:07:23clyybberAraq: Yeah in injectdestructors, I'm building on that
21:07:47Araqnice
21:08:39Araqthe backend changes are easy too because the logic already exists for sfNoInit
21:08:49Araqin fact, you can set this flag for the sym
21:08:52clyybberAh, great!
21:08:59clyybberThanks
21:09:00Araqand don't have to modify the backend then
21:10:08Araqso .. this cycle algorithm is a work of a genius, whatever I through at it, it works
21:10:21Araqwell, hardly anything works but these are my own bugs
21:10:37Araqthe algorithm itself seems to be correct
21:11:14Araqin the past I had a bad experience with these, they were often wrong :P
21:11:24FromDiscord<Rhett> hey, is there any seek function that makes use of the FileSeekPos enum?
21:12:22disruptekit's nice when software finally gels into something robust.
21:15:10Araqclyybber: watch out about skResult, it's subtle, we often generated f(&x) for x = f() (NRVO) and then you need to destroy result in the body first or rather keep the =sink operation
21:21:55Araqdisruptek: about https://github.com/nim-lang/Nim/pull/12853/files ... please add a .since annotation
21:21:57disbotadd a StringTable.clear that requires no mode specification 🧚11disruptek
21:22:04disruptekokie.
21:24:13disrupteki should have thought of that.
21:31:02lqdev[m]Araq: is .since documented somewhere?
21:32:08FromGitter<bung87> what’s the simple way to exchange two variable value?
21:33:40Yardanicolike in most other languages?
21:34:00FromGitter<bung87> like operator or some sugar
21:34:32YardanicoYou can create one of course, but AFAIK it's not there by default
21:34:52*lritter quit (Ping timeout: 268 seconds)
21:35:00FromGitter<bung87> hmm sure
21:35:50Yardanicojust a simple example https://play.nim-lang.org/#ix=23UX
21:36:05Yardanicoor you can make it a template, rename the proc to `swap` and use it like swap a, b
21:36:14Yardanicothere's a lot of ways of doing things like this in Nim :)
21:36:28Araqsystem.swap
21:36:36Araqit's a builtin, please use it
21:37:15Araqthe compiler understands it and can optimize it in ways that are otherwise quite hard to do
21:37:21Yardanicoguess I've never used it so I didn't know it exists :(
21:38:09Araqlqdev[m]: it is new
21:38:59YardanicoAraq: by the way, is arc gc supposed to become the default GC over time (not in a month of course, but over 0.5 - 2 years maybe)?
21:39:00Araqhttps://github.com/nim-lang/Nim/blob/devel/lib/system/inclrtl.nim#L52
21:41:09FromGitter<bung87> ah,very nice!
21:49:07AraqYardanico: maybe, the 'owned ref' stuff is still more elegant
21:55:50*Jjp137 quit (Read error: Connection reset by peer)
22:03:31*Hideki_ joined #nim
22:06:19*ltriant joined #nim
22:08:07*Hideki_ quit (Ping timeout: 265 seconds)
22:25:10KaynatoFinally, success. Thank goodness for compile-time dispatch tables. https://play.nim-lang.org/#ix=23Vb
22:31:06clyybberAraq: mNewFinalize isn't used with the new runtime right?
22:31:24Araqit's not supported
22:31:45clyybberNice, because handling it would be a PITA
22:31:50Araqtried to make it work, but I regarded it to be too dangerous
22:32:02clyybberWhats its purpose anyways?
22:32:05FromGitter<bung87> @Kaynato why you call it “compile-time dispatch tables” ? it’s “tree data struct” to me
22:33:28KaynatoThe functable lets me use init to return the according type so that the ordered tree algorithms can be used with the call format so desired
22:33:32clyybberAraq: A finalizer is conceptually equivalent to an `if refcount = 0` in a =destroy(ref T), is that right?
22:33:49clyybberIn that it gets called when the object gets destroyed?
22:34:05Araqyeah, well. it's not deterministic in a GC setting
22:34:16clyybberYeah
22:34:55FromGitter<bung87> em, I dont get it, forget it- -
22:35:22Kaynatobung87: Compile-time visitor pattern in nim, implemented with Trees as an example
22:35:25Kaynatoah sorry
22:37:14Araqnice, if it weren't for the fact that the visitor pattern is an abomination
22:37:34Araq;-)
22:37:52FromGitter<bung87> wow, I starting understand
22:39:04Araqpattern matching beats it. you can ask Martin Odersky himself if you don't believe me
22:42:16*Araq said and went on dealing with the visitor pattern in his new GC because nothing else would have worked
22:44:46*sagax quit (Remote host closed the connection)
22:45:41*solitudesf quit (Ping timeout: 276 seconds)
22:45:56disruptek"set is too large" means i have some >16bit elements in it, right?
22:46:06disruptekballs.
22:46:30clyybberballers.
22:46:52Araqif only Nim also had a hash set implementation somewhere in its stdlib
22:46:58disrupteki know, right?
22:51:25clyybberAraq: Umm, is injectDestructor called for code executed in the VM?
22:51:38Araqnope
22:52:06clyybberHmm.
22:52:07Araqthe VM isn't ready for this madness
22:52:21disruptekyou can't handle the truth!
22:53:18*vivus quit (Quit: Leaving)
22:53:50disruptekError: complex statement requires adult supervision
22:56:51clyybberAraq: That kinda sux, because I insert defaultCalls in injectdestructors but won't in the VM.
22:56:59clyybberAnd thats problematic for default fields..
22:57:34clyybberI think I'm gonna seperate default fields from the other optimizations for now and will integrated default fields later once the VM is ready.
22:59:18clyybberAh, nevermind. It should work when I leave them in transf
23:05:15disruptekthe jack putter machine, zero defects.
23:05:21disruptekgod help us.
23:06:17disrupteknimph is now 5700 lines to nimble's ~5400. this is bad, man.
23:11:48Araq:D
23:11:58Araqthat means it does more than Nimble
23:12:23federico3-_-
23:14:42disruptek128,199 lines including deps (but not including libgit).
23:14:51disruptekor the compiler, fwiw.
23:15:02disruptekbananas. github is 26k.
23:18:08dom96That implies Nimph is already more complex than Nimble :P
23:18:44*nextloop quit (Quit: WeeChat 2.1)
23:20:11disruptekit's been a long month.
23:22:23disruptekdom96: what do you think about caret/tilde/wildcard support in nimble?
23:22:44dom96I'd love to have it
23:22:56disruptekenough to impl it?
23:24:08dom96possibly. Although I'll be focusing my Christmas holidays on other personal projects.
23:24:20dom96supporting that in Nimble should be simple
23:24:53dom96just a case of having enough motivation
23:25:11disrupteki get it.
23:25:22disruptekwell, there a reference impl you can look at, if it helps.
23:25:53disruptekditto lockfiles, fwiw.
23:40:16FromGitter<bung87> does js backend quality equals to c backend?
23:43:12FromGitter<bung87> I write a tool, all tests passed in c , but js will throw error first test
23:53:15*Jjp137 joined #nim
23:54:15FromGitter<bung87> https://github.com/bung87/datetime_parse the code gen is over 6000 lines , I can’t really tell where the problem about.