<< 14-05-2018 >>

00:08:08FromDiscord<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:16FromGitter<Varriount> nimwc?
01:10:32*cspar quit (Ping timeout: 250 seconds)
01:18:13*athenot joined #nim
01:36:52FromDiscord<2vg> https://nimwc.org
01:37:14FromDiscord<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:55FromGitter<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:35m712:( 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:37dom96m712: 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:18PMunchm712, if you want a Nim REPL I suggest checking out inim
10:00:29PMunchIt appears to handle import os just fine
10:00:37PMunchIt works by compiling in the background
10:00:45adeohluwaSigsegv illegal storage access (attempt to read from nil?)
10:01:06adeohluwaPMunch: bn using it... its cool
10:01:18*FuntDobra_ joined #nim
10:01:59PMunchNot as fast as nim secret though
10:02:15adeohluwaam trying to read from 4 variables that might turn out to be nil
10:03:38adeohluwaPMunch: hmm... those repls need the equivalent of dir() & help() in python & thats it!
10:04:01*FuntDobra quit (Ping timeout: 256 seconds)
10:07:27enthus1astadeohluwa: if not variable.isNil
10:08:24PMunchHmm, it would be cool to have access to doc-comments at compile-time
10:08:40PMunchNot sure what they would be used for outside a REPL, but would be cool none-the-less
10:10:17enthus1astit 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:31adeohluwaenthus1ast: any one of 4 variables could be nil
10:12:10PMunchSo add a nil check for all those variables..
10:18:17adeohluwawhat causes an out of memory error in nim language?
10:18:48PMunchThat 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:35adeohluwaPMunch: I want to skip the values that return nil
10:24:27PMunchWhat do you mean skip?
10:25:54*dddddd joined #nim
10:26:27adeohluwaPMunch: ix.io/1ahJ
10:30:24enthus1astyou could also test them in one if, if you `and` test all cases
10:31:26PMunchMaybe something like this: http://ix.io/1ahP/Nim
10:32:08enthus1astkuhl PMunch :)
10:33:39PMunchHmm, didn't seem to work though..
10:34:09PMunchAah, it didn't like the for loop with the varargs..
10:36:46enthus1astadeohluwa: 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:06adeohluwaPMunch: yes it didn't work
10:39:27adeohluwaIterator within for loop context expected
10:41:52adeohluwausing multiple and's I get out of memory
10:42:16PMunchHold on a sec
10:42:50enthus1asti would use an iterator
10:43:01enthus1astfor line in data.lines:
10:43:23PMunchReplace it with that: http://ix.io/1ahR/nim
10:43:56PMunchHmm, I guess that should really be renamed to "anyNil"
10:45:00enthus1astit 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:25enthus1astatm you "wait for all data" then you split lines, so you need even more memory
10:46:26enthus1astit seems that you want to write a "unix filter" like? Then clearly iterate over the lines of data
10:49:53adeohluwaenthus1ast: thats what I do
10:50:12adeohluwathe data is coming from an external source
10:50:34adeohluwacat xyz | ./script.nim
10:50:56enthus1astthen use sdtin.readLine
10:51:02enthus1aststdin
10:52:39adeohluwathat will only read a single line
10:52:52adeohluwaread all reads entire file then splits it into lines
10:53:18PMunchwhile not stdin.atEnd: stdin.readLine
10:53:53*cspar joined #nim
10:54:02enthus1astit may not possible to determine the end of the stream
10:54:27enthus1astso try reading from the stream and catch the io error :D
10:54:57*FuntDobra_ quit (Ping timeout: 264 seconds)
10:56:14enthus1astadeohluwa: 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:48enthus1astthis way you avoid holding the whole file im memory (a few times even)
10:58:04enthus1astand the other effect is, that you dont have to wait for the whole file to be processed.
10:58:25PMunchYeah, theoretically your input can be a slow-echoing script
10:58:38PMunchAnd you will process the lines as they appear
11:06:56adeohluwaenthus1ast: 😃
11:07:27adeohluwaPMunch: readline reads only first line
11:07:58adeohluwaI'm using cat to read URLs to stdout from a text file
11:10:13PMunchadeohluwa, yes, that's why it is in a loop
11:12:23*yglukhov quit (Remote host closed the connection)
11:13:12PMunchhttp://ix.io/1ai1/Nim
11:13:24PMunchSomething like that should do what you want, while not running out of memory
11:14:04PMunchOh wait, you might get an error that url is a TaintedString, so pass it through $ first
11:16:12enthus1astresult = ""
11:18:46PMunchHuh?
11:18:57PMunchOh yeah
11:19:14PMunchOr remove the string return type, not sure what that's supposed to do
11:19:30PMunchMaybe the idea was to not echo inside the getData but concatenate a string instead
11:20:36*FuntDobra_ joined #nim
11:24:16adeohluwalet me try it out now...
11:27:21*sendell joined #nim
11:29:17adeohluwaPMunch: the string return type from getData()?
11:29:37PMunchYeah, your getData proc returns a string
11:29:43PMunchBut no string is actually returned :P
11:29:58adeohluwatrue 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:36adeohluwamacro now works perfect
11:51:44adeohluwastill get out of memory error
11:52:05adeohluwaremoving 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:58PMunchRemoving the return type causes an error?
11:59:05PMunchCould 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:31PMunchThis works fine: http://ix.io/1aie/Nim
12:02:49PMunchBut 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:43dom96hrm, I wonder why 0.13.0 docs are showing up in google searches so much
12:05:30*Snircle joined #nim
12:05:51Yardanicodom96, where? in google?
12:06:10dom96...yes?
12:12:35*couven92 quit (Quit: Client disconnecting)
12:13:02PMunchHmm, random is deprecated?
12:13:25PMunchOh, just the proc :P
12:15:48Yardanicodom96, that can be a thing related to your past searches
12:18:58*FuntDobra quit (Ping timeout: 264 seconds)
12:19:38PMunchHmm, 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:13enthus1astNim is "hyped" nice :)
12:21:58dom96`nim compile --opt:speed --out:main-nim main.nim`
12:22:00enthus1ast"nim compile --opt:speed --out:main-nim main.nim" is the line
12:22:08dom96My pet peeve
12:22:16PMunchhttps://github.com/frol/completely-unscientific-benchmarks/pull/1
12:22:25PMunchNice, def- already on it :P
12:24:22*couven92 joined #nim
12:24:50YardanicoMy results are - 3.4sec without -d:release (with opt speed), and 0.9s with -d:release :D
12:26:00YardanicoBut 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:16shashlickWell I hope they rerun the test instead of just accepting the readme change
12:26:56shashlickAlthough I'm curious if Nim could be faster without -d: release too
12:26:58PMunchHmm, with --gc:boehm|markAndSweep|regions I drop almost another second
12:27:25YardanicoPMunch, yeah, I get 0.58sec instead of 0.9sec
12:27:35Yardanicowith mark and sweep
12:28:35PMunchThat should probably be requested as well then
12:29:05dom96Well, this is "naive" so there should be a limit to how far you take the optimisations
12:29:21dom96otherwise we'll all be tinkering until we start optimising the asm and so will other langs
12:29:48PMunchWell, enabling a faster gc isn't all that much tinkering :P
12:30:00shashlickDo we need to optimize debug mode a bit? Or have an ugly banner informing it is debug mode
12:30:15Yardanicoshashlick, what for? after all programmers should read docs
12:30:36Yardanicowell, maybe it should be optimized, but it's not that important really
12:31:48shashlickI don't know, according to these results, Nim is as slow as python which is ridiculous
12:32:08Yardanicoshashlick, well, that's debug mode
12:32:17FromGitter<narimiran> can we make it even faster? :)
12:32:33shashlickWe can say user error but newbies will bumble through
12:32:36Yardanicoyeah, but AFAIK the goal of this benchmark is not optimize for every language
12:32:45shashlickShould make it obvious somehow
12:34:01PMunchAppend _debug to the name of the binary when not compiled with -d:release
12:34:13shashlickWell are they building rust in debug mode
12:34:36shashlickThat will break scripts
12:35:53shashlickThey use -O for rust so it is isn't unoptimised
12:36:51shashlickEverywhere else, -O3 etc
12:37:14shashlickWe need to see if there's something we can do to make it clear
12:37:46shashlickThey did try with --opt:speed but it wasn't good enough
12:40:59PMunchI mean it literally says: "Note: use -d:release for a release build!" in the --help message for --opt:speed..
12:41:23shashlickWhy doesn't --opt:speed or size imply release?
12:41:42shashlickDoes performance change in debug mode
12:41:51PMunchBecause some people probably don't want to disable all the checks that -d:release disables
12:41:59PMunchSo they create their own "release" configuration
12:44:49Yardanicohttps://github.com/frol/completely-unscientific-benchmarks/commit/cf0a23061bf5c8f6c5a1f0ea031c1f4416fea45c
12:44:51Yardanico:)
12:45:04Yardanicofrom 3.94 to 0.55
12:45:10PMunchNice
12:45:23YardanicoSame speed as C++ (ref-counted)
12:46:11YardanicoPMunch, also, memory usage with markAndSweep is much higher
12:46:20Yardanicoso it's a memory/speed tradeoff https://github.com/frol/completely-unscientific-benchmarks/pull/1#issuecomment-388803315
12:48:02FromGitter<narimiran> both versions should be posted, IMO
12:48:21*cspar quit (Ping timeout: 264 seconds)
12:48:36PMunchTried with boehm, v2, or regions?
12:50:11PMunchOuch, Java memory consumption x375 :P
12:50:20YardanicoPMunch, :D
12:50:42shashlickWell they should also clarify that they used gcc as the backed
12:50:52shashlickElse it looks like Nim is slower than clang
12:51:14PMunchHe tried with clang and it was slower than without..
12:51:28PMunchWould be interesting to see the js target as well
12:51:31YardanicoPMunch, but he should specify GCC used for Nim :)
12:51:38Yardanico*that
12:52:03shashlickWhat does it say if you compile with --opt:speed but not -d:release
12:52:12shashlickDoes it still say debug mode in the hint
12:52:28shashlickDon't have my laptop in front of me right now
12:53:01FromGitter<narimiran> @Yardanico i posted a comment under PR, also stating to update the compiler column
12:53:08shashlickWhy would it be slower with clang if he got better results
12:53:22Yardanicoshashlick, he got worse results with clang than with gcc
12:53:24Yardanicowith -d:release
12:53:35Yardanicoand --gc:markAndSweep. like 2x slower with clang
12:53:50shashlickOh never mind, I didn't see ref pointers vs raw
12:54:09shashlickThought he did gcc vs clang
12:55:55*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:57:24shashlickStill x13 memory
12:58:02PMunchYeah, would be interesting to try with the other gcs as well
12:58:31shashlickIs there anything else obvious in the code itself
12:58:36FromGitter<narimiran> @shashlick: it is because of gc used. by default it is 1/10 of that
12:59:34shashlickWhich gc is he using?
12:59:49*cspar joined #nim
12:59:50shashlickOh I see
13:00:25shashlickHe should probably give results for both default and m&s if possible
13:00:43shashlickTo make it clear you can optimize for either
13:00:48Yardanicoalso v2 gc is a bit (like ~150ms) faster than current default GC
13:01:32FromGitter<narimiran> a bit? that's 15%! :D
13:02:59FromGitter<narimiran> here we go, he updated the table to include both results
13:03:05Yardanicowell, no, it runs like 0.9s with default GC :)
13:03:14*Ven`` joined #nim
13:03:52FromGitter<narimiran> ok, 16%, sorry
13:04:18Yardanicooh yeah, sorry, actually that's true
13:04:48Yardanicoah, sorry, I'm dumb
13:05:26Yardanicoor not, I'm not dumb. 0.924s without gcv2, 0.780 with it
13:05:50shashlickPoor guy, we are on his case!
13:06:28shashlickStill slower than rust which is annoying
13:06:38Yardanicoshashlick, slower than what version of rust?
13:06:44YardanicoRust "ref-counted" is 0.66
13:06:55Yardanicoand 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:36shashlickStill 30 lines shorter
13:11:24Yardanicothat's the thing - nim is probably one of the best languages with good trade-off between speed and development time
13:14:31shashlickThat'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:35PMunchhttps://i.imgur.com/1Xz3Elo.png
13:41:07PMunchComparison of Nim's GC options and their performance on this benchmark measured on my machine
13:41:45PMunchNot sure why he saw an increase from 0.5 to 5 Mib though..
13:41:51*nsf quit (Quit: WeeChat 2.1)
13:42:11PMunchThe largest there is 3108 KiB
13:42:38PMunch1444 KiB on the recursive thing
13:43:51PMunchregions seems to be the best performance
13:44:13PMunchFollowed by markAndSweep (boehm is slightly faster, but uses a lot more memory)
13:44:52PMunchOf 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:09shashlickstill trying to figure out how to get autocomplete and suggestions working on vim - which plugin(s) to use?
14:32:51federico3neovim + nim.vim
14:33:40federico3(+ vim-gitgutter, vim-fugitive, neomake... )
14:34:27shashlickdo we have omnicomplete yet?
14:34:51shashlickdon't think deoplete works
14:34:55*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:34:57shashlickale is good for syntax checking
14:35:33PMunchCouldn't we just write the language server protocol thingy..
14:36:23PMunchHmm, interesting that a tuple and an object have different performance
14:37:06shashlickfederico3: any reason why neovim vs vim8 for you?
14:38:40*Ven`` joined #nim
14:39:35PMunchHuh, it seems like objects enter the C code while tuples are completely abstracted away by the Nim compiler
14:40:38PMunchOh no wait, they do exist
14:41:29FromGitter<data-man> @PMunch: Which is faster?
14:42:09PMunchtuples
14:42:14PMunchNot by much though
14:42:53FromGitter<data-man> Good. I like tuples. :)
14:44:48federico3shashlick: I switched due to the async stuff
14:48:17PMunchOn 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:17PMunchAnd 1.31 when I use a ref object
14:50:25shashlickso 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:16shashlickso many open PRs on nim.vim
15:03:12PMunchNim 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:40PMunchMemory on par with raw-pointers C++, and speed only at 2.5x increase
15:04:57FromGitter<mratsim> Why does this even speed the benchmark? https://github.com/frol/completely-unscientific-benchmarks/commit/690d3ef42aad1bc1ffcef8d69d80c7328bdfbe96
15:05:22PMunchNot sure TBH..
15:06:08PMunchBut 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:09FromGitter<mratsim> I think you should use result.lower, result.equalGreater
15:06:24FromGitter<mratsim> instead of a let then object construction
15:06:24PMunchCan you do that?
15:06:28FromGitter<mratsim> of course
15:06:43FromGitter<mratsim> (result.lower, result.equalGreater) = splitBinary also works
15:08:14FromGitter<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:42PMunchHmm, passible
15:10:46PMunch*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:47jxyFor a fair comparison, they need to write a ptr version of the code in Nim, too.
15:22:24jxyWe do need a macro that strips away the let bindings of objects to minimize copying.
15:22:26def-jxy: why don't you supply one?
15:23:05*FuntDobra quit (Ping timeout: 240 seconds)
15:23:28FromGitter<zetashift> Still pretty impressive that a GC'd lang can go toe to toe with Rust and C++
15:23:38jxyit would be exactly like the c version except for the syntax.
15:23:50FromGitter<zetashift> D + LDC would also be pretty darn close to it
15:26:14Araqbetter would be if we could ensure the copies get optimized away
15:26:23Araqptr version is a sad compromise
15:26:41AraqI think the planned copy elisions will get us there
15:28:27jxywhat'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:28FromGitter<mratsim> I’ve been waiting for those for a year :D
16:11:49FromGitter<mratsim> but it’s dependant on escape analysis which is tough no?
16:11:54FromGitter<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:43Yardanico 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:29shashlickbrilliant 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:37PMunchHmm, when I compile with 0.18.0 it uses 5MiB of memory, but when I compile with devel it uses 768KiB
17:06:42PMunchBoth with markAndSweep
17:06:44Araqjxy, real soon now (TM)
17:08:31miranPMunch: one more reason to release a new stable version ;)
17:10:09Yardanicomaybe we can ask the author so he will use devel version
17:10:11*yglukhov quit (Ping timeout: 255 seconds)
17:10:15Yardanicoe.g. he uses rust nightly
17:14:32*jrbrt_ joined #nim
17:14:46*jrbrt quit (Ping timeout: 276 seconds)
17:17:02YardanicoPMunch, he's probably surprised by our activity :)
17:17:48miranYardanico: i think this explaines "nim fanboys" reactions on reddit when someone mentions nim :D
17:18:54Yardanicomiran, but we're not trying to offend people using other languages :)
17:18:57Yardanico*almost*
17:19:10miran;)
17:19:48*CodeVance joined #nim
17:21:32*PMunch quit (Quit: leaving)
17:28:01*FuntDobra joined #nim
17:29:01FromGitter<data-man> @Araq: When araq-big-refactoring will be merged? Works for me. (TM) :)
17:29:38Yardanicowhat is the purpose of it? remove globals from compiler code?
17:30:27FromGitter<data-man> Yes. And other changes. :)
17:40:29FromGitter<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:49miranmratsim: even that seems too much for those non-nim folks that keep reacting....
17:42:10FromGitter<mratsim> They already got the Rust vaccine anyway :P
17:42:47FromGitter<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:53Araqdata-man: https://ci.appveyor.com/project/Araq/nim/build/4221/tests
17:43:58Araqwhen the tests are green
17:44:02*floppydh quit (Quit: WeeChat 2.1)
17:44:10Araqwhich look really good
17:44:32Araqonly the expected differences in the error messages
17:44:52Araqglad it worked out so well given that I pretty much touched every line in the compiler...
17:46:56AraqYardanico, 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:12YardanicoAraq, ah, ok, thanks for clarification!
17:47:33Yardanicowow, appveyor can show different test names?
17:47:34Yardanicohttps://ci.appveyor.com/project/Araq/nim/build/4221/tests
17:48:07*gmpreussner quit (Ping timeout: 256 seconds)
17:48:34Araqit's also about giving the new compiler devs some hints of how things should be done
17:49:09Araqdon't need more of the old crap in Nim.
17:51:00miran@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:15FromGitter<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:59miranofftopic: those of you who use ix.io - how do you use it? how do you create your pastes?
18:32:44shashlickmiran: https://github.com/genotrance/snip/blob/b03a48965b3c689a1f9235bf03f90c537e4ed19f/src/snip/gist.nim#L73
18:33:12*gmpreussner joined #nim
18:35:10miranshashlick: thanks
18:39:48FromGitter<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:48FromGitter... explicitly says: ```
18:39:56FromGitter<diegogub> ``````
18:40:10FromGitter<diegogub> ```code paste, see link```
18:40:28Yardanicowell, that's your opinion :)
18:40:42Yardanicoand there's a lot of procs in json/tables/etc so you can check if key exist
18:41:51FromGitter<diegogub> I know, actually I did a library to avoid this exceptions..
18:42:38FromGitter<diegogub> a json not having a key is quite common..also a http request without a param is common too
18:42:47Yardanicothat's why we have a {} template in json module
18:42:58Yardanicoand what about http requests without params?
18:43:36FromGitter<diegogub> on the jester lib, when you do : request.params["id"] .. If the param is not set, exception is raised
18:43:45Yardanicowhat is params object?
18:43:49YardanicoI mean field
18:43:51Yardanicowhat type is it?
18:44:05FromGitter<diegogub> Let me check, I think is a Table
18:44:22Yardanicothere's a getOrDefault in tables
18:44:38Yardanicodiegogub: yeah, it's a StringTable from strtabs
18:44:48FromGitter<diegogub> StringTableRef
18:45:03Yardanicohttps://nim-lang.org/docs/strtabs.html
18:45:17Yardanicothere's getOrDefault, hasKey, contains for it
18:47:17Yardanicobtw, I really think that tables and strtabs modules should have {} template (as in json module)
18:47:23Yardanicoit's actually very useful and easy-to-use
18:47:43enthus1ast{}.toTable should work
18:47:54Yardanicoenthus1ast, I mean mytable{"a"}{"b"}
18:48:10Araqmytable{"a", "b"}
18:48:20Yardanicoyeah, this
18:49:17FromGitter<diegogub> I agree..
18:51:55*ahmed___ joined #nim
18:52:06*ahmed___ quit (Client Quit)
18:53:17miranoooh, 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:54FromGitter<mratsim> is it me or Nim is suddenly slower? https://github.com/frol/completely-unscientific-benchmarks
19:05:20Yardanicough
19:05:32Yardanicothat's because of LTO flag
19:05:40Yardanico(author enabled it for C++, Nim, Rust and Swift)
19:06:27*CodeVance quit (Ping timeout: 240 seconds)
19:06:28FromGitter<mratsim> I’ll bite, i’ll play with it and optimize it to C++ speed
19:06:40Yardanicoit was already at C++ (ref-counted) speed
19:06:44YardanicoBut it got SLOWER with LTO
19:07:27*gmpreussner quit (Ping timeout: 240 seconds)
19:08:07FromGitter<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:29Yardanicoalso 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:23FromGitter<Varriount> Hm, usually LTO has a small performance improvement with Nim
19:11:42Yardanicowell, this is like with any other benchmarks
19:11:44FromGitter<mratsim> well everything is in one file, LTO can do nothing
19:12:04YardanicoC++ got like 2x faster with it though
19:12:12FromGitter<mratsim> I’m surprised it can even slow down, did it import OS stuff?
19:12:52Yardanicobut yeah, you can go ahead and try to optimize it, it seems authors make some optimizations to C++
19:13:02Yardanicomratsim: it only imports random
19:13:05Yardanicowhich is a bit unfair too
19:13:14*gmpreussner joined #nim
19:14:50FromGitter<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:54FromGitter<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:12FromGitter<mratsim> look at all those genericResets
19:19:19FromGitter<mratsim> (https://files.gitter.im/nim-lang/Nim/Qy95/2018-05-14_21-18-54.png)
19:20:01FromGitter<mratsim> (https://files.gitter.im/nim-lang/Nim/RbLu/2018-05-14_21-19-47.png)
19:20:11FromGitter<mratsim> FractalReset >_>
19:22:41*gmpreussner quit (Quit: kthxbye)
19:26:58*jrbrt_ quit (Quit: jrbrt_)
19:27:25FromGitter<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:48FromGitter<mratsim> Time divided by 2 on my machine: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5af9e370d245fe2eb7ad9bec]
19:28:56FromGitter<mratsim> so we should be as fast as C++
19:29:48FromGitter<mratsim> flto doesn’t change anything for me though
19:31:01Araqgosh just fix that genericReset crap already
19:31:25Araqhow hard can it be, just do the type specialization
19:31:36FromGitter<mratsim> (https://files.gitter.im/nim-lang/Nim/jbWy/2018-05-14_21-31-23.png)
19:31:42FromGitter<mratsim> fixed in the benchmark :P
19:31:58Yardanicomake a PR :)
19:32:03Yardanicoand also propose to disable flto maybe, but IDK
19:32:10Yardanicothat probably will be `unfair` by their terms
19:33:19Yardanicoyou can always ask them
19:37:23FromGitter<mratsim> https://github.com/frol/completely-unscientific-benchmarks/pull/17 add your comment about flto
19:37:28FromGitter<mratsim> for me it doesn’t change anything
19:37:59Yardanicolook at benchmark results on their readme :)
19:38:09Yardaniconim with markAndSweep was 0.55 before
19:40:12Yardanico@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:34Yardanicoah, no, sorry about FLTO, it has nothing to do with performance
19:45:11YardanicoLMAO https://github.com/2vg/js
19:46:19Araqbtw to test for the upcoming Nim version, use 'when not defined(nimrod)'
19:46:23Araqit's a secret :P
19:46:48Araqwe claim the upcoming version is not idiotic anymore or something like that...
19:47:44Yardanicoso all "nimrod" references will finally be removed? :P
19:49:41*jjido joined #nim
19:52:22*jjido quit (Client Quit)
19:54:16enthus1astChoose 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:21FromGitter<mratsim> @Yardanico : https://github.com/2vg/js/issues/1
19:56:27Yardaniconever 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:20enthus1astsorry ...
20:04:34*Trustable quit (Remote host closed the connection)
20:06:47FromGitter<mratsim> look for kaomoji :P
20:08:37Yardanicowell, 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:04FromGitter<diegogub> guys, finished a cqrs prototype using nim..I love nim ✨
20:37:17FromGitter<zetashift> Nice!!
20:38:01*jrbrt quit (Quit: jrbrt)
20:38:54FromGitter<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:37FromDiscord<crem> Is there a nice console multiplatform library for nim? For nice text mode dashboards.
20:48:48FromGitter<zetashift> like ncurses?
20:49:57*brainproxy joined #nim
20:52:41dom96You 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:05AraqI 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:27Araqand the warning should become an error eventually
21:14:00Araqsucks a bit for my habit of relying on 'result = default(T)'
21:14:43Araqbut I think it makes Nim much less error prone for everybody else :P
21:35:09subsetparkAraq: even for `result` in normal procedure code?
21:42:09Araqyes.
21:42:29subsetparkGreat 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:47FromGitter<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:36FromGitter<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:01FromGitter<xmonader> Hi who is up?
22:18:29dom96me!
22:19:09FromGitter<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:52FromGitter<zetashift> Isn't that like Option[T]?
22:20:03FromGitter<mratsim> #Nim never sleeps
22:20:07FromGitter<xmonader> this is python not nim :D
22:20:28Araquse scanp or write your own variant of it
22:20:35FromGitter<xmonader> I'm a big fan of using Maybe types, but nim prefers exceptions
22:20:44FromGitter<zetashift> Also nim has this: https://github.com/superfunc/maybe/blob/master/src/maybe/maybe.nim
22:20:55Araqthis Either FP nonsense is never going to give you performance ;-)
22:21:38Araqit also doesn't compose, yeah yeah, I know, I know, I simply don't understand FP
22:21:49FromGitter<xmonader> @zetashift i like the library
22:22:21Araqmy '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:30FromGitter<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:46Araqit does not compose.
22:22:54Araqit requires you to lift everything.
22:23:18Araqit's like reinventing 0 but in a worse way.
22:23:43AraqI don't understand why the FP people don't understand their own terminology they are so fond of.
22:24:07FromGitter<xmonader> as long as the language provides the syntax to hide the boilerplate of the wrapping/unrwapping, lifting it's cool
22:24:18Araqoh really?
22:24:37Araqthen why doesn't Rust's + for integers returns an Either/Maybe.
22:24:45Araqit can overflow, after all.
22:25:09Araqand why does Haskell have exceptions.
22:25:20Araqif your precious Either/maybe does work so well...
22:26:33FromGitter<xmonader> if rust doesn't have a reason to have exceptions don't think haskell has too :D
22:26:39Araqoh and out of memory is a thing too, so your tuple constructor better returns an Either
22:27:01Araqbut the Either creation can fail, so better wrap it in an Either[Either[T]]...
22:27:03FromGitter<xmonader> but everything i saw makes use of either types generally
22:27:40FromGitter<mratsim> @xmonader here is your Nim FP library: https://github.com/vegansk/nimfp
22:27:43FromGitter<xmonader> :D :D I don't code with memory in mind at first, i never optimize unless there's an issue
22:28:00FromGitter<xmonader> thanks @mratsim
22:28:13FromGitter<zetashift> I like that one
22:28:20FromGitter<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:28FromGitter<mratsim> Haskell GHC is a very well tuned piece of software. (Haskell was my first lang)
22:28:49Araqso let's check what Haskell's plus operator does
22:28:53FromGitter<mratsim> Haskell has exceptions >_>
22:29:37FromGitter<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:52FromGitter<zetashift> I don't know, does Nim even have a parser combinator lib?
22:30:08FromGitter<mratsim> the haskell wiki has a lengthy post about errors/exceptions iirc
22:30:56Araqhttps://groups.google.com/forum/#!topic/comp.lang.haskell/JAU8Nhpv3KM
22:31:04FromGitter<xmonader> i found this by @PMunch https://github.com/PMunch/combparser/blob/master/src/combparser.nim
22:31:09Araq" If I run my code (below), it
22:31:11Araqoverflows silently and outputs garbage."
22:31:24Araqare you really really telling me the Haskell guys do not understand the Either monad?
22:31:27*rockcavera joined #nim
22:31:27FromGitter<xmonader> but it looks different than parsec codes in ocaml/haskell in general
22:31:53Araqor maybe, just maybe, they know it doesn't work for arithmetic. :P
22:32:09Araqlike the Rust people do.
22:32:15Araqand the Swift ones.
22:34:44AraqI 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:20Araqyay, I reinvented exceptions but it's better because it's a monad
22:36:42FromGitter<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:45Araqno, 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:16FromGitter<xmonader> let's not mention `lens` library for nim then :D
22:42:03*rauss joined #nim
22:52:22Araqit's fine to use whatever FP technique that you like but don't force it into the stdlib
22:54:03FromGitter<xmonader> doesn't nim already adapt option, flatmap and many of that already? https://nim-lang.org/docs/options.html
22:54:14Araqand for a parser generator, a macro based approach beats the shit out of manually constructing grammar data structures
22:55:20FromGitter<xmonader> @araq I'd love to see a parser generator in nim, not sure if there's any?
22:55:45FromGitter<xmonader> was planning to try to do lex/yacc in nim anyways..
22:56:27Araq'scanp' is pretty bad but it was a starting point
22:57:12Araqthe code it produces is good, but the DSL is meh ...
22:58:09Araqpegs.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:40FromGitter<xmonader> I was trying to construct a tree but the peg in nim is matching only correct?
22:59:12Araqtrue.
22:59:20FromGitter<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:44Araqwell usually tree construction is outside the scope of a parser generator
22:59:59Araqwhich is why they are so useless but I digress
23:01:45FromGitter<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:10FromGitter<xmonader> If i move to a hand written parser then what's the point of matching peg?
23:03:51AraqI'm not saying that
23:05:30Araqtree construction is awesome, I missed it in your gist
23:05:36Araqbut 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:32Araqany good json benchmarks around?
23:59:15FromGitter<xmonader> http://seriot.ch/parsing_json.php#4 @Araq