<< 08-09-2019 >>

00:00:01*junland quit (Quit: %ZNC Disconnected%)
00:01:16*junland joined #nim
00:08:59*Hideki_ joined #nim
00:13:11*Hideki_ quit (Ping timeout: 248 seconds)
00:24:05*NimBot joined #nim
00:26:47*PrimHelios quit (Quit: ZNC - https://znc.in)
00:30:02*wildtrees quit (Quit: Leaving)
00:30:24*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
00:30:37*laaron joined #nim
00:57:34*NimBot joined #nim
00:59:42FromGitter<mratsim> @awr1 I can run tests on my SLI system if you want, but after Sept 20th
01:01:08*laaron- joined #nim
01:01:17*laaron quit (Remote host closed the connection)
01:02:00*hoijui joined #nim
01:15:57*snooptek quit (Remote host closed the connection)
01:18:20*hoijui quit (Ping timeout: 244 seconds)
01:19:38*disruptek quit (Ping timeout: 245 seconds)
01:20:21*disruptek joined #nim
01:54:16*owl_000 joined #nim
01:58:41*owl_000 quit (Read error: Connection reset by peer)
02:00:16*krux02_ quit (Remote host closed the connection)
02:14:00*doesntgolf joined #nim
02:21:32*laaron- quit (Quit: ZNC 1.7.1 - https://znc.in)
02:22:39*laaron joined #nim
02:29:55*matlock1 quit (Read error: Connection reset by peer)
02:46:39skrylar[m]oh. well, rip. wanted to see how well tabnine worked with nim but they went sub-only.
02:49:03*laaron quit (Remote host closed the connection)
02:52:13*laaron joined #nim
03:00:43*laaron quit (Remote host closed the connection)
03:04:48*laaron joined #nim
03:11:20*snooptek joined #nim
03:28:05*KMan_CA joined #nim
03:28:58*KMan_CA left #nim (#nim)
03:34:28*chemist69 quit (Ping timeout: 276 seconds)
03:35:47*chemist69 joined #nim
03:46:36*dddddd quit (Remote host closed the connection)
05:05:20Hideki_Could anyone advise me how to convert a JSON hash table to Nim's object easily? I cannot do that with Marshal library.
05:05:20Hideki_let cnt = to[Table[string, int]]("{ \"Apple\": 1, \"Orange\": 2, \"Banana\": 3 }")
05:05:20Hideki_--> Error: unhandled exception: invalid field name: Apple [ValueError]
05:08:16*a_chou joined #nim
05:14:25leorizethe json module should do
05:21:13Hideki_let cnt = to(parseJson("{ \"Apple\": 1, \"Orange\": 2, \"Banana\": 3 }"), Table[string, int])
05:21:20Hideki_It works! Thank you leorize!
05:23:43*Romanson joined #nim
05:43:25leorizeglad it worked :)
05:44:01leorizesmall trick: let cnt = to(parseJson("""{ "Apple": 1, "Orange": 2, "Banana": 3 }"""), Table[string, int])
05:44:12leorizetriple quote will save you from having to escape quotes
05:56:47*solitudesf joined #nim
06:05:09Hideki_thanks
06:06:22FromGitter<awr1> @mratsim thanks for the offer, unfortunately i should really focus on making this renderer more concrete for single-GPU
06:06:36*Hideki_ quit (Remote host closed the connection)
06:07:10FromGitter<awr1> i was able to ask someone i knew w/ more experience using multi-GPU on vulkan though, turns out i didn't quite understand how device groups worked
06:07:48FromGitter<awr1> i was a little confused with the way queue operations worked
06:07:59FromGitter<awr1> within device groups
06:10:47*laaron quit (Remote host closed the connection)
06:13:29*tane_ joined #nim
06:13:56*a_chou1 joined #nim
06:14:25*laaron joined #nim
06:15:05*a_chou quit (Ping timeout: 250 seconds)
06:15:05*a_chou1 is now known as a_chou
06:39:10*Hideki_ joined #nim
06:45:42*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
06:48:08*laaron joined #nim
06:48:56*laaron quit (Remote host closed the connection)
06:50:08*Hideki_ quit (Ping timeout: 268 seconds)
06:54:25*laaron joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:42*gmpreussner joined #nim
07:06:34*a_chou quit (Quit: a_chou)
07:07:14*nsf joined #nim
07:09:37*doesntgolf quit (Ping timeout: 268 seconds)
07:24:34*fichtl joined #nim
07:55:10*Hideki_ joined #nim
07:59:16*Hideki_ quit (Ping timeout: 244 seconds)
07:59:31*hoijui joined #nim
08:04:31*laaron quit (Remote host closed the connection)
08:06:59*laaron joined #nim
08:13:49*absolutejam1 joined #nim
08:16:05*krux02 joined #nim
08:18:38*laaron quit (Remote host closed the connection)
08:19:25*hoijui quit (Ping timeout: 244 seconds)
08:20:13*laaron joined #nim
08:35:29*dom96 joined #nim
08:35:29*dom96 quit (Changing host)
08:35:29*dom96 joined #nim
08:35:54*Araq joined #nim
08:39:29dom96that's surprising, no negative values supported by CountTable? https://play.nim-lang.org/#ix=1Uzp
08:46:13*laaron quit (Remote host closed the connection)
08:48:52*laaron joined #nim
09:02:18*laaron quit (Remote host closed the connection)
09:02:36*gangstacat quit (Quit: Ĝis!)
09:04:03*laaron joined #nim
09:05:14*gangstacat joined #nim
09:05:55*absolutejam1 quit (Ping timeout: 244 seconds)
09:21:23*laaron quit (Remote host closed the connection)
09:23:36*laaron joined #nim
10:24:05*hoijui joined #nim
10:33:18*dddddd joined #nim
10:36:32*ng0 joined #nim
10:40:46*hoijui quit (Ping timeout: 268 seconds)
11:12:58*laaron quit (Remote host closed the connection)
11:20:13*nif quit (Quit: ...)
11:20:25*nif joined #nim
11:21:30*Trustable joined #nim
11:22:42*laaron joined #nim
11:29:05*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
11:29:42*laaron joined #nim
11:30:50Zevvpositive thinking!
11:38:23*joki1337 joined #nim
11:56:40*Hideki_ joined #nim
12:00:38*hoijui joined #nim
12:00:49*drewr quit (Ping timeout: 276 seconds)
12:00:53*Hideki_ quit (Ping timeout: 245 seconds)
12:08:49*hoijui quit (Ping timeout: 244 seconds)
12:17:16*drewr joined #nim
12:36:15*Hideki_ joined #nim
12:39:37*solitudesf quit (Ping timeout: 245 seconds)
12:54:29*Hideki_ quit (Remote host closed the connection)
12:56:50*Hideki_ joined #nim
12:57:07*Hideki_ quit (Remote host closed the connection)
12:57:20*Hideki_ joined #nim
13:08:21*laaron quit (Remote host closed the connection)
13:10:36*laaron joined #nim
13:16:29*rokups joined #nim
13:22:19*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
13:23:13*tane_ quit (Ping timeout: 244 seconds)
13:24:58*laaron joined #nim
13:29:40RomansonI am thinking of exploring this language.
13:30:00RomansonIs nim compiler in gentoo packages?
13:33:30*laaron quit (Remote host closed the connection)
13:39:31*laaron joined #nim
13:40:54*laaron quit (Client Quit)
13:41:05disruptekRomanson: yes.
13:43:59leorizecheckout my overlay if you want the devel version
13:46:54Romansondisruptek: Its a masked package tho.
13:47:37disruptekthe 0.20 series of compiler is inherently unstable.
13:47:50*laaron joined #nim
13:50:00Romansondisruptek: It won't break the system right?
13:50:15RomansonI guess I'll give it a shot.
13:50:25RomansonWhat editor and plugins are you guys on?
13:51:02disruptekleorize wrote an nvim plugin which i also use.
13:51:21RomansonOk.
13:55:25*tane_ joined #nim
14:00:22*sagax joined #nim
14:00:30*krux02 quit (Remote host closed the connection)
14:02:31*narimiran joined #nim
14:02:31*snooptek quit (Read error: Connection reset by peer)
14:06:09*laaron quit (Remote host closed the connection)
14:06:32*laaron joined #nim
14:09:28*snooptek joined #nim
14:12:05*snooptek quit (Remote host closed the connection)
14:13:19*snooptek joined #nim
14:32:10disruptekfederico3: any more thoughts on your slow json issue?
14:34:52federico3disruptek: no, I haven't been looking into it more
14:39:05disruptekreally odd problem worth figuring out. if you get an idea on how we can compare our environments, lemme know.
14:39:50federico3disruptek: if you compare python.json / ujson / Nim on your host[s] you can still see some poor performance
14:40:21disrupteki cannot reproduce your issue; the nim version takes 2.0s for me.
14:40:50federico3...compared to?
14:41:08disruptek3.9s for python/json.
14:42:05disruptek(and under a second for ujson version)
14:42:12federico3much better but far from excellent
14:42:21leorizehave you tried Araq's packedjson?
14:42:54federico3it failed to decode, also it's a different topic: I'm concerned about stdlib
14:43:08disrupteki haven't, but clyybber did; it was ~20% slower.
14:43:21federico3slower than..?
14:43:34disruptekhttps://github.com/nim-lang/Nim/issues/12152#issuecomment-529122483
14:43:50disrupteki can only guess compared to stdlib.
14:44:37leorizeif packedjson consistantly beats stdlib's json in performance then wouldn't it be a good candidate as the new json module?
14:44:51disruptekit doesn't fully implement the same api.
14:48:02leorizehmm, would npeg be capable of producing a faster json parser than the json module?
14:49:31disruptekcan't rule it out, especially since it seems the json module might be crippled in some environments.
14:49:58FromGitter<arnetheduck> things tend to be faster because they have a better or different api - the std lib is not a place for changing api - the easy way out is to stop using the std library, then you have the infrastructure to change to an even better json library in the future
14:50:11disruptekwe could call it `ujson`.
14:50:50FromGitter<arnetheduck> we have a json lib as well in status, though it's type-based instead of generic
14:51:21Zevvleorize: npeg parses faster then json, but I would need to do new tests to see if that still holds. I wouldn't reccomend npeg for high performance things though, these things are better coded by hand
14:51:29FromGitter<arnetheduck> the std library is where code goes to die ;)
14:55:47federico3anyone wants to bench against go and rust and so on?
14:57:44disrupteki think there's already a json benchmarking tool, or maybe it's just a test suite.
15:11:46federico3I can replicate it on circleCI
15:14:45*solitudesf joined #nim
15:20:05federico3https://circleci.com/gh/FedericoCeratto/nim-morelogging/90 there you go
15:22:56disruptekwhat am i looking at?
15:25:35federico3look at the last log pane
15:25:40*py0tr joined #nim
15:28:04disruptekit looks like this series of tests took 27s and failed due to an inability to compress something. how can we compare the speed without an equivalent python test in the same job?
15:28:16federico3:D the UI just broke
15:28:45*joshbaptiste quit (Ping timeout: 268 seconds)
15:29:03federico3http://paste.debian.net/1099536/
15:29:32federico3446 msec VS 1.6s
15:30:19*py0tr quit (Client Quit)
15:31:43*mattmurr quit (Ping timeout: 246 seconds)
15:33:02disrupteki think i have a repro.
15:42:50disruptekwell, i can get it to take 23s... but only in a debug build.
15:49:20disruptekit takes python almost 30s to benchmark 10 iterations of the loop, or about 15x nim's speed for one loop. what i don't understand is how it's taking your machine 11s to run the same code. what os?
15:49:56disrupteki should say, 15x slower than nim.
15:50:38disruptekor 1.5x or something. you know what i mean.
15:50:40*nsf quit (Quit: WeeChat 2.5)
15:51:41*abm joined #nim
15:55:20*joshbaptiste joined #nim
15:57:14*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
15:58:37federico3disruptek: what you saw is on a CircleCI buildbot
15:59:09disruptekyeah, i know. my 30s python was run locally.
16:00:13federico3look at the paste again: 1.7 s for Nim to parse the whole file VS 0.446 for Python ujson
16:00:16disruptekthe buildbot is taking 1.7s to run the nim, right?
16:00:42disruptektry running that python command line.
16:00:45federico33.9 x slower
16:00:45federico3no
16:01:03federico31.7 is only the parsing, without the executable start time and so on
16:01:35disruptekokay, but python isn't measuring executable start time, either.
16:01:46federico3correct
16:02:18*laaron joined #nim
16:02:26disruptekthat python benchmark takes me 30s to run. are you telling me that my ujson in python is extremely slow?
16:02:58shashlickSorry to interrupt but what's a good tool to help test across multiple machines / os
16:03:09shashlickPretty much a local CI
16:03:33federico3no, the timeit module runs the bench *multiple times* by itself
16:03:52shashlickBut something like - git clone, make edits, run command which tests locally and on other machines with same changes
16:04:39federico3a simple makefile with rsync and ssh does the trick
16:06:10*rokups quit (Quit: Connection closed for inactivity)
16:06:42disruptekwell, going back to what i can reproduce (and understand), ujson is about 800ms for me and nim is about 2000ms. and that's pretty close to what the buildbot is producing, right?
16:07:50federico3somehow
16:08:30federico3generating json input with different sizes and contents might help
16:08:34disruptekwhat's your local os?
16:09:35federico3I'm testing on different hosts. Debian with kernels 4.14 and 4.19
16:11:06shashlickYa rsync, etc but is there something that makes this easy or I have to spend hours building it from components?
16:12:50disruptekall i can think of is buildbot with multiple containers in the cloud.
16:13:02disruptekand, yes, it will take awhile to setup.
16:14:23federico3http://paste.debian.net/1099539/ something that simple
16:14:30shashlickShould I look at things like ansible and co?
16:14:46federico3disruptek: you don't usually want to run bench on VMs / containers
16:14:49federico3jesus no
16:15:08disrupteki don't think shashlick is trying to do benchmarking, right?
16:15:43federico3shashlick: #nim-offtopic
16:16:02shashlickYa, for example, making a code change in nimterop and running the test across all my machines
16:16:11shashlickAcross various versions of Nim
16:16:21shashlickProbably off topic ya
16:18:05*Hideki_ quit (Remote host closed the connection)
16:18:08disruptekfederico3: wanna send me a binary to test?
16:20:21skrylar[m]disruptek: i haven't had 0.20 crash; whats unstable about it?
16:20:39disruptekit's changing.
16:20:49*Hideki_ joined #nim
16:20:55skrylar[m]oh. that definition of unstable
16:21:31disrupteki guess my intention was to suggest that nim itself is less stable than its ebuild.
16:25:16*Hideki_ quit (Ping timeout: 246 seconds)
16:34:34*laaron quit (Remote host closed the connection)
16:36:12*laaron joined #nim
16:39:59federico3disruptek: uh? Do you expect binaries to be significantly different?
16:40:40disruptekif their runtime is the same regardless of host, it sounds like a nim issue. else, it sounds like an env issue.
16:41:22disruptekbut if you prefer, post your c output from nim. or, i can post mine.
16:41:29federico3they are obviously different depending on the host but the slowness compared to Python is the same across hosts as you saw
16:41:52federico3you can even log on the CircleCI host
16:42:17disrupteki haven't seen that. my host and that of circleci agree, but your host is taking 11s to run the same code that takes 1.7s on buildbot, right?
16:42:30disruptekor was it 20s?
16:42:41federico3you can also fork https://github.com/FedericoCeratto/nim-morelogging/tree/jsonbench and run CircleCI on your account
16:43:19federico3disruptek: the host doing 11s is a slower machine and the nim/python ratio is still the same
16:44:29*nsf joined #nim
16:45:35disruptekso your original post said that the nim version took 20s and python took 5s. my result is about 2s in nim and 4s in python. so that's what i'm trying to replicate. and the closest i can get to those numbers is to simply compile the nim in debug mode.
16:46:23disruptekcircleci is running the python benchmark at about 2.5x faster than nim. that's twice as slow as you are experiencing on your local machine.
16:47:23disrupteki mean, your local machine is twice as slow, in terms of the ratio, as circleci (or my machine).
16:47:53federico3the 20s was with the stable Nim release instead of devel. I'm still seeing slowdowns between 2x and 5x
16:49:09disruptekokay, let's just talk about ujson and pretend native python's json doesn't exist for now.
16:49:30disruptekyou can reproduce the same ratio on your local machine that you see on circleci? because i can reproduce that, too.
16:49:56livcdhttps://github.com/kostya/benchmarks <- even back then Nim's version was just on par with ujson or slower
16:51:34disruptekit seems to me that your machine is slow and that's why it takes longer. also, ujson is fast.
16:55:24federico3I'm seeing the same on another host
16:55:38federico3an Atom from scaleway
16:57:40federico3approx 4x slower than ujson using Nim 0.20.2
16:58:02*Trustable quit (Remote host closed the connection)
16:59:23livcdi am going to try it on my crappy windows laptop
17:00:49*Hideki_ joined #nim
17:01:04federico3trying on a scaleway ARM...
17:01:39*laaron quit (Remote host closed the connection)
17:04:42*laaron joined #nim
17:04:58federico37.00 sec in Python ujson vs 19.6s in Nim 0.20.2 on the poor little ARM
17:05:48livcdhow do i unpack this on windows jeez
17:08:24*KMan_CA joined #nim
17:12:24*Trustable joined #nim
17:18:44Zevvfederico3: what does your benchmark do, parse and convert to the normal JSonNode tree?
17:19:35disruptekit just parses it line-by-line.
17:21:23livcdjesus christ i cant decompress it
17:21:35Zevvbut also creates the Json tree, right
17:21:38disruptekyou need an lz4 reader.
17:21:40disruptekZevv: yeah.
17:21:53*nsf quit (Quit: WeeChat 2.5)
17:22:06*Hideki_ quit (Remote host closed the connection)
17:23:15*Hideki_ joined #nim
17:23:17*Hideki_ quit (Remote host closed the connection)
17:23:52*Hideki_ joined #nim
17:24:05*abm quit (Read error: Connection reset by peer)
17:27:55*Hideki_ quit (Ping timeout: 246 seconds)
17:30:40federico3https://github.com/nim-lang/Nim/issues/12152#issuecomment-529224343
17:31:44*laaron quit (Remote host closed the connection)
17:31:59disruptek1.8s
17:32:40*KMan_CA quit (Quit: leaving)
17:32:47disruptekyou need to import strutils for strip, btw
17:33:23*laaron joined #nim
17:33:33federico3yes i'ts there but it's not being rendered by GH
17:33:42disruptekoh, neat
17:35:02*find0x90 joined #nim
17:37:54federico3....is not accessible using discriminant 'kind' of type... <-- how do you handle this?
17:38:32disruptekdepends on the code, but it sounds like the field isn't in the variant you are accessing.
17:42:48FromGitter<mratsim> are you using generic methods?
17:43:06FromGitter<mratsim> I had that issues when a variant was used as part of a generic method
17:46:15*find0x90 left #nim (#nim)
17:46:22*mattmurr joined #nim
17:46:52*hoijui joined #nim
17:48:05*Hideki_ joined #nim
17:52:32*Hideki_ quit (Ping timeout: 245 seconds)
17:58:23*Trustable quit (Remote host closed the connection)
18:01:56*krogiar joined #nim
18:02:19*krogiar quit (Remote host closed the connection)
18:08:57FromGitter<deech> Are there any write ups on the experience of using Nim for non trivial applications? I'm looking for good & bad.
18:11:51AraqI don't know any, however what does "non trivial applications" mean? you're better off with naming the application domain IMO
18:12:17disruptekfor Araq, all applications are trivial. ;-)
18:12:35FromGitter<deech> I wanted a way to say commercial without excluding bigger OSS projects.
18:13:10disruptekit's probably easier to look at bigger OSS projects, then.
18:13:11Araqdisruptek: no, on the contrary, the domain matters the most.
18:13:23Araqdeech: ask Yuriy if he is around
18:13:28Araq*when
18:20:24*Romanson quit (Quit: Connection closed for inactivity)
18:21:51*Hideki_ joined #nim
18:26:52*krux02 joined #nim
18:30:28*Hideki_ quit (Ping timeout: 258 seconds)
18:31:28*Hideki_ joined #nim
18:34:34*absolutejam1 joined #nim
18:35:49*Hideki_ quit (Ping timeout: 246 seconds)
18:41:30*doesntgolf joined #nim
18:49:49FromGitter<mratsim> or ask @gogolxdong
18:50:19FromGitter<mratsim> but yeah, Nim for cloud services vs Nim for games vs Nim for embedded is completely different
19:01:23*abm joined #nim
19:05:56FromGitter<deech> Yes, I realize this is probably the case, but it's still valuable to know that eg. Nim is great for embedded in spite of GC but sucks for highly concurrent servers even though it has a built in futures story.
19:24:42FromGitter<mratsim> I don’t think it sucks for highly concurrent server, what sucks is that someone needs to be the first to write the code
19:26:26FromGitter<deech> I wasn't clear. I wasn't stating that as a fact just an example of surprising thing that might fall out of someone's experience that would be valuable to know ...
19:26:32Zevvwerent you planning to do just that, mratsim? :)
19:29:14*doesntgolf left #nim ("WeeChat 1.9.1")
19:39:24*nsf joined #nim
19:40:40FromGitter<mratsim> uh no, I’m only interested in parallel compute, not parallel IO
19:41:41shashlickcan you importc a #define
19:51:04*hoijui quit (Ping timeout: 264 seconds)
19:52:38FromGitter<mratsim> yes
19:53:27FromGitter<mratsim> see: https://github.com/mratsim/weave/blob/master/e04_channel_based_work_stealing/primitives/coz.nim#L21 and https://github.com/mratsim/weave/blob/master/e04_channel_based_work_stealing/primitives/coz.h#L79
19:53:39FromGitter<mratsim> you might want to add nodecl
20:00:05*narimiran quit (Ping timeout: 268 seconds)
20:03:19*Ven`` joined #nim
20:10:37*ng0 quit (Quit: Alexa, when is the end of world?)
20:11:09*krux02 quit (Remote host closed the connection)
20:15:26*Amun_Ra quit (Quit: restart)
20:16:48*junland quit (*.net *.split)
20:16:48*mwbrown quit (*.net *.split)
20:17:02*mwbrown joined #nim
20:17:31*junland joined #nim
20:18:41*Amun_Ra joined #nim
20:18:56*so quit (*.net *.split)
20:19:57*so joined #nim
20:22:29shashlickInteresting - but if it is a constant, I cannot echo it right?
20:30:18FromGitter<mratsim> you can import as a var
20:32:45*tane_ quit (Quit: Leaving)
20:39:39shashlickyep figured that out
20:53:29shashlick@mratsim - needed it for this forum post - https://forum.nim-lang.org/t/5176#32497
20:53:54shashlickthanks - i'd use your method for mapping procs to #defines but unfortunately, i don't have type information
20:59:48FromGitter<mratsim> I think the hasCompileTimeFFI and whatever was the other flag to enable libFFI at compile-time allows defining const from C headers
21:10:25*nsf quit (Quit: WeeChat 2.5)
21:27:41*joki1337 quit (Remote host closed the connection)
21:47:08*solitudesf quit (Ping timeout: 245 seconds)
21:54:38*absolutejam1 quit (Ping timeout: 245 seconds)
22:12:20*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:13:07*KMan_CA joined #nim
22:15:20*KMan_CA left #nim (#nim)
22:33:05*Hideki_ joined #nim
22:37:36*Hideki_ quit (Ping timeout: 244 seconds)
22:38:58*CirclingTheVoid joined #nim
22:45:26*CirclingTheVoid quit (Quit: leaving)
22:46:21*dddddd quit (Remote host closed the connection)
23:41:50*Hideki_ joined #nim
23:50:06*Hideki_ quit (Ping timeout: 268 seconds)
23:57:22*ryukoposting joined #nim
23:58:47shashlickhaha nimterop finally has a v0.1.0 tag, now that v0.2.0 is almost out
23:59:14*CirclingTheVoid joined #nim