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:01 | FromDiscord | <exelotl> is this a bug? https://play.nim-lang.org/#ix=23Qq |
02:21:16 | FromGitter | <Varriount> exelotl: Either a bug, or simply an ambiguity the compiler doesn't like |
02:50:28 | FromDiscord | <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:13 | FromDiscord | <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:52 | FromDiscord | <exelotl> ouch I spent way too long on advent of code |
03:01:12 | FromDiscord | <exelotl> closures created inside loops do not work how I expected them to :( |
03:05:42 | FromDiscord | <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:13 | FromDiscord | <Kaynato> It makes complete sense if you consider that it's an inline iterator |
03:40:13 | FromDiscord | <Kaynato> try making the inner proc do let v=i; return i |
03:43:01 | FromDiscord | <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:23 | FromDiscord | <Kaynato> just encountered a particularly interesting out of memory during compilation... nim rapidly blew up to eat the entire RAM |
04:17:50 | FromDiscord | <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:16 | FromDiscord | <Kaynato> Oh, that's fun. Nim code that generates a c compiler error |
04:55:31 | FromDiscord | <treeform> bug track it |
04:55:38 | FromDiscord | <Kaynato> https://gist.github.com/Kaynato/ec1dfc0cbde10c0aab9f2b87bddaa4cd |
04:55:46 | FromDiscord | <treeform> Nim community is surprisingly good at fixing bugs |
04:56:12 | FromDiscord | <treeform> that looks like a tough one |
05:01:34 | FromDiscord | <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:06 | FromDiscord | <Kaynato> God, messing with this in any way almost always manages to lead to a gcc error |
05:14:11 | FromDiscord | <treeform> macros? |
05:21:41 | FromDiscord | <Kaynato> concepts and generic inference |
05:21:52 | FromDiscord | <Kaynato> * and inheritance |
05:28:58 | FromDiscord | <Kaynato> Here we are: https://github.com/nim-lang/Nim/issues/12841 |
05:29:00 | disbot | ➥ Code causing nimc OOM or producing gcc syntax error @11Kaynato; snippet at https://play.nim-lang.org/#ix=23QO |
05:29:56 | FromDiscord | <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:06 | FromDiscord | <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:27 | FromDiscord | <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:46 | FromDiscord | <mratsim> I'm especially impressed by the ability of people to produce minimal working examples |
09:27:26 | * | filcuc joined #nim |
09:28:07 | FromDiscord | <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:17 | aeverr[m] | kptr, no i dont think so |
09:57:00 | * | ng0 joined #nim |
09:58:27 | lqdev[m] | @krptr, yeah, just create another template that calls your desired template |
09:59:00 | lqdev[m] | templates are not runtime things, so you can't store them in consts/variables |
10:00:08 | lqdev[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:52 | FromDiscord | <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:13 | FromDiscord | <mratsim> why don't you just call notice("foo")? |
10:13:30 | FromDiscord | <mratsim> yes, you can open an issue for the compiler error |
10:13:36 | FromDiscord | <mratsim> the compiler should never crash |
10:13:54 | FromDiscord | <krptr> @mratsim this was a minimal example for the sake of the error |
10:13:59 | FromDiscord | <mratsim> ah I see |
10:14:26 | FromDiscord | <mratsim> the way to declare aliases are template, though there was some proposal to create an "alias" statement |
10:14:43 | FromDiscord | <mratsim> maybe there is even one in the sugar module |
10:14:48 | lqdev[m] | gosh, please no more keywords |
10:15:10 | lqdev[m] | I'm already hurt because `end` is a keyword and it's unused |
10:23:33 | matic | Hi, how do you overload `[]` and `+=`/`-=` simultaneously for an array type? |
10:23:39 | FromDiscord | <krptr> ok, reported, thanks @mratsim |
10:24:33 | * | dwdv joined #nim |
10:24:55 | * | nim_noob joined #nim |
10:26:20 | aeverr[m] | matic, any reason you cant do it with 3 procs |
10:27:11 | aeverr[m] | lqdev, does editing in matrix work well with irc? |
10:28:13 | aeverr[m] | whatever, ill test it. Test |
10:28:16 | aeverr[m] | * whatever, ill test it. |
10:28:27 | aeverr[m] | i see |
10:29:32 | matic | aeverr: Yeah sure, how? Because `[]` returns an uint8, `+=` throws "but expression 'arr[i]' is of type: uint8". |
10:30:00 | lqdev[m] | aeverr: editing is actually a riot.im feature, it's not defined in the matrix protocol |
10:30:17 | lqdev[m] | but yeah as you observed it just prepends * to your edited message |
10:31:04 | lqdev[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:57 | aeverr[m] | ooooh i see. that's kinda ass |
10:36:17 | aeverr[m] | i'd move client but windows clients is either this, that one gtk one, or the cli one |
10:37:00 | aeverr[m] | matic, i think you have to make a `[]=` proc |
10:37:37 | Zevv | Hmmm, these annoying inconsistencies... `(0..3).mapIt(it)` is ok but `(0..3).map(it => it)` does not compile |
10:37:43 | aeverr[m] | huh thats odd, \`\` is escaped for irc to matrix |
10:37:57 | aeverr[m] | zevv, did you import sugar |
10:38:40 | aeverr[m] | also i think its because mapit is a template, prolly does some other black magic |
10:38:46 | aeverr[m] | call toSeq on the range |
10:38:47 | aeverr[m] | maybe? |
10:40:17 | nim_noob | Hey 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:17 | nim_noob | ld 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:18 | nim_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:24 | nim_noob | Well, the message has just messed up... |
10:41:52 | nim_noob | Anyway, 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:22 | nim_noob | However, I cannot report this issue on GitHub 'cause I do not want to have an account there |
10:42:26 | Zevv | aeverr[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:32 | Zevv | and felt like whining about it a bit |
10:43:30 | aeverr[m] | ah i thought you didnt |
10:43:56 | Zevv | :) |
10:44:14 | aeverr[m] | nim_noob, any reason for the dislike of creating a github account :V |
10:46:09 | nim_noob | aeverr[m], I just don't need it - Gitea all the way |
10:47:47 | matic | aeverr: I made a small example: https://play.nim-lang.org/#ix=23RH |
10:48:04 | matic | How do I make the last line work? |
10:49:34 | aeverr[m] | hmm im looking into it |
10:50:02 | matic | thanks |
10:50:39 | Zevv | arr[5] = arr[5] + 0x01 |
10:51:40 | Zevv | or add your own `+=` for your type |
10:52:12 | * | Hideki_ quit (Remote host closed the connection) |
10:52:34 | matic | Zevv: "add your own `+=` for your type", how do I do that as `[]` is already overloaded? |
10:52:36 | aeverr[m] | if its just numerically 1 you can use inc |
10:53:10 | matic | aeverr: that's just an example, in my real code there are larger values. |
10:54:36 | aeverr[m] | personally, i'd use a name. not `+=`. but thats me, ill continue thinking for now |
10:54:42 | aeverr[m] | i dont think its possible tbh |
10:54:47 | aeverr[m] | because of how the code is parsed |
10:57:01 | matic | Ok, good to know. Thanks for the information. |
10:57:23 | * | luis_ joined #nim |
10:58:59 | luis_ | 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:44 | nim_noob | Is there any way to unflag '-z'? |
11:04:19 | Araq | luis_: 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:30 | Araq | PMunch knows more when he is around |
11:06:34 | luis_ | 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:39 | nim_noob | So, with ' --passL:OPTION' I can pass an option to the linker, but how can I pick the '-z' option out? |
11:18:29 | aeverr[m] | ping Araq maybe plsdontkillmeoholyone |
11:19:33 | planetis[m] | matic: you need a second overload for `[]` that has this signature: ```proc `[]`*(self: MyArray, i: int): var uint8``` |
11:20:19 | aeverr[m] | `Error: overloaded '[]' leads to ambiguous calls` |
11:20:35 | aeverr[m] | you cant overload if they have the same argument signature |
11:20:44 | aeverr[m] | its either non-var or var |
11:21:27 | * | luis_ quit (Ping timeout: 250 seconds) |
11:21:55 | nim_noob | Or can I specify a linker somehow? |
11:22:52 | planetis[m] | try this: ```proc `[]`*(self: var MyArray, i: int): var uint8``` |
11:23:54 | aeverr[m] | matic: ^ this works |
11:24:19 | * | krux02 joined #nim |
11:25:22 | matic | planetis, aeverr: Excellent, thank you! |
11:25:45 | aeverr[m] | TIL too, nice |
11:26:09 | aeverr[m] | man, nim is so insane |
11:27:22 | * | kungtotte joined #nim |
11:38:09 | * | luis_ joined #nim |
11:41:32 | nim_noob | nim.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:22 | nim_noob | I 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:00 | nim_noob | And the 2nd one is in "/usr/x86_64-w64-mingw32/bin/ld" |
11:45:24 | nim_noob | Is that even OK? |
11:48:22 | * | nsf joined #nim |
11:48:43 | lqdev[m] | what does -z even to? |
11:48:47 | lqdev[m] | s/to/do |
11:49:36 | lqdev[m] | and afaik /usr/bin/x86_64-w64-mingw32-ld should be a symlink to /usr/x86_64-w64-mingw32/bin/ld |
11:54:26 | nim_noob | lqdev[m], what is, "-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"? |
11:55:42 | nim_noob | It 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:42 | nim_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:11 | nim_noob | I guess these are the flags for the linker |
11:56:52 | nim_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:16 | nim_noob | And 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:34 | nim_noob | But common ld has got it: https://linux.die.net/man/1/ld |
12:03:39 | nim_noob | So idk |
12:03:46 | nim_noob | What the problem is |
12:04:25 | nim_noob | And idk if only I have got the issue |
12:05:04 | nim_noob | Does Win cross-compilation works properly on Linux? |
12:05:58 | nim_noob | Oh, I need to chill out |
12:11:33 | * | tklohna joined #nim |
12:11:42 | luis_ | Araq: what about https://github.com/yglukhov/nimx ? Looks promising? |
12:12:23 | aeverr[m] | that face is so intimidating... |
12:16:46 | Araq | luis_: nimx is good too but iirc doesn't use native widgets and is more focussed on gamedev |
12:17:22 | luis_ | ok, thanks |
12:18:23 | Araq | nim_noob: use a CI (travis, azure, appveyor) to build your software for Windows/linux |
12:18:38 | Araq | easier than the GCC cross compile toolchains IME |
12:23:55 | * | letto quit (Quit: Konversation terminated!) |
12:24:25 | * | letto joined #nim |
12:25:22 | nim_noob | I'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:17 | sealmove | wtf: Error: type mismatch: got <seq[myType]> but expected 'seq[myType]' |
13:15:32 | sealmove | this error is confusing, anyone can guess what's going on? |
13:16:25 | sealmove | I guess I shouldn't use "include" |
13:21:12 | * | nim_noob left #nim (#nim) |
13:21:55 | dom96 | yes, you shouldn't |
13:22:26 | dom96 | but that error should be improved as well |
13:23:35 | * | solitudesf joined #nim |
13:24:34 | * | njoseph joined #nim |
13:36:04 | FromDiscord | <mratsim> @Araq, How would you go to make "spawn" be discardable only if it returns Flowvar[void]? |
13:36:46 | FromDiscord | <mratsim> this way people wouldn't have to return a dummy bool to await a spawn |
13:41:28 | * | endragor joined #nim |
13:46:54 | FromGitter | <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:55 | FromDiscord | <mratsim> they are not |
13:48:08 | FromDiscord | <mratsim> only the ref + len are passed |
13:48:25 | FromDiscord | <mratsim> they have value semantics though, so copies are deep |
13:49:56 | FromGitter | <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:29 | Araq | mratsim: 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:31 | FromDiscord | <mratsim> in the current threadpool you get nothing |
15:32:37 | FromDiscord | <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:32 | FromDiscord | <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:33 | FromDiscord | <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:09 | FromDiscord | <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:55 | Araq | boy do I suck at bitops. silly mistakes |
17:16:41 | FromDiscord | <mratsim> try doing some cryptography or bigints for training 😉 |
17:17:16 | aeverr[m] | im still a firm believer that shift right and shift left are poorly named |
17:18:13 | FromDiscord | <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:41 | FromDiscord | <mratsim> in particular it breaks generic code that needs to iterate on multiple limbs of a bigints |
17:19:11 | FromDiscord | <mratsim> returning zero when the input is zero* |
17:19:42 | FromDiscord | <mratsim> they are named the same as the assembly instructions @aeverr |
17:20:17 | aeverr[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:50 | Zevv | Ha, Java also does --gc:none! https://blogs.oracle.com/javamagazine/epsilon-the-jdks-do-nothing-garbage-collector |
17:44:52 | FromDiscord | <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:39 | FromDiscord | <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:53 | FromDiscord | <treeform> I wish there was a way to override nim's std system functions from user code... |
17:51:21 | FromDiscord | <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:45 | FromDiscord | <Kaynato> time to pare this one down... ugh |
17:56:50 | FromDiscord | <Kaynato> Not again. https://play.nim-lang.org/#ix=23TG |
17:57:11 | aeverr[m] | F, good luck |
17:57:22 | FromDiscord | <Kaynato> I'm going to try avoiding ref object in its entirety and use tuple instead |
17:57:31 | Yardanico | don'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:20 | FromDiscord | <Kaynato> https://github.com/nim-lang/Nim/issues/12852 |
18:11:23 | disbot | ➥ Malformed C code produced @11Kaynato; snippet at https://play.nim-lang.org/#ix=23TL |
18:11:35 | FromDiscord | <Kaynato> Links the wrong snippet 😒 |
18:11:57 | Yardanico | Because you should've embedded the code directly in the issue :) |
18:12:22 | FromDiscord | <Kaynato> Ahh, the size really isn't a problem? |
18:12:44 | aeverr[m] | its an issue, not a message |
18:13:17 | FromDiscord | <Kaynato> Alright then, edited the issue |
18:13:42 | Yardanico | you can also add nim code highlighting by using ```nim instead of just ``` |
18:13:58 | Yardanico | actually I did that for you :) |
18:14:10 | FromDiscord | <Kaynato> Ah, thank you! Sorry about that |
18:14:17 | Yardanico | don't worry, it's just a small nitpick :P |
18:14:26 | * | nc-x joined #nim |
18:14:31 | FromDiscord | <Kaynato> It feels like using concept and ref object together in any sort of way leads to disaster |
18:15:10 | nc-x | araq narimiran: no plans for community survey 2019? |
18:15:32 | narimiran | nc-x: it is already created, we just haven't released it yet |
18:15:39 | nc-x | Kaynato: well... there is a reason concepts are experimental :) |
18:15:50 | nc-x | narimiran: 👍🏻 |
18:17:42 | nc-x | and 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:09 | FromDiscord | <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:48 | krux02 | Kaynato: You are triggering something in me. You way of understanding tuples vs objects is wrong, I guess the tutorials still contain misinformation |
18:30:11 | krux02 | you should almost always prefer objects over tuples |
18:30:20 | krux02 | because they have a type symbol |
18:31:13 | disruptek | also notice that no one every replaces an object with a tuple. invariably, when performing maintenance, you "upgrade" tuples to objects. |
18:35:32 | FromDiscord | <Kaynato> Mhm. As expected, trying to "downgrade" wasn't remotely alright in the slightest, sorry |
18:35:38 | FromDiscord | <Kaynato> I am a bit desperate |
18:36:17 | FromDiscord | <Kaynato> I was about to include a type symbol in a distinct tuple ..... before I stopped myself |
18:36:26 | disruptek | is the problem explained in #12852? |
18:36:30 | disbot | https://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:55 | FromDiscord | <Kaynato> As in what I am seeking to do? |
18:37:42 | disruptek | yep. |
18:39:04 | * | NimBot joined #nim |
18:39:19 | * | gmpreussner quit (Ping timeout: 265 seconds) |
18:40:36 | disruptek | same same but fewer `ref` gymnastics: https://play.nim-lang.org/#ix=23TU |
18:40:56 | disruptek | you 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:44 | FromDiscord | <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:59 | FromDiscord | <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:25 | FromDiscord | <Kaynato> Ideally, tree.by(AStar(heuristic)).pathTo(start, goal) |
18:44:34 | disruptek | i just don't understand how your AnyTree works. you are matching V to a tuple... |
18:45:33 | disruptek | ...but leaves doesn't seem to take a tuple as input. |
18:45:42 | FromDiscord | <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:01 | FromDiscord | <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:46 | disruptek | fern: there's some kinda broken `$` for Lock. use repr, or something. |
18:47:05 | Yardanico | well, a C compiler error is always worth creating an issue :P |
18:47:14 | FromDiscord | <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:58 | disruptek | expand is a proc that returns a tuple that matches the generic of BreadthOrder. |
18:48:15 | disruptek | expand has a transform proc, rather. |
18:48:20 | disruptek | it takes a transform proc. |
18:49:21 | FromDiscord | <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:44 | FromDiscord | <Kaynato> I had a transform-less expand proc on local but it isn't used in this error |
18:50:42 | disruptek | okay, i'm starting to get it. |
18:58:37 | Araq | https://github.com/nim-lang/Nim/pull/12823 it's green |
18:58:38 | disbot | ➥ ARC: cycle detector 👑11Araq |
18:59:13 | sealmove | 🎉 |
18:59:18 | Yardanico | 📦 |
18:59:19 | Araq | now I only need to write actual cycle tests and add optimizations... |
18:59:46 | * | sealmove quit (Quit: WeeChat 2.6) |
19:02:15 | FromDiscord | <Fern & Simula (They/Them)> ootl: is ARC a better GC? |
19:02:23 | Yardanico | best GC in the world :P |
19:03:51 | FromDiscord | <Fern & Simula (They/Them)> awesome :) |
19:03:57 | * | krux02 quit (Remote host closed the connection) |
19:04:23 | * | luis_ quit (Quit: luis_) |
19:07:33 | Araq | Conjecture: 'a = b' cannot create a cycle if 'b' is a new() expression. |
19:07:48 | disruptek | fair point. |
19:08:14 | Araq | Conjecture: 'a = b' cannot create a cycle if 'b' cannot alias a. |
19:08:42 | FromDiscord | <yewpad> Is there some documentation on concepts, like with code examples etc.? Still don't understand them |
19:09:01 | Araq | it's covered in the experimental manual |
19:09:10 | Araq | and we have tests in tests/concepts |
19:09:34 | * | adeohluwa joined #nim |
19:16:32 | FromDiscord | <yewpad> At a first glance, I find the syntax to be somewhat confusing |
19:16:41 | FromDiscord | <yewpad> the syntax for concepts in particular |
19:19:49 | FromDiscord | <yewpad> Like, I get that the 'a' from this declaration `type |
19:19:49 | FromDiscord | <yewpad> Comparable = concept a` refers to the instance of the concept so you can work with it |
19:20:13 | FromDiscord | <yewpad> But how does this expression: `(a < a) is bool` correlate to this procedure? `proc myMax(a, b: Comparable): Comparable =` |
19:20:52 | Araq | Take a number and get in line. |
19:21:08 | FromDiscord | <yewpad> ? |
19:21:17 | disruptek | concepts are experimental and under development. |
19:21:22 | disruptek | they do not satisfy all users. |
19:22:04 | Araq | https://github.com/nim-lang/RFCs/issues/168 |
19:22:04 | FromDiscord | <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:06 | disbot | ➥ Concepts and type-checking generics 👑11Araq; snippet at https://play.nim-lang.org/#ix=23U8 |
19:22:31 | disruptek | the point is that the design isn't without flaws. |
19:23:22 | * | adeohluwa quit (Remote host closed the connection) |
19:23:54 | Araq | `(a < a) is bool` means you need a '<' proc |
19:24:15 | Araq | so your myMax requires the involved type to offer '<' |
19:24:23 | FromDiscord | <yewpad> A proc that overrides the '<' operator |
19:24:24 | Araq | not sure what else to say |
19:24:38 | Araq | not override. provide. |
19:24:59 | Araq | ints have < and there is no need to override system.< for ints |
19:25:09 | * | nsf quit (Quit: WeeChat 2.6) |
19:25:15 | FromDiscord | <yewpad> Oh I get it |
19:25:23 | * | vivus joined #nim |
19:25:53 | * | tklohna joined #nim |
19:29:08 | FromDiscord | <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:40 | Yardanico | Well, 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:58 | Yardanico | you 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:09 | FromDiscord | <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:38 | Yardanico | some people even hate indentation-based syntax for some ideological reasons :P |
19:32:39 | disruptek | not really; confusion from illegible code wastes much more energy. |
19:32:59 | clyybber | yewpad: Its actually really simple. IMO it just needs to be explained better. |
19:33:03 | FromDiscord | <yewpad> I was about to send in an image and to ask you to explain to me what this concept thingy means |
19:33:30 | FromDiscord | <yewpad> Well, explaining it is one thing but code should mostly speak for itself without a whole lot of documentation |
19:33:41 | clyybber | It 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:51 | FromDiscord | <yewpad> |
19:33:51 | FromDiscord | <yewpad> https://cdn.discordapp.com/attachments/371759389889003532/653318340449796106/unknown.png |
19:33:56 | FromDiscord | <yewpad> Yeah |
19:33:57 | FromDiscord | <yewpad> Gotcha |
19:35:04 | FromDiscord | <yewpad> Somebody please explain me this concept. Just line by line |
19:35:04 | FromDiscord | <yewpad> https://cdn.discordapp.com/attachments/371759389889003532/653318640166240262/unknown.png |
19:35:10 | FromDiscord | <yewpad> I really would like to understand it |
19:35:11 | clyybber | yewpad: I can't think of any other syntax that would be as powerful as the current one |
19:35:16 | FromDiscord | <yewpad> But i can't figure it out by myself |
19:35:29 | clyybber | yewpad: Ok, I'll explain: |
19:35:40 | disruptek | discord attachments are practically illegible for me. |
19:35:45 | Araq | I can't imagine to live the existing syntax to remain forever, it's just too messy. |
19:35:51 | Araq | *live with |
19:36:03 | Kaynato | the concept Stack[T] matches some type for which is defined: |
19:36:14 | clyybber | oh, well too many people explaining |
19:36:20 | Kaynato | ah, sorry, go ahead |
19:36:22 | clyybber | do you want to go ahead Kaynato :? |
19:36:25 | clyybber | lol |
19:36:38 | Araq | ok guys, how can I draw ascii art graphs? |
19:37:03 | Araq | I know you have emacs plugins for it, but I'm a poor vscode user |
19:37:27 | Kaynato | I found https://ascii-uml.github.io/ |
19:37:38 | Kaynato | wait, this is useless |
19:37:44 | clyybber | Araq: http://asciiflow.com/ |
19:37:52 | Zevv | or ditaa |
19:37:54 | Yardanico | what about https://textik.com ? |
19:37:54 | Araq | ok thanks |
19:38:42 | Kaynato | Ok, so yewpad, a type SomeType[T] would match Stack[T] if there existed |
19:39:01 | Kaynato | proc pop[T](s: SomeType[T]): T |
19:39:14 | Kaynato | proc push[T](v: var SomeType[T], value: T) |
19:39:23 | Kaynato | well, honestly these don't need to be procs, sorry |
19:39:33 | * | FromGitter quit (Read error: Connection reset by peer) |
19:39:46 | Kaynato | basically 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:06 | clyybber | to continue, there must also be a: |
19:40:21 | clyybber | len proc template or macro which returns and ordinal |
19:40:40 | clyybber | and an items iterator that yields T |
19:41:19 | Kaynato | and 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:27 | Kaynato | that's all there is to that example |
19:41:35 | clyybber | Yeah |
19:41:44 | * | narimiran quit (Ping timeout: 276 seconds) |
19:41:51 | Araq | yes but notice how Kaynato translated it back into proc header syntax... |
19:42:11 | Araq | if that's not an indication what the syntax should be like then I dunno what is |
19:42:18 | Kaynato | I do think that header syntax is the least ambiguous |
19:42:35 | clyybber | Araq: Its the same thing as if I call a proc, I need to know it exists |
19:43:00 | clyybber | And how its header looks to understand what I do |
19:43:20 | disruptek | but that's a limitation you're adding to dispatch, isn't it? |
19:43:34 | Kaynato | the only question is if you would allow proc header syntax to match, say, templates and macros |
19:44:05 | FromDiscord | <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:11 | Araq | no need for copy&paste either, Nim's generics don't need concepts, you can simply avoid concepts without any of these tradeoffs |
19:45:24 | Yardanico | @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:24 | FromDiscord | <yewpad> Yeah, generics have done the job so far |
19:45:24 | disruptek | right. |
19:45:28 | FromDiscord | <yewpad> forgot to mention that |
19:46:45 | Yardanico | I wonder why this is written after "Case-Of Macro" though - https://nim-lang.org/docs/manual.html#macros-caseminusof-macro |
19:46:49 | Yardanico | "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:02 | Yardanico | concepts aren't even mentioned in that list lol :P |
19:47:36 | FromDiscord | <yewpad> `put(var db, KeccakHash, string) is bool` what does that 'is bool' mean? Is the proc required to return a bool? |
19:47:38 | Yardanico | @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:46 | Yardanico | @yewpad return value of that put proc is bool |
19:47:47 | clyybber | yewpad: Exactly |
19:49:09 | FromDiscord | <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:26 | Yardanico | well, it's because you specify the requirements |
19:49:37 | Yardanico | so you basically say "that proc should return bool" |
19:49:46 | * | luis_ joined #nim |
19:49:53 | Araq | clyybber: any progress? |
19:49:54 | Yardanico | at least that's how I see it |
19:51:12 | clyybber | clyybber: currently figuring out where I disable the initialization in the backend |
19:51:22 | clyybber | So I can make it explicit in injectdestructors |
19:51:38 | clyybber | Araq: meant to tag you, not myself lol |
19:52:14 | FromDiscord | <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:42 | Yardanico | well, I guess different people have different opinions, I understand that :) |
19:52:56 | Yardanico | I'm just saying that personally I wasn't really confused by concept syntax |
19:53:16 | * | njoseph quit (Ping timeout: 265 seconds) |
19:53:20 | Yardanico | maybe because I didn't have a lot of experience with languages like Java or C++ to start with :P |
19:55:04 | clyybber | I don't have any problem with the syntax either |
19:55:40 | FromDiscord | <yewpad> Yeah, but you two gentlemen are not the majority. Just saying |
19:55:48 | clyybber | yewpad: Ummm |
19:56:15 | Kaynato | No problem with the syntax on my end either, moreover with errors resulting from the implementation :/ |
19:56:52 | clyybber | yewpad: 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:54 | clyybber | 3 vs 1 |
19:56:59 | Yardanico | XD |
19:57:13 | Yardanico | democracy at its finest |
19:58:13 | Kaynato | trying 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:23 | Kaynato | I'm not sure if this is advised at all |
19:59:49 | clyybber | Kaynato: Care to elaborate? |
20:01:03 | Kaynato | A 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:30 | Kaynato | I want to be able to use notation such as AStar(heuristic).findPath(tree, start, end) |
20:01:50 | Kaynato | Or BreadthOrder.findDepth(tree, root, node) |
20:01:59 | clyybber | Ah, gotcha. |
20:04:34 | clyybber | Kaynato make treeAlgo's first param a static enum? |
20:05:05 | Kaynato | Yep, that's what I'm trying right now |
20:06:25 | Kaynato | that doesn't exactly work for treeorders that take parameters, hm |
20:06:41 | * | Hideki_ quit (Ping timeout: 268 seconds) |
20:07:51 | Kaynato | What 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:14 | Kaynato | Maybe then TreeOrder(tree, orderParams).treeAlgo(params) would make more sense? |
20:11:45 | Kaynato | (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:39 | Kaynato | Oh, 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:48 | Araq | clyybber: what's the question again? what do you need, 'var x = undef' or 'always skip initialization'? |
21:05:48 | clyybber | clyybber: I want to use the dfa to elide initialization. |
21:06:32 | clyybber | So I make initialization explicit in injectdestructors and want to skip initialization in the backend |
21:06:47 | clyybber | Araq: Damnit, why do I keep taggin myself |
21:06:53 | Araq | the idea was to produce 'var x = default(T)' and disable the backend logic altogether |
21:07:06 | clyybber | Yeah, thats what I want to do |
21:07:10 | Araq | there is still disabled code for that |
21:07:23 | clyybber | Araq: Yeah in injectdestructors, I'm building on that |
21:07:47 | Araq | nice |
21:08:39 | Araq | the backend changes are easy too because the logic already exists for sfNoInit |
21:08:49 | Araq | in fact, you can set this flag for the sym |
21:08:52 | clyybber | Ah, great! |
21:08:59 | clyybber | Thanks |
21:09:00 | Araq | and don't have to modify the backend then |
21:10:08 | Araq | so .. this cycle algorithm is a work of a genius, whatever I through at it, it works |
21:10:21 | Araq | well, hardly anything works but these are my own bugs |
21:10:37 | Araq | the algorithm itself seems to be correct |
21:11:14 | Araq | in the past I had a bad experience with these, they were often wrong :P |
21:11:24 | FromDiscord | <Rhett> hey, is there any seek function that makes use of the FileSeekPos enum? |
21:12:22 | disruptek | it's nice when software finally gels into something robust. |
21:15:10 | Araq | clyybber: 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:55 | Araq | disruptek: about https://github.com/nim-lang/Nim/pull/12853/files ... please add a .since annotation |
21:21:57 | disbot | ➥ add a StringTable.clear that requires no mode specification 🧚11disruptek |
21:22:04 | disruptek | okie. |
21:24:13 | disruptek | i should have thought of that. |
21:31:02 | lqdev[m] | Araq: is .since documented somewhere? |
21:32:08 | FromGitter | <bung87> what’s the simple way to exchange two variable value? |
21:33:40 | Yardanico | like in most other languages? |
21:34:00 | FromGitter | <bung87> like operator or some sugar |
21:34:32 | Yardanico | You can create one of course, but AFAIK it's not there by default |
21:34:52 | * | lritter quit (Ping timeout: 268 seconds) |
21:35:00 | FromGitter | <bung87> hmm sure |
21:35:50 | Yardanico | just a simple example https://play.nim-lang.org/#ix=23UX |
21:36:05 | Yardanico | or you can make it a template, rename the proc to `swap` and use it like swap a, b |
21:36:14 | Yardanico | there's a lot of ways of doing things like this in Nim :) |
21:36:28 | Araq | system.swap |
21:36:36 | Araq | it's a builtin, please use it |
21:37:15 | Araq | the compiler understands it and can optimize it in ways that are otherwise quite hard to do |
21:37:21 | Yardanico | guess I've never used it so I didn't know it exists :( |
21:38:09 | Araq | lqdev[m]: it is new |
21:38:59 | Yardanico | Araq: 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:00 | Araq | https://github.com/nim-lang/Nim/blob/devel/lib/system/inclrtl.nim#L52 |
21:41:09 | FromGitter | <bung87> ah,very nice! |
21:49:07 | Araq | Yardanico: 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:10 | Kaynato | Finally, success. Thank goodness for compile-time dispatch tables. https://play.nim-lang.org/#ix=23Vb |
22:31:06 | clyybber | Araq: mNewFinalize isn't used with the new runtime right? |
22:31:24 | Araq | it's not supported |
22:31:45 | clyybber | Nice, because handling it would be a PITA |
22:31:50 | Araq | tried to make it work, but I regarded it to be too dangerous |
22:32:02 | clyybber | Whats its purpose anyways? |
22:32:05 | FromGitter | <bung87> @Kaynato why you call it “compile-time dispatch tables” ? it’s “tree data struct” to me |
22:33:28 | Kaynato | The 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:32 | clyybber | Araq: A finalizer is conceptually equivalent to an `if refcount = 0` in a =destroy(ref T), is that right? |
22:33:49 | clyybber | In that it gets called when the object gets destroyed? |
22:34:05 | Araq | yeah, well. it's not deterministic in a GC setting |
22:34:16 | clyybber | Yeah |
22:34:55 | FromGitter | <bung87> em, I dont get it, forget it- - |
22:35:22 | Kaynato | bung87: Compile-time visitor pattern in nim, implemented with Trees as an example |
22:35:25 | Kaynato | ah sorry |
22:37:14 | Araq | nice, if it weren't for the fact that the visitor pattern is an abomination |
22:37:34 | Araq | ;-) |
22:37:52 | FromGitter | <bung87> wow, I starting understand |
22:39:04 | Araq | pattern 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:56 | disruptek | "set is too large" means i have some >16bit elements in it, right? |
22:46:06 | disruptek | balls. |
22:46:30 | clyybber | ballers. |
22:46:52 | Araq | if only Nim also had a hash set implementation somewhere in its stdlib |
22:46:58 | disruptek | i know, right? |
22:51:25 | clyybber | Araq: Umm, is injectDestructor called for code executed in the VM? |
22:51:38 | Araq | nope |
22:52:06 | clyybber | Hmm. |
22:52:07 | Araq | the VM isn't ready for this madness |
22:52:21 | disruptek | you can't handle the truth! |
22:53:18 | * | vivus quit (Quit: Leaving) |
22:53:50 | disruptek | Error: complex statement requires adult supervision |
22:56:51 | clyybber | Araq: That kinda sux, because I insert defaultCalls in injectdestructors but won't in the VM. |
22:56:59 | clyybber | And thats problematic for default fields.. |
22:57:34 | clyybber | I 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:18 | clyybber | Ah, nevermind. It should work when I leave them in transf |
23:05:15 | disruptek | the jack putter machine, zero defects. |
23:05:21 | disruptek | god help us. |
23:06:17 | disruptek | nimph is now 5700 lines to nimble's ~5400. this is bad, man. |
23:11:48 | Araq | :D |
23:11:58 | Araq | that means it does more than Nimble |
23:12:23 | federico3 | -_- |
23:14:42 | disruptek | 128,199 lines including deps (but not including libgit). |
23:14:51 | disruptek | or the compiler, fwiw. |
23:15:02 | disruptek | bananas. github is 26k. |
23:18:08 | dom96 | That implies Nimph is already more complex than Nimble :P |
23:18:44 | * | nextloop quit (Quit: WeeChat 2.1) |
23:20:11 | disruptek | it's been a long month. |
23:22:23 | disruptek | dom96: what do you think about caret/tilde/wildcard support in nimble? |
23:22:44 | dom96 | I'd love to have it |
23:22:56 | disruptek | enough to impl it? |
23:24:08 | dom96 | possibly. Although I'll be focusing my Christmas holidays on other personal projects. |
23:24:20 | dom96 | supporting that in Nimble should be simple |
23:24:53 | dom96 | just a case of having enough motivation |
23:25:11 | disruptek | i get it. |
23:25:22 | disruptek | well, there a reference impl you can look at, if it helps. |
23:25:53 | disruptek | ditto lockfiles, fwiw. |
23:40:16 | FromGitter | <bung87> does js backend quality equals to c backend? |
23:43:12 | FromGitter | <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:15 | FromGitter | <bung87> https://github.com/bung87/datetime_parse the code gen is over 6000 lines , I can’t really tell where the problem about. |