00:08:08 | FromDiscord | <2vg> nimwc awesome :) |
00:14:27 | * | CodeVance quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org) |
00:19:50 | * | athenot quit (Ping timeout: 246 seconds) |
00:36:00 | * | CodeVance joined #nim |
01:02:16 | FromGitter | <Varriount> nimwc? |
01:10:32 | * | cspar quit (Ping timeout: 250 seconds) |
01:18:13 | * | athenot joined #nim |
01:36:52 | FromDiscord | <2vg> https://nimwc.org |
01:37:14 | FromDiscord | <2vg> @Varriount |
01:51:09 | * | athenot quit (Ping timeout: 265 seconds) |
01:52:09 | * | gokr quit (Ping timeout: 256 seconds) |
02:13:09 | * | yglukhov joined #nim |
02:17:05 | * | yglukhov quit (Ping timeout: 240 seconds) |
02:24:27 | * | leorize joined #nim |
02:34:46 | * | rockcavera quit (Remote host closed the connection) |
02:49:24 | * | athenot joined #nim |
02:50:22 | * | rockcavera joined #nim |
03:08:23 | * | dddddd quit (Remote host closed the connection) |
03:11:51 | * | sz0 joined #nim |
03:21:57 | * | athenot quit (Ping timeout: 255 seconds) |
04:03:45 | * | endragor joined #nim |
04:24:08 | * | CodeVance_ joined #nim |
04:24:53 | * | CodeVance quit (Read error: Connection reset by peer) |
04:37:11 | * | xkapastel quit (Quit: Connection closed for inactivity) |
04:40:34 | * | leorize quit (Quit: WeeChat 2.1) |
04:55:47 | * | athenot joined #nim |
05:20:45 | * | mcc quit (Quit: Connection closed for inactivity) |
05:25:12 | * | nsf joined #nim |
05:28:52 | * | athenot quit (Ping timeout: 260 seconds) |
05:56:38 | * | jjido joined #nim |
05:58:04 | * | CodeVance_ quit (Read error: Connection reset by peer) |
05:58:09 | * | CodeVance__ joined #nim |
06:07:24 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
06:10:01 | * | yglukhov_ joined #nim |
06:17:25 | * | couven92 joined #nim |
06:19:01 | * | couven92 quit (Client Quit) |
06:26:32 | * | leorize joined #nim |
06:28:19 | * | couven92 joined #nim |
06:29:34 | * | couven92 quit (Client Quit) |
06:32:13 | * | couven92 joined #nim |
06:32:25 | * | couven92 quit (Remote host closed the connection) |
06:34:02 | * | couven92 joined #nim |
06:34:07 | * | CodeVance__ quit (Quit: Leaving) |
06:50:31 | * | Ven`` joined #nim |
06:56:20 | * | jjido joined #nim |
06:57:55 | FromGitter | <narimiran> > Nim reached 104 comments in /r/programming: https://www.reddit.com/r/programming/comments/8ilinf/python_vs_numpy_vs_nim/ congrats @miran ⏎ ⏎ thanks @mratsim! this was way above my expectations! the moral of the story (for me): lots of people want to read short/simple stuff :) |
06:58:41 | * | yglukhov_ quit (Read error: Connection reset by peer) |
06:59:15 | * | yglukhov joined #nim |
06:59:31 | * | gokr joined #nim |
07:07:31 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:20:05 | * | rokups joined #nim |
07:22:35 | * | PMunch joined #nim |
07:43:52 | * | athenot joined #nim |
07:48:37 | * | athenot quit (Ping timeout: 276 seconds) |
07:54:41 | * | FuntDobra joined #nim |
08:04:44 | * | gmpreussner quit (Ping timeout: 260 seconds) |
08:05:17 | * | gmpreussner joined #nim |
08:10:07 | * | fredrik92 joined #nim |
08:13:31 | * | couven92 quit (Ping timeout: 256 seconds) |
08:26:00 | * | yglukhov quit (Remote host closed the connection) |
08:26:35 | * | yglukhov joined #nim |
08:27:26 | * | Yardanico quit (Read error: Connection reset by peer) |
08:27:27 | * | sz0 quit (Quit: Connection closed for inactivity) |
08:29:30 | * | wertfisch is now known as qwertfisch |
08:31:05 | * | yglukhov quit (Ping timeout: 268 seconds) |
08:32:28 | * | floppydh joined #nim |
08:47:30 | * | yglukhov joined #nim |
09:00:21 | * | m712 joined #nim |
09:00:35 | m712 | :( secret still seems to explode on import os |
09:02:05 | * | xkapastel joined #nim |
09:02:57 | * | thor77 quit (Ping timeout: 248 seconds) |
09:03:14 | * | thor77 joined #nim |
09:04:01 | * | byte512 quit (Ping timeout: 248 seconds) |
09:09:08 | * | byte512 joined #nim |
09:20:41 | * | Yardanico joined #nim |
09:31:59 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:35:35 | * | CodeVance joined #nim |
09:37:37 | dom96 | m712: secret won't support FFI anytime soon |
09:44:44 | * | athenot joined #nim |
09:48:45 | * | yglukhov quit (Remote host closed the connection) |
09:49:42 | * | adeohluwa joined #nim |
09:53:26 | * | athenot quit (Ping timeout: 276 seconds) |
09:54:36 | * | yglukhov joined #nim |
09:54:43 | * | Ven`` joined #nim |
10:00:18 | PMunch | m712, if you want a Nim REPL I suggest checking out inim |
10:00:29 | PMunch | It appears to handle import os just fine |
10:00:37 | PMunch | It works by compiling in the background |
10:00:45 | adeohluwa | Sigsegv illegal storage access (attempt to read from nil?) |
10:01:06 | adeohluwa | PMunch: bn using it... its cool |
10:01:18 | * | FuntDobra_ joined #nim |
10:01:59 | PMunch | Not as fast as nim secret though |
10:02:15 | adeohluwa | am trying to read from 4 variables that might turn out to be nil |
10:03:38 | adeohluwa | PMunch: hmm... those repls need the equivalent of dir() & help() in python & thats it! |
10:04:01 | * | FuntDobra quit (Ping timeout: 256 seconds) |
10:07:27 | enthus1ast | adeohluwa: if not variable.isNil |
10:08:24 | PMunch | Hmm, it would be cool to have access to doc-comments at compile-time |
10:08:40 | PMunch | Not sure what they would be used for outside a REPL, but would be cool none-the-less |
10:10:17 | enthus1ast | it would also be cool if the name of the file (and the line) a function resides in would be printed in case of an overloading error |
10:11:31 | adeohluwa | enthus1ast: any one of 4 variables could be nil |
10:12:10 | PMunch | So add a nil check for all those variables.. |
10:18:17 | adeohluwa | what causes an out of memory error in nim language? |
10:18:48 | PMunch | That you run out of memory |
10:19:23 | * | leorize quit (Ping timeout: 246 seconds) |
10:20:33 | * | athenot joined #nim |
10:22:35 | * | FuntDobra_ quit (Ping timeout: 240 seconds) |
10:22:35 | adeohluwa | PMunch: I want to skip the values that return nil |
10:24:27 | PMunch | What do you mean skip? |
10:25:54 | * | dddddd joined #nim |
10:26:27 | adeohluwa | PMunch: ix.io/1ahJ |
10:30:24 | enthus1ast | you could also test them in one if, if you `and` test all cases |
10:31:26 | PMunch | Maybe something like this: http://ix.io/1ahP/Nim |
10:32:08 | enthus1ast | kuhl PMunch :) |
10:33:39 | PMunch | Hmm, didn't seem to work though.. |
10:34:09 | PMunch | Aah, it didn't like the for loop with the varargs.. |
10:36:46 | enthus1ast | adeohluwa: the good thing is nim tells you on a filesave what is wrong and if it not complains it often works, so a repl would be nice to have but a little unecessary. |
10:36:46 | * | xet7 joined #nim |
10:38:33 | * | couven92 joined #nim |
10:38:49 | * | fredrik92 quit (Quit: Client disconnecting) |
10:39:06 | adeohluwa | PMunch: yes it didn't work |
10:39:27 | adeohluwa | Iterator within for loop context expected |
10:41:52 | adeohluwa | using multiple and's I get out of memory |
10:42:16 | PMunch | Hold on a sec |
10:42:50 | enthus1ast | i would use an iterator |
10:43:01 | enthus1ast | for line in data.lines: |
10:43:23 | PMunch | Replace it with that: http://ix.io/1ahR/nim |
10:43:56 | PMunch | Hmm, I guess that should really be renamed to "anyNil" |
10:45:00 | enthus1ast | it could be that you run out of memory, it depends on how much data you stuff into `data` |
10:45:24 | * | FuntDobra_ joined #nim |
10:45:25 | enthus1ast | atm you "wait for all data" then you split lines, so you need even more memory |
10:46:26 | enthus1ast | it seems that you want to write a "unix filter" like? Then clearly iterate over the lines of data |
10:49:53 | adeohluwa | enthus1ast: thats what I do |
10:50:12 | adeohluwa | the data is coming from an external source |
10:50:34 | adeohluwa | cat xyz | ./script.nim |
10:50:56 | enthus1ast | then use sdtin.readLine |
10:51:02 | enthus1ast | stdin |
10:52:39 | adeohluwa | that will only read a single line |
10:52:52 | adeohluwa | read all reads entire file then splits it into lines |
10:53:18 | PMunch | while not stdin.atEnd: stdin.readLine |
10:53:53 | * | cspar joined #nim |
10:54:02 | enthus1ast | it may not possible to determine the end of the stream |
10:54:27 | enthus1ast | so try reading from the stream and catch the io error :D |
10:54:57 | * | FuntDobra_ quit (Ping timeout: 264 seconds) |
10:56:14 | enthus1ast | adeohluwa: since you data is seperated by lines? It make sence to only store this line in memory, evaluate it, echo it, get the next line from stream |
10:56:48 | enthus1ast | this way you avoid holding the whole file im memory (a few times even) |
10:58:04 | enthus1ast | and the other effect is, that you dont have to wait for the whole file to be processed. |
10:58:25 | PMunch | Yeah, theoretically your input can be a slow-echoing script |
10:58:38 | PMunch | And you will process the lines as they appear |
11:06:56 | adeohluwa | enthus1ast: 😃 |
11:07:27 | adeohluwa | PMunch: readline reads only first line |
11:07:58 | adeohluwa | I'm using cat to read URLs to stdout from a text file |
11:10:13 | PMunch | adeohluwa, yes, that's why it is in a loop |
11:12:23 | * | yglukhov quit (Remote host closed the connection) |
11:13:12 | PMunch | http://ix.io/1ai1/Nim |
11:13:24 | PMunch | Something like that should do what you want, while not running out of memory |
11:14:04 | PMunch | Oh wait, you might get an error that url is a TaintedString, so pass it through $ first |
11:16:12 | enthus1ast | result = "" |
11:18:46 | PMunch | Huh? |
11:18:57 | PMunch | Oh yeah |
11:19:14 | PMunch | Or remove the string return type, not sure what that's supposed to do |
11:19:30 | PMunch | Maybe the idea was to not echo inside the getData but concatenate a string instead |
11:20:36 | * | FuntDobra_ joined #nim |
11:24:16 | adeohluwa | let me try it out now... |
11:27:21 | * | sendell joined #nim |
11:29:17 | adeohluwa | PMunch: the string return type from getData()? |
11:29:37 | PMunch | Yeah, your getData proc returns a string |
11:29:43 | PMunch | But no string is actually returned :P |
11:29:58 | adeohluwa | true that |
11:36:18 | * | FuntDobra_ quit (Remote host closed the connection) |
11:37:35 | * | FuntDobra joined #nim |
11:37:56 | * | yglukhov joined #nim |
11:39:39 | * | rokups quit (Quit: Connection closed for inactivity) |
11:51:36 | adeohluwa | macro now works perfect |
11:51:44 | adeohluwa | still get out of memory error |
11:52:05 | adeohluwa | removing return type causes error |
11:52:13 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:56:39 | * | Ven`` joined #nim |
11:57:58 | PMunch | Removing the return type causes an error? |
11:59:05 | PMunch | Could you send me the URL list as well? |
11:59:22 | * | leorize joined #nim |
11:59:45 | * | Vladar joined #nim |
12:00:31 | * | Ven`` quit (Client Quit) |
12:02:31 | PMunch | This works fine: http://ix.io/1aie/Nim |
12:02:49 | PMunch | But without the list I'm unable to verify if it actually does what you need it to do.. |
12:03:19 | * | Ven`` joined #nim |
12:04:43 | dom96 | hrm, I wonder why 0.13.0 docs are showing up in google searches so much |
12:05:30 | * | Snircle joined #nim |
12:05:51 | Yardanico | dom96, where? in google? |
12:06:10 | dom96 | ...yes? |
12:12:35 | * | couven92 quit (Quit: Client disconnecting) |
12:13:02 | PMunch | Hmm, random is deprecated? |
12:13:25 | PMunch | Oh, just the proc :P |
12:15:48 | Yardanico | dom96, that can be a thing related to your past searches |
12:18:58 | * | FuntDobra quit (Ping timeout: 264 seconds) |
12:19:38 | PMunch | Hmm, wonder why Nim's results are so bad: https://www.reddit.com/r/nim/comments/8jbmml/naive_benchmark_treap_implementation_of_c_rust/ |
12:20:13 | enthus1ast | Nim is "hyped" nice :) |
12:21:58 | dom96 | `nim compile --opt:speed --out:main-nim main.nim` |
12:22:00 | enthus1ast | "nim compile --opt:speed --out:main-nim main.nim" is the line |
12:22:08 | dom96 | My pet peeve |
12:22:16 | PMunch | https://github.com/frol/completely-unscientific-benchmarks/pull/1 |
12:22:25 | PMunch | Nice, def- already on it :P |
12:24:22 | * | couven92 joined #nim |
12:24:50 | Yardanico | My results are - 3.4sec without -d:release (with opt speed), and 0.9s with -d:release :D |
12:26:00 | Yardanico | But why these programmers write benchmarks for another languages without even looking at docs about compiling release binaries... |
12:26:09 | * | FuntDobra joined #nim |
12:26:16 | shashlick | Well I hope they rerun the test instead of just accepting the readme change |
12:26:56 | shashlick | Although I'm curious if Nim could be faster without -d: release too |
12:26:58 | PMunch | Hmm, with --gc:boehm|markAndSweep|regions I drop almost another second |
12:27:25 | Yardanico | PMunch, yeah, I get 0.58sec instead of 0.9sec |
12:27:35 | Yardanico | with mark and sweep |
12:28:35 | PMunch | That should probably be requested as well then |
12:29:05 | dom96 | Well, this is "naive" so there should be a limit to how far you take the optimisations |
12:29:21 | dom96 | otherwise we'll all be tinkering until we start optimising the asm and so will other langs |
12:29:48 | PMunch | Well, enabling a faster gc isn't all that much tinkering :P |
12:30:00 | shashlick | Do we need to optimize debug mode a bit? Or have an ugly banner informing it is debug mode |
12:30:15 | Yardanico | shashlick, what for? after all programmers should read docs |
12:30:36 | Yardanico | well, maybe it should be optimized, but it's not that important really |
12:31:48 | shashlick | I don't know, according to these results, Nim is as slow as python which is ridiculous |
12:32:08 | Yardanico | shashlick, well, that's debug mode |
12:32:17 | FromGitter | <narimiran> can we make it even faster? :) |
12:32:33 | shashlick | We can say user error but newbies will bumble through |
12:32:36 | Yardanico | yeah, but AFAIK the goal of this benchmark is not optimize for every language |
12:32:45 | shashlick | Should make it obvious somehow |
12:34:01 | PMunch | Append _debug to the name of the binary when not compiled with -d:release |
12:34:13 | shashlick | Well are they building rust in debug mode |
12:34:36 | shashlick | That will break scripts |
12:35:53 | shashlick | They use -O for rust so it is isn't unoptimised |
12:36:51 | shashlick | Everywhere else, -O3 etc |
12:37:14 | shashlick | We need to see if there's something we can do to make it clear |
12:37:46 | shashlick | They did try with --opt:speed but it wasn't good enough |
12:40:59 | PMunch | I mean it literally says: "Note: use -d:release for a release build!" in the --help message for --opt:speed.. |
12:41:23 | shashlick | Why doesn't --opt:speed or size imply release? |
12:41:42 | shashlick | Does performance change in debug mode |
12:41:51 | PMunch | Because some people probably don't want to disable all the checks that -d:release disables |
12:41:59 | PMunch | So they create their own "release" configuration |
12:44:49 | Yardanico | https://github.com/frol/completely-unscientific-benchmarks/commit/cf0a23061bf5c8f6c5a1f0ea031c1f4416fea45c |
12:44:51 | Yardanico | :) |
12:45:04 | Yardanico | from 3.94 to 0.55 |
12:45:10 | PMunch | Nice |
12:45:23 | Yardanico | Same speed as C++ (ref-counted) |
12:46:11 | Yardanico | PMunch, also, memory usage with markAndSweep is much higher |
12:46:20 | Yardanico | so it's a memory/speed tradeoff https://github.com/frol/completely-unscientific-benchmarks/pull/1#issuecomment-388803315 |
12:48:02 | FromGitter | <narimiran> both versions should be posted, IMO |
12:48:21 | * | cspar quit (Ping timeout: 264 seconds) |
12:48:36 | PMunch | Tried with boehm, v2, or regions? |
12:50:11 | PMunch | Ouch, Java memory consumption x375 :P |
12:50:20 | Yardanico | PMunch, :D |
12:50:42 | shashlick | Well they should also clarify that they used gcc as the backed |
12:50:52 | shashlick | Else it looks like Nim is slower than clang |
12:51:14 | PMunch | He tried with clang and it was slower than without.. |
12:51:28 | PMunch | Would be interesting to see the js target as well |
12:51:31 | Yardanico | PMunch, but he should specify GCC used for Nim :) |
12:51:38 | Yardanico | *that |
12:52:03 | shashlick | What does it say if you compile with --opt:speed but not -d:release |
12:52:12 | shashlick | Does it still say debug mode in the hint |
12:52:28 | shashlick | Don't have my laptop in front of me right now |
12:53:01 | FromGitter | <narimiran> @Yardanico i posted a comment under PR, also stating to update the compiler column |
12:53:08 | shashlick | Why would it be slower with clang if he got better results |
12:53:22 | Yardanico | shashlick, he got worse results with clang than with gcc |
12:53:24 | Yardanico | with -d:release |
12:53:35 | Yardanico | and --gc:markAndSweep. like 2x slower with clang |
12:53:50 | shashlick | Oh never mind, I didn't see ref pointers vs raw |
12:54:09 | shashlick | Thought he did gcc vs clang |
12:55:55 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:57:24 | shashlick | Still x13 memory |
12:58:02 | PMunch | Yeah, would be interesting to try with the other gcs as well |
12:58:31 | shashlick | Is there anything else obvious in the code itself |
12:58:36 | FromGitter | <narimiran> @shashlick: it is because of gc used. by default it is 1/10 of that |
12:59:34 | shashlick | Which gc is he using? |
12:59:49 | * | cspar joined #nim |
12:59:50 | shashlick | Oh I see |
13:00:25 | shashlick | He should probably give results for both default and m&s if possible |
13:00:43 | shashlick | To make it clear you can optimize for either |
13:00:48 | Yardanico | also v2 gc is a bit (like ~150ms) faster than current default GC |
13:01:32 | FromGitter | <narimiran> a bit? that's 15%! :D |
13:02:59 | FromGitter | <narimiran> here we go, he updated the table to include both results |
13:03:05 | Yardanico | well, no, it runs like 0.9s with default GC :) |
13:03:14 | * | Ven`` joined #nim |
13:03:52 | FromGitter | <narimiran> ok, 16%, sorry |
13:04:18 | Yardanico | oh yeah, sorry, actually that's true |
13:04:48 | Yardanico | ah, sorry, I'm dumb |
13:05:26 | Yardanico | or not, I'm not dumb. 0.924s without gcv2, 0.780 with it |
13:05:50 | shashlick | Poor guy, we are on his case! |
13:06:28 | shashlick | Still slower than rust which is annoying |
13:06:38 | Yardanico | shashlick, slower than what version of rust? |
13:06:44 | Yardanico | Rust "ref-counted" is 0.66 |
13:06:55 | Yardanico | and C++ ref counted is 0.55 (exactly as Nim) |
13:07:43 | * | SenasOzys quit (Remote host closed the connection) |
13:08:08 | * | SenasOzys joined #nim |
13:08:36 | shashlick | Still 30 lines shorter |
13:11:24 | Yardanico | that's the thing - nim is probably one of the best languages with good trade-off between speed and development time |
13:14:31 | shashlick | That's worth a mention too, the Nim version is the shortest across the board |
13:23:04 | * | noonien joined #nim |
13:24:08 | * | smt joined #nim |
13:28:35 | * | SenasOzys quit (Ping timeout: 256 seconds) |
13:37:20 | * | SenasOzys joined #nim |
13:40:35 | PMunch | https://i.imgur.com/1Xz3Elo.png |
13:41:07 | PMunch | Comparison of Nim's GC options and their performance on this benchmark measured on my machine |
13:41:45 | PMunch | Not sure why he saw an increase from 0.5 to 5 Mib though.. |
13:41:51 | * | nsf quit (Quit: WeeChat 2.1) |
13:42:11 | PMunch | The largest there is 3108 KiB |
13:42:38 | PMunch | 1444 KiB on the recursive thing |
13:43:51 | PMunch | regions seems to be the best performance |
13:44:13 | PMunch | Followed by markAndSweep (boehm is slightly faster, but uses a lot more memory) |
13:44:52 | PMunch | Of course none is the fastest, but that complains about various things using GC'ed memory |
13:55:25 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:00:21 | * | FuntDobra quit (Ping timeout: 240 seconds) |
14:01:35 | * | leorize quit (Ping timeout: 240 seconds) |
14:10:28 | * | couven92 quit (Quit: Client disconnecting) |
14:11:31 | * | xkapastel quit (Quit: Connection closed for inactivity) |
14:12:33 | * | Ven`` joined #nim |
14:20:11 | * | endragor quit (Remote host closed the connection) |
14:20:27 | * | miran joined #nim |
14:21:09 | shashlick | still trying to figure out how to get autocomplete and suggestions working on vim - which plugin(s) to use? |
14:32:51 | federico3 | neovim + nim.vim |
14:33:40 | federico3 | (+ vim-gitgutter, vim-fugitive, neomake... ) |
14:34:27 | shashlick | do we have omnicomplete yet? |
14:34:51 | shashlick | don't think deoplete works |
14:34:55 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:34:57 | shashlick | ale is good for syntax checking |
14:35:33 | PMunch | Couldn't we just write the language server protocol thingy.. |
14:36:23 | PMunch | Hmm, interesting that a tuple and an object have different performance |
14:37:06 | shashlick | federico3: any reason why neovim vs vim8 for you? |
14:38:40 | * | Ven`` joined #nim |
14:39:35 | PMunch | Huh, it seems like objects enter the C code while tuples are completely abstracted away by the Nim compiler |
14:40:38 | PMunch | Oh no wait, they do exist |
14:41:29 | FromGitter | <data-man> @PMunch: Which is faster? |
14:42:09 | PMunch | tuples |
14:42:14 | PMunch | Not by much though |
14:42:53 | FromGitter | <data-man> Good. I like tuples. :) |
14:44:48 | federico3 | shashlick: I switched due to the async stuff |
14:48:17 | PMunch | On my machine, I get 1.27 when I use an array[3, Node], 1.261 when I use a tuple[smaller, equal, greater: Node], and 1.36 when I use an object with the same fields as the tuple |
14:50:17 | PMunch | And 1.31 when I use a ref object |
14:50:25 | shashlick | so no reliable nimsuggest autocomplete on vim |
14:59:34 | * | arecaceae quit (Read error: Connection reset by peer) |
14:59:58 | * | arecaceae joined #nim |
15:00:24 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:01:16 | shashlick | so many open PRs on nim.vim |
15:03:12 | PMunch | Nim is slowly getting there on the performance: https://github.com/frol/completely-unscientific-benchmarks#linux-arch-linux-x64-intel-core-i7-4710hq-cpu |
15:03:40 | PMunch | Memory on par with raw-pointers C++, and speed only at 2.5x increase |
15:04:57 | FromGitter | <mratsim> Why does this even speed the benchmark? https://github.com/frol/completely-unscientific-benchmarks/commit/690d3ef42aad1bc1ffcef8d69d80c7328bdfbe96 |
15:05:22 | PMunch | Not sure TBH.. |
15:06:08 | PMunch | But I did 10 runs of each, and with the object I got 1.24 seconds average but with the tuple I got 1.15 seconds average |
15:06:09 | FromGitter | <mratsim> I think you should use result.lower, result.equalGreater |
15:06:24 | FromGitter | <mratsim> instead of a let then object construction |
15:06:24 | PMunch | Can you do that? |
15:06:28 | FromGitter | <mratsim> of course |
15:06:43 | FromGitter | <mratsim> (result.lower, result.equalGreater) = splitBinary also works |
15:08:14 | FromGitter | <mratsim> the speed increase for the tuple is probably because in the object case the compiler used temporary while in the tuple case, it detected that it could do without |
15:09:32 | * | CodeVance quit (Read error: Connection reset by peer) |
15:10:25 | * | CodeVance joined #nim |
15:10:42 | PMunch | Hmm, passible |
15:10:46 | PMunch | *possible |
15:10:57 | * | CodeVance quit (Client Quit) |
15:13:32 | * | FuntDobra joined #nim |
15:14:01 | * | Trustable joined #nim |
15:14:47 | * | PMunch quit (Quit: Leaving) |
15:15:27 | * | xkapastel joined #nim |
15:20:47 | jxy | For a fair comparison, they need to write a ptr version of the code in Nim, too. |
15:22:24 | jxy | We do need a macro that strips away the let bindings of objects to minimize copying. |
15:22:26 | def- | jxy: why don't you supply one? |
15:23:05 | * | FuntDobra quit (Ping timeout: 240 seconds) |
15:23:28 | FromGitter | <zetashift> Still pretty impressive that a GC'd lang can go toe to toe with Rust and C++ |
15:23:38 | jxy | it would be exactly like the c version except for the syntax. |
15:23:50 | FromGitter | <zetashift> D + LDC would also be pretty darn close to it |
15:26:14 | Araq | better would be if we could ensure the copies get optimized away |
15:26:23 | Araq | ptr version is a sad compromise |
15:26:41 | Araq | I think the planned copy elisions will get us there |
15:28:27 | jxy | what's the eta for 'the planned copy elisions'? |
15:30:54 | * | DarkArctic joined #nim |
16:01:39 | * | nsf joined #nim |
16:05:55 | * | sendell quit (Remote host closed the connection) |
16:11:28 | FromGitter | <mratsim> I’ve been waiting for those for a year :D |
16:11:49 | FromGitter | <mratsim> but it’s dependant on escape analysis which is tough no? |
16:11:54 | FromGitter | <mratsim> dependent* |
16:16:00 | * | FuntDobra joined #nim |
16:16:12 | * | jrbrt joined #nim |
16:19:21 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
16:28:39 | * | jrbrt quit (Quit: jrbrt) |
16:29:45 | * | jrbrt joined #nim |
16:40:43 | Yardanico | https://github.com/frol/completely-unscientific-benchmarks/pull/1#issuecomment-388872174 |
16:45:46 | * | cspar_ joined #nim |
16:46:06 | * | PMunch joined #nim |
16:46:29 | shashlick | brilliant work guys |
16:48:01 | * | jjido joined #nim |
16:48:56 | * | cspar quit (Ping timeout: 256 seconds) |
16:49:57 | * | FuntDobra quit (Ping timeout: 240 seconds) |
17:06:37 | PMunch | Hmm, when I compile with 0.18.0 it uses 5MiB of memory, but when I compile with devel it uses 768KiB |
17:06:42 | PMunch | Both with markAndSweep |
17:06:44 | Araq | jxy, real soon now (TM) |
17:08:31 | miran | PMunch: one more reason to release a new stable version ;) |
17:10:09 | Yardanico | maybe we can ask the author so he will use devel version |
17:10:11 | * | yglukhov quit (Ping timeout: 255 seconds) |
17:10:15 | Yardanico | e.g. he uses rust nightly |
17:14:32 | * | jrbrt_ joined #nim |
17:14:46 | * | jrbrt quit (Ping timeout: 276 seconds) |
17:17:02 | Yardanico | PMunch, he's probably surprised by our activity :) |
17:17:48 | miran | Yardanico: i think this explaines "nim fanboys" reactions on reddit when someone mentions nim :D |
17:18:54 | Yardanico | miran, but we're not trying to offend people using other languages :) |
17:18:57 | Yardanico | *almost* |
17:19:10 | miran | ;) |
17:19:48 | * | CodeVance joined #nim |
17:21:32 | * | PMunch quit (Quit: leaving) |
17:28:01 | * | FuntDobra joined #nim |
17:29:01 | FromGitter | <data-man> @Araq: When araq-big-refactoring will be merged? Works for me. (TM) :) |
17:29:38 | Yardanico | what is the purpose of it? remove globals from compiler code? |
17:30:27 | FromGitter | <data-man> Yes. And other changes. :) |
17:40:29 | FromGitter | <mratsim> at least we mostly act when people mention Nim ;) not when people mention C or C++ |
17:40:57 | * | LyndsySimon left #nim (#nim) |
17:41:49 | miran | mratsim: even that seems too much for those non-nim folks that keep reacting.... |
17:42:10 | FromGitter | <mratsim> They already got the Rust vaccine anyway :P |
17:42:47 | FromGitter | <mratsim> By the way, I managed to get the Intel high performance team checking out Arraymancer - https://github.com/mratsim/Arraymancer/issues/228#issuecomment-388833934 maybe one day Intel will prototype in Nim =) |
17:43:53 | Araq | data-man: https://ci.appveyor.com/project/Araq/nim/build/4221/tests |
17:43:58 | Araq | when the tests are green |
17:44:02 | * | floppydh quit (Quit: WeeChat 2.1) |
17:44:10 | Araq | which look really good |
17:44:32 | Araq | only the expected differences in the error messages |
17:44:52 | Araq | glad it worked out so well given that I pretty much touched every line in the compiler... |
17:46:56 | Araq | Yardanico, it's actually more about getting symbol files into shape. the global state needs to be replicated/replayed properly for it to work |
17:47:12 | Yardanico | Araq, ah, ok, thanks for clarification! |
17:47:33 | Yardanico | wow, appveyor can show different test names? |
17:47:34 | Yardanico | https://ci.appveyor.com/project/Araq/nim/build/4221/tests |
17:48:07 | * | gmpreussner quit (Ping timeout: 256 seconds) |
17:48:34 | Araq | it's also about giving the new compiler devs some hints of how things should be done |
17:49:09 | Araq | don't need more of the old crap in Nim. |
17:51:00 | miran | @mratsim very nice! |
17:54:10 | * | gmpreussner joined #nim |
17:55:24 | * | jjido quit (Ping timeout: 265 seconds) |
18:04:58 | * | jjido joined #nim |
18:05:04 | * | SenasOzys quit (Ping timeout: 265 seconds) |
18:09:27 | * | gmpreussner quit (Ping timeout: 240 seconds) |
18:12:15 | * | SenasOzys joined #nim |
18:16:35 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:20:11 | * | gmpreussner joined #nim |
18:20:15 | FromGitter | <data-man> Hmm, https://buildkite.com/features seems interesting |
18:26:05 | * | FuntDobra quit (Ping timeout: 240 seconds) |
18:26:29 | * | NimBot joined #nim |
18:30:05 | * | gmpreussner quit (Ping timeout: 240 seconds) |
18:30:59 | miran | offtopic: those of you who use ix.io - how do you use it? how do you create your pastes? |
18:32:44 | shashlick | miran: https://github.com/genotrance/snip/blob/b03a48965b3c689a1f9235bf03f90c537e4ed19f/src/snip/gist.nim#L73 |
18:33:12 | * | gmpreussner joined #nim |
18:35:10 | miran | shashlick: thanks |
18:39:48 | FromGitter | <diegogub> Hello, I'm having issues understanding nim error handling..libraries like json raise exception when a key is not found..Also libs like jester..also raise exception if a param is queried and does not exist. I really think most of the time raising exception for `read` is not needed..returning a tuple with value and Enum would be much better..only raising exception when there is no way to continue .. Documentation |
18:39:48 | FromGitter | ... explicitly says: ``` |
18:39:56 | FromGitter | <diegogub> `````` |
18:40:10 | FromGitter | <diegogub> ```code paste, see link``` |
18:40:28 | Yardanico | well, that's your opinion :) |
18:40:42 | Yardanico | and there's a lot of procs in json/tables/etc so you can check if key exist |
18:41:51 | FromGitter | <diegogub> I know, actually I did a library to avoid this exceptions.. |
18:42:38 | FromGitter | <diegogub> a json not having a key is quite common..also a http request without a param is common too |
18:42:47 | Yardanico | that's why we have a {} template in json module |
18:42:58 | Yardanico | and what about http requests without params? |
18:43:36 | FromGitter | <diegogub> on the jester lib, when you do : request.params["id"] .. If the param is not set, exception is raised |
18:43:45 | Yardanico | what is params object? |
18:43:49 | Yardanico | I mean field |
18:43:51 | Yardanico | what type is it? |
18:44:05 | FromGitter | <diegogub> Let me check, I think is a Table |
18:44:22 | Yardanico | there's a getOrDefault in tables |
18:44:38 | Yardanico | diegogub: yeah, it's a StringTable from strtabs |
18:44:48 | FromGitter | <diegogub> StringTableRef |
18:45:03 | Yardanico | https://nim-lang.org/docs/strtabs.html |
18:45:17 | Yardanico | there's getOrDefault, hasKey, contains for it |
18:47:17 | Yardanico | btw, I really think that tables and strtabs modules should have {} template (as in json module) |
18:47:23 | Yardanico | it's actually very useful and easy-to-use |
18:47:43 | enthus1ast | {}.toTable should work |
18:47:54 | Yardanico | enthus1ast, I mean mytable{"a"}{"b"} |
18:48:10 | Araq | mytable{"a", "b"} |
18:48:20 | Yardanico | yeah, this |
18:49:17 | FromGitter | <diegogub> I agree.. |
18:51:55 | * | ahmed___ joined #nim |
18:52:06 | * | ahmed___ quit (Client Quit) |
18:53:17 | miran | oooh, this ix.io thing is easier than i thought, now i see why it is popular here :) |
18:53:57 | * | Vladar quit (Quit: Leaving) |
19:03:19 | * | CodeVance_ joined #nim |
19:04:54 | FromGitter | <mratsim> is it me or Nim is suddenly slower? https://github.com/frol/completely-unscientific-benchmarks |
19:05:20 | Yardanico | ugh |
19:05:32 | Yardanico | that's because of LTO flag |
19:05:40 | Yardanico | (author enabled it for C++, Nim, Rust and Swift) |
19:06:27 | * | CodeVance quit (Ping timeout: 240 seconds) |
19:06:28 | FromGitter | <mratsim> I’ll bite, i’ll play with it and optimize it to C++ speed |
19:06:40 | Yardanico | it was already at C++ (ref-counted) speed |
19:06:44 | Yardanico | But it got SLOWER with LTO |
19:07:27 | * | gmpreussner quit (Ping timeout: 240 seconds) |
19:08:07 | FromGitter | <mratsim> I don’t see any {.noInit.} pragma and it uses ref object so I suppose you have double the genericResetAux needed in the codegen |
19:09:29 | Yardanico | also disable LTO if it's slower with it :) |
19:09:31 | * | athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:09:33 | * | m712 quit (Quit: bye-nyan!) |
19:11:07 | * | CodeVance_ quit (Read error: Connection reset by peer) |
19:11:23 | FromGitter | <Varriount> Hm, usually LTO has a small performance improvement with Nim |
19:11:42 | Yardanico | well, this is like with any other benchmarks |
19:11:44 | FromGitter | <mratsim> well everything is in one file, LTO can do nothing |
19:12:04 | Yardanico | C++ got like 2x faster with it though |
19:12:12 | FromGitter | <mratsim> I’m surprised it can even slow down, did it import OS stuff? |
19:12:52 | Yardanico | but yeah, you can go ahead and try to optimize it, it seems authors make some optimizations to C++ |
19:13:02 | Yardanico | mratsim: it only imports random |
19:13:05 | Yardanico | which is a bit unfair too |
19:13:14 | * | gmpreussner joined #nim |
19:14:50 | FromGitter | <mratsim> ugh, my machine is slow: ⏎ ⏎ $ time build/bench ⏎ 331665 ⏎ ... [https://gitter.im/nim-lang/Nim?at=5af9e02ad245fe2eb7ad8d16] |
19:16:43 | * | jjido joined #nim |
19:17:49 | * | sz0 joined #nim |
19:17:54 | FromGitter | <mratsim> the workload in the bench is a bit low though :/ I would prefer something that requires at least 4 seconds of work. |
19:19:12 | FromGitter | <mratsim> look at all those genericResets |
19:19:19 | FromGitter | <mratsim> (https://files.gitter.im/nim-lang/Nim/Qy95/2018-05-14_21-18-54.png) |
19:20:01 | FromGitter | <mratsim> (https://files.gitter.im/nim-lang/Nim/RbLu/2018-05-14_21-19-47.png) |
19:20:11 | FromGitter | <mratsim> FractalReset >_> |
19:22:41 | * | gmpreussner quit (Quit: kthxbye) |
19:26:58 | * | jrbrt_ quit (Quit: jrbrt_) |
19:27:25 | FromGitter | <mratsim> I managed to divide the time by 10 >_< ⏎ $ time build/bench ⏎ SIGILL: Illegal operation. ⏎ ⏎ real 0m0.017s ... [https://gitter.im/nim-lang/Nim?at=5af9e31de1cf621dba1c06f7] |
19:28:48 | FromGitter | <mratsim> Time divided by 2 on my machine: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5af9e370d245fe2eb7ad9bec] |
19:28:56 | FromGitter | <mratsim> so we should be as fast as C++ |
19:29:48 | FromGitter | <mratsim> flto doesn’t change anything for me though |
19:31:01 | Araq | gosh just fix that genericReset crap already |
19:31:25 | Araq | how hard can it be, just do the type specialization |
19:31:36 | FromGitter | <mratsim> (https://files.gitter.im/nim-lang/Nim/jbWy/2018-05-14_21-31-23.png) |
19:31:42 | FromGitter | <mratsim> fixed in the benchmark :P |
19:31:58 | Yardanico | make a PR :) |
19:32:03 | Yardanico | and also propose to disable flto maybe, but IDK |
19:32:10 | Yardanico | that probably will be `unfair` by their terms |
19:33:19 | Yardanico | you can always ask them |
19:37:23 | FromGitter | <mratsim> https://github.com/frol/completely-unscientific-benchmarks/pull/17 add your comment about flto |
19:37:28 | FromGitter | <mratsim> for me it doesn’t change anything |
19:37:59 | Yardanico | look at benchmark results on their readme :) |
19:38:09 | Yardanico | nim with markAndSweep was 0.55 before |
19:40:12 | Yardanico | @mratsim - your PR conflicts with repo |
19:42:45 | * | gmpreussner joined #nim |
19:43:38 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:44:34 | Yardanico | ah, no, sorry about FLTO, it has nothing to do with performance |
19:45:11 | Yardanico | LMAO https://github.com/2vg/js |
19:46:19 | Araq | btw to test for the upcoming Nim version, use 'when not defined(nimrod)' |
19:46:23 | Araq | it's a secret :P |
19:46:48 | Araq | we claim the upcoming version is not idiotic anymore or something like that... |
19:47:44 | Yardanico | so all "nimrod" references will finally be removed? :P |
19:49:41 | * | jjido joined #nim |
19:52:22 | * | jjido quit (Client Quit) |
19:54:16 | enthus1ast | Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks. |
19:54:51 | * | gmpreussner quit (Ping timeout: 240 seconds) |
19:55:21 | FromGitter | <mratsim> @Yardanico : https://github.com/2vg/js/issues/1 |
19:56:27 | Yardanico | never seen that "(•ิ_•ิ)?" before btw, but that's probably offtopic :) |
20:00:46 | * | gmpreussner joined #nim |
20:01:17 | * | noonien quit (Quit: Connection closed for inactivity) |
20:03:59 | * | yglukhov joined #nim |
20:04:20 | enthus1ast | sorry ... |
20:04:34 | * | Trustable quit (Remote host closed the connection) |
20:06:47 | FromGitter | <mratsim> look for kaomoji :P |
20:08:37 | Yardanico | well, I know a few of them, but thanks. |
20:08:43 | * | CodeVance joined #nim |
20:15:57 | * | Sembei quit (Ping timeout: 240 seconds) |
20:16:24 | * | gmpreussner quit (Read error: Connection timed out) |
20:25:39 | * | jrbrt joined #nim |
20:33:17 | * | gmpreussner joined #nim |
20:34:34 | * | icebattle quit (Quit: leaving) |
20:37:04 | FromGitter | <diegogub> guys, finished a cqrs prototype using nim..I love nim ✨ |
20:37:17 | FromGitter | <zetashift> Nice!! |
20:38:01 | * | jrbrt quit (Quit: jrbrt) |
20:38:54 | FromGitter | <diegogub> really amazing..turned 1k+ lines of boiler plate (in Golang), into few lines of clear code...I will share the macros/ templates when ready |
20:39:04 | * | jrbrt joined #nim |
20:43:37 | FromDiscord | <crem> Is there a nice console multiplatform library for nim? For nice text mode dashboards. |
20:48:48 | FromGitter | <zetashift> like ncurses? |
20:49:57 | * | brainproxy joined #nim |
20:52:41 | dom96 | You can get pretty far doing what I've done here: https://github.com/dom96/deauther |
20:56:22 | * | ahmed___ joined #nim |
20:56:32 | * | ahmed___ quit (Client Quit) |
20:59:20 | * | nsf quit (Quit: WeeChat 2.1) |
21:01:09 | * | aeldemery joined #nim |
21:04:34 | * | miran quit (Ping timeout: 264 seconds) |
21:13:05 | Araq | I think the time is ripe to finally make the "variable not initialized" warning the default for all new code |
21:13:17 | * | CodeVance quit (Quit: Leaving) |
21:13:27 | Araq | and the warning should become an error eventually |
21:14:00 | Araq | sucks a bit for my habit of relying on 'result = default(T)' |
21:14:43 | Araq | but I think it makes Nim much less error prone for everybody else :P |
21:35:09 | subsetpark | Araq: even for `result` in normal procedure code? |
21:42:09 | Araq | yes. |
21:42:29 | subsetpark | Great googly moogly! |
21:49:51 | * | gmpreussner quit (Ping timeout: 255 seconds) |
21:49:58 | * | aeldemery quit (Remote host closed the connection) |
21:51:53 | * | gmpreussner joined #nim |
21:52:47 | FromGitter | <mratsim> wow, that’s radical, there are some code (trees ?) I don’t even know how to prove it to the compiler. Even when I assign every field I get the warning. |
21:57:36 | FromGitter | <mratsim> @Araq, if I want to fix genericReset, I suppose I have to start here: https://github.com/nim-lang/Nim/blob/88cf6573e04bd7ee8762aa336460b9748f0d4644/compiler/cgen.nim however I’m not too sure of what you mean by type specialization. What makes sense for me is if the compiler can prove than every variable is initialized, you can skip the genericReset. |
21:57:49 | * | rockcavera quit (Remote host closed the connection) |
22:08:23 | * | SenasOzys quit (Remote host closed the connection) |
22:09:47 | * | SenasOzys joined #nim |
22:16:29 | * | rauss quit (Quit: WeeChat 2.1) |
22:17:01 | FromGitter | <xmonader> Hi who is up? |
22:18:29 | dom96 | me! |
22:19:09 | FromGitter | <xmonader> so at work today i was bit free and i wrote this https://gist.github.com/xmonader/8e60b3311d0f4a2b460444c3f6a45da8 and seriously considering porting it to nim if there's no other solution |
22:19:13 | * | rauss joined #nim |
22:19:47 | * | xet7 quit (Remote host closed the connection) |
22:19:52 | FromGitter | <zetashift> Isn't that like Option[T]? |
22:20:03 | FromGitter | <mratsim> #Nim never sleeps |
22:20:07 | FromGitter | <xmonader> this is python not nim :D |
22:20:28 | Araq | use scanp or write your own variant of it |
22:20:35 | FromGitter | <xmonader> I'm a big fan of using Maybe types, but nim prefers exceptions |
22:20:44 | FromGitter | <zetashift> Also nim has this: https://github.com/superfunc/maybe/blob/master/src/maybe/maybe.nim |
22:20:55 | Araq | this Either FP nonsense is never going to give you performance ;-) |
22:21:38 | Araq | it also doesn't compose, yeah yeah, I know, I know, I simply don't understand FP |
22:21:49 | FromGitter | <xmonader> @zetashift i like the library |
22:22:21 | Araq | my 'add' works on seqs and + on ints, you know what I need to do to make it work on Maybes? lift the operation. |
22:22:30 | FromGitter | <xmonader> @Araq I've nothing against people who don't like FP, maybe u r right about performance, maybe haskell dudes do some serious optimizations, don't know, but for me it kind bit easier to reason about and to compose |
22:22:46 | Araq | it does not compose. |
22:22:54 | Araq | it requires you to lift everything. |
22:23:18 | Araq | it's like reinventing 0 but in a worse way. |
22:23:43 | Araq | I don't understand why the FP people don't understand their own terminology they are so fond of. |
22:24:07 | FromGitter | <xmonader> as long as the language provides the syntax to hide the boilerplate of the wrapping/unrwapping, lifting it's cool |
22:24:18 | Araq | oh really? |
22:24:37 | Araq | then why doesn't Rust's + for integers returns an Either/Maybe. |
22:24:45 | Araq | it can overflow, after all. |
22:25:09 | Araq | and why does Haskell have exceptions. |
22:25:20 | Araq | if your precious Either/maybe does work so well... |
22:26:33 | FromGitter | <xmonader> if rust doesn't have a reason to have exceptions don't think haskell has too :D |
22:26:39 | Araq | oh and out of memory is a thing too, so your tuple constructor better returns an Either |
22:27:01 | Araq | but the Either creation can fail, so better wrap it in an Either[Either[T]]... |
22:27:03 | FromGitter | <xmonader> but everything i saw makes use of either types generally |
22:27:40 | FromGitter | <mratsim> @xmonader here is your Nim FP library: https://github.com/vegansk/nimfp |
22:27:43 | FromGitter | <xmonader> :D :D I don't code with memory in mind at first, i never optimize unless there's an issue |
22:28:00 | FromGitter | <xmonader> thanks @mratsim |
22:28:13 | FromGitter | <zetashift> I like that one |
22:28:20 | FromGitter | <xmonader> but still i didn't get a feedback on the parsec thing itself if it's worth it to port to nim |
22:28:28 | FromGitter | <mratsim> Haskell GHC is a very well tuned piece of software. (Haskell was my first lang) |
22:28:49 | Araq | so let's check what Haskell's plus operator does |
22:28:53 | FromGitter | <mratsim> Haskell has exceptions >_> |
22:29:37 | FromGitter | <xmonader> it does and there's a catch too but i never saw it used in any of the codes i saw, maybe didn't see enough too |
22:29:52 | FromGitter | <zetashift> I don't know, does Nim even have a parser combinator lib? |
22:30:08 | FromGitter | <mratsim> the haskell wiki has a lengthy post about errors/exceptions iirc |
22:30:56 | Araq | https://groups.google.com/forum/#!topic/comp.lang.haskell/JAU8Nhpv3KM |
22:31:04 | FromGitter | <xmonader> i found this by @PMunch https://github.com/PMunch/combparser/blob/master/src/combparser.nim |
22:31:09 | Araq | " If I run my code (below), it |
22:31:11 | Araq | overflows silently and outputs garbage." |
22:31:24 | Araq | are you really really telling me the Haskell guys do not understand the Either monad? |
22:31:27 | * | rockcavera joined #nim |
22:31:27 | FromGitter | <xmonader> but it looks different than parsec codes in ocaml/haskell in general |
22:31:53 | Araq | or maybe, just maybe, they know it doesn't work for arithmetic. :P |
22:32:09 | Araq | like the Rust people do. |
22:32:15 | Araq | and the Swift ones. |
22:34:44 | Araq | I can write a 'try' macro that turns f(g(x, y)) into let (val, e) = g(x, y); if e: return e; let (val2, e2) = f(val); if e2: return e2 |
22:35:20 | Araq | yay, I reinvented exceptions but it's better because it's a monad |
22:36:42 | FromGitter | <xmonader> don't think haskell ppl force the monad terminology as the only way to handle exceptions or to do IO, they proposed a way the works within the language with min. effect i believe |
22:39:45 | Araq | no, the Haskell people know it actually doesn't work well. especially not if you think that boilerplate doesn't avoid bugs, it encourages them. Open to debate, I guess. |
22:39:50 | * | rauss quit (Quit: WeeChat 2.1) |
22:40:09 | * | rauss joined #nim |
22:40:40 | * | rauss quit (Client Quit) |
22:41:16 | FromGitter | <xmonader> let's not mention `lens` library for nim then :D |
22:42:03 | * | rauss joined #nim |
22:52:22 | Araq | it's fine to use whatever FP technique that you like but don't force it into the stdlib |
22:54:03 | FromGitter | <xmonader> doesn't nim already adapt option, flatmap and many of that already? https://nim-lang.org/docs/options.html |
22:54:14 | Araq | and for a parser generator, a macro based approach beats the shit out of manually constructing grammar data structures |
22:55:20 | FromGitter | <xmonader> @araq I'd love to see a parser generator in nim, not sure if there's any? |
22:55:45 | FromGitter | <xmonader> was planning to try to do lex/yacc in nim anyways.. |
22:56:27 | Araq | 'scanp' is pretty bad but it was a starting point |
22:57:12 | Araq | the code it produces is good, but the DSL is meh ... |
22:58:09 | Araq | pegs.nim pretty much does what you're after and is not optimizable because there is nothing that gets to see the full picture at compile-time, it's shifted to runtime. |
22:58:40 | FromGitter | <xmonader> I was trying to construct a tree but the peg in nim is matching only correct? |
22:59:12 | Araq | true. |
22:59:20 | FromGitter | <xmonader> I wanted to do a math evaluator or calculator with variables, was able to validate the grammar but couldn't find a way to construct the tree |
22:59:44 | Araq | well usually tree construction is outside the scope of a parser generator |
22:59:59 | Araq | which is why they are so useless but I digress |
23:01:45 | FromGitter | <xmonader> I'd say i'm experienced with http://www.dabeaz.com/ply/ and did many projects using it and the ast/parsing are both in the same step so it was very great, but with peg i just didn't know what to do |
23:02:10 | FromGitter | <xmonader> If i move to a hand written parser then what's the point of matching peg? |
23:03:51 | Araq | I'm not saying that |
23:05:30 | Araq | tree construction is awesome, I missed it in your gist |
23:05:36 | Araq | but it's late |
23:33:17 | * | SenasOzys__ joined #nim |
23:33:31 | * | SenasOzys quit (Remote host closed the connection) |
23:42:27 | * | gokr quit (Ping timeout: 240 seconds) |
23:45:14 | * | leorize joined #nim |
23:48:24 | * | skrylar joined #nim |
23:48:41 | * | skrylar boops mratsim. do you think arraymancer is sufficicently built to run tacotron2 |
23:55:59 | * | ftsf joined #nim |
23:57:32 | Araq | any good json benchmarks around? |
23:59:15 | FromGitter | <xmonader> http://seriot.ch/parsing_json.php#4 @Araq |