<< 20-11-2018 >>

00:08:49*ng0 quit (Quit: Alexa, when is the end of world?)
00:21:07*NimBot joined #nim
00:50:34*abm quit (Ping timeout: 244 seconds)
00:59:13xacedom96: so essentially choosenim is the complete package?
01:00:16*king3vbo quit (Quit: Leaving)
01:00:46*rect0x51 joined #nim
01:13:55shashlickI'd think so
01:15:18*rect0x51 quit (Quit: Lost terminal)
01:22:34*zachk quit (Quit: Leaving)
01:39:33*dddddd quit (Remote host closed the connection)
02:11:10*vlad1777d quit (Ping timeout: 244 seconds)
02:46:56FromGitter<gogolxdong> How to cast seq[uint8] to uint64?
02:50:05FromGitter<zetashift> mySeq.map(proc (e: var uint8) = e.uint64) maybe?
02:51:08FromGitter<zetashift> whoops sorrry should be with the `var` since it can't modify in place
02:51:11FromGitter<zetashift> without*
03:00:52FromGitter<gogolxdong> ```var s = @[0x1'u8,0x2,0x3] ⏎ var b = cast[ptr uint64](s[0].addr)[] ⏎ echo fmt"{b:064b}"``` [https://gitter.im/nim-lang/Nim?at=5bf378e44bad337eb9086d80]
03:01:19FromGitter<gogolxdong> but it's in little endian which is reverse.
03:05:40*banc quit (Quit: ZNC - http://znc.in)
03:14:21FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bf37c0c1ad4155d3af07fc0]
03:22:32*banc joined #nim
04:28:57*MyMind joined #nim
04:30:27*Sembei quit (Ping timeout: 240 seconds)
04:32:20*nsf joined #nim
04:36:56*brainproxy joined #nim
05:28:05*plushie joined #nim
05:34:16*plushie left #nim (#nim)
05:34:25*stefanos82 joined #nim
05:40:31FromGitter<kayabaNerve> @gogolxdong Most computers are little endian.
05:40:56FromGitter<kayabaNerve> I wrote a proc to convert from an int to a string and vice versa. Tell me if you'd be interested @zetashift
05:41:04FromGitter<kayabaNerve> (char == uint8)
05:41:29FromGitter<kayabaNerve> Eh. Technically uchar. Why the hell do unsigned chars exist though?
05:44:07leorizebecause (char != uint8) in C
05:56:04FromGitter<kayabaNerve> But why :thinking:
06:09:57leorizeanyone know what I might have done wrong here? https://ptpb.pw/Cy3T/nim
06:10:21leorizeit just deadlocked
06:10:39leorizereducing the tree size will help, so I'm not sure if it's even my fault
06:39:49FromGitter<zacharycarter> heh
06:40:03FromGitter<zacharycarter> I'm using Nimble as the starting point for my new game engine
06:40:06FromGitter<zacharycarter> oddly enough
06:40:50FromGitter<Varriount> leorize: When the process deadlocks, how many threads are there?
06:40:50leorize12 threads
06:45:20leorizethe number varies actually
06:59:24*mech422_ joined #nim
07:02:33*mech422__ quit (Ping timeout: 245 seconds)
07:12:30FromGitter<gogolxdong> Do we have GCM mode cipher ?
07:23:20FromGitter<AchalaSB> @alehander42 Here is my uicode.nim ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5bf3b668b86c70503f5bdabb]
07:25:48FromGitter<AchalaSB> @alehander42 Here is my unicode.nim ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bf3b6fc4720c11e0e952806]
07:26:29leorize@AchalaSB: pasting it into a pastebin would be better...
07:26:31leorizebut nvm
07:26:49leorizethis is not the entire file, yes?
07:27:30FromGitter<AchalaSB> Yes. Unable to paste the full file
07:28:53Araqhttps://motherboard.vice.com/en_us/article/439wbw/patching-is-failing-as-a-security-paradigm
07:30:48FromGitter<narimiran> @AchalaSB can you try what i proposed yesterday? removing unittest and see if that works
07:31:01*Vladar joined #nim
07:31:36FromGitter<narimiran> this was the version i proposed: http://ix.io/1szu
07:32:10FromGitter<AchalaSB> No it doesn't work
07:32:30FromGitter<narimiran> it is still the same
07:32:43FromGitter<narimiran> ...error as yesterday, seq[char] and so on?
07:33:14FromGitter<AchalaSB> Ya. If I remove unittest ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bf3b8b92ef5b06e4094b2c3]
07:33:33FromGitter<yyyc514> how do ig et the value from a pointer?
07:33:46FromGitter<yyyc514> dereference it back to the object it points to?
07:34:12FromGitter<narimiran> @AchalaSB can you run the file i've just sent with `nim c -r myfile.nim`? does it print 'true' or it raises an error?
07:38:43FromGitter<yyyc514> ah [] works
07:38:48FromGitter<yyyc514> just like reference
07:40:52*krux02 joined #nim
07:41:03FromGitter<AchalaSB> @narimiran Tried getting same error without using unittest. with unittest also same error i.e regarding unicode.nim
07:43:04FromGitter<narimiran> ok, then there's a problem with your setup/installation
07:49:36FromGitter<narimiran> i would also try running my file in some other, completely unrelated, folder, just to make sure that some local config/dependency (e.g. stint) didn't mess up something
07:49:48FromGitter<narimiran> because the error you're getting is quite weird
07:55:39FromGitter<narimiran> @AchalaSB ^
07:56:49FromGitter<AchalaSB> Tried with without exportwasm at that time it wasm working fine.
07:57:51*rauss joined #nim
07:57:51*rauss quit (Client Quit)
07:58:14FromGitter<AchalaSB> But with exportwasm it gives me error. I need exportwasm bcz of that only i can generate .wasm file for my code
08:00:28FromGitter<gogolxdong> @shashlick How to change ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ as openssl exists under the directory? [https://gitter.im/nim-lang/Nim?at=5bf3bf1c1665691e0fd0be20]
08:02:58FromGitter<narimiran> @AchalaSB `exportwasm` macro, written as in the link i shared (this is what you gave us yesterday) works fine on my end when i do `nim c -r filename.nim`— but i have no `nim.cfg` or `config.nims`, i don't use nimble, i don't have stint dependency, etc. That's why I wanted you to try in some other, unrelated, directory, where you should also do `nim c -r filename.nim`(don't use nimble) and compile/run this:
08:02:58FromGitter... http://ix.io/1szu
08:03:47FromGitter<narimiran> If you can confirm that you followed these exact steps and you still get the same error, then the problem is even more serious
08:19:11FromGitter<alehander42> missing copyString, huh, I only got this when I compiled with os:standalone or gc:none, can't remember which of those
08:21:23leorize`--os:standalone`
08:28:14FromGitter<yyyc514> whats the best way to do ptr void?
08:30:16Araqptr void = pointer
08:31:03FromGitter<yyyc514> type 'ptr void' is not allowed
08:34:18FromGitter<yyyc514> Oh you meant just write it pointer
08:34:49FromGitter<yyyc514> gotcha
08:39:18*revere quit (Quit: quit)
08:39:23leorizeI'm playing with threads and got a deadlock here https://ptpb.pw/Cy3T/nim
08:40:06leorizeI can't figure out why though, can someone who familiar with threads look at it?
08:40:16Araqyeah... dunno, don't use threadpool
08:40:31FromGitter<yyyc514> looks fun
08:40:41Araqit's grown too complex
08:41:36FromGitter<gogolxdong> @shashlick ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ but nimgen has been installed, I'm on WSL(Windows Subsystem for Linux) [https://gitter.im/nim-lang/Nim?at=5bf3c8c02ef5b06e40951818]
08:41:38Araqit's a good example though showing that condition vars are hell and that the "don't poll" crowd has no clue
08:41:59leorizeAraq: any good alternative? I found this to resemble goroutines quite well :/
08:42:46*revere joined #nim
08:45:18leorizegogolxdong: is nimgen in your PATH?
08:49:11FromGitter<gogolxdong> sure
08:51:20FromGitter<narimiran> leorize: i get SIGSEGV when i try to run your example
08:52:21leorizeyes, it's rather undeterministic unfortunately... as with all threads based stuff
08:52:27leorizesometimes it SIGSEGV for me also
08:52:53leorizeI don't know if this has anything to do with the GC however
08:55:55shashlickwow the gang is back online - means I need to go to bd
08:57:33shashlick@gogolxdong: looks like nimgen isn't installed or ~/.nimble/bin is not in your path
08:57:36shashlickwhich OS are you on
08:58:58Araqleorize, there is a PR that replaces the implementation with a simpler one, try to re-activate it
08:59:22FromGitter<yyyc514> Error: illegal capture 'self' of type <var Lipr> which is declared here:
08:59:23FromGitter<yyyc514> hmmmm
08:59:39FromGitter<yyyc514> worked before i tried to use async
09:00:11Araqleorize, but even if it worked, it would be super slow, you need to use ptrs for your tree
09:00:17FromGitter<yyyc514> can you not use var with async?
09:00:45FromGitter<gogolxdong> windows and WSL uses the same directory, I wonder what if openssl already exists, how to modify the nimgen.cfg
09:01:06leorizeAraq: not much of a worry. I'm merely playing with `spawn` using Go's Tour as a lessons source
09:01:30*floppydh joined #nim
09:02:05leorizeAlso, can someone label this issue? https://github.com/nim-lang/Nim/issues/9696
09:04:50shashlick@gogolxdong: why do you need to change? it will just git reset and regenerate
09:05:27FromGitter<narimiran> @yyyc514 show us your code
09:06:34FromGitter<yyyc514> https://gist.github.com/yyyc514/f6d02bfa40ce68cb6966ae2eba21d603
09:06:41FromGitter<narimiran> @AchalaSB it seems that @yglukhov has narrowed down the problem: https://github.com/nim-lang/Nim/issues/9762
09:07:07FromGitter<gogolxdong> The first thing is git clone openssl is pretty slow and I have no idea why, second I just wonder what the cfg should be with an existing directory.
09:08:08FromGitter<narimiran> @yyyc514 that won't do without the rest of it. e.g. what is `Lipr`, etc
09:08:10FromGitter<gogolxdong> though nimssl uses gitsparse to avoid cloning the whole repository which helps speeding up.
09:08:18FromGitter<yyyc514> maybe i need a ptr vs var
09:08:50FromGitter<yyyc514> the lambda stuff doesn't like that the var would be inside a closure
09:09:11shashlickopenssl is huge - its as fast as it gets with depth=1 and sparse checkout
09:09:45shashlickit still downloads a large pack files
09:09:48FromGitter<yglukhov> Araq: ... that condition vars are hell and that the "don't poll" crowd has no clue ... lol what? :)
09:10:17shashlickon subsequent calls, it just git resets rather than redownloading
09:10:24shashlickAraq: it is alive - https://github.com/genotrance/nimterop
09:10:36shashlickgreatly appreciate reviews and feedback on approach and ideas
09:10:45Araqpolling is the only thing that works.
09:10:59Araqhere, I said it. :P
09:12:17FromGitter<yglukhov> imo the most idiomatic example of condition var usage is a thread pool :)
09:12:57Araqcondition vars are ok for queues I guess
09:13:30FromGitter<yglukhov> well threadpool is a queue, no?
09:13:44Araqour threadpool is not a queue
09:13:54Araqwhich is probably the problem with it
09:14:06FromGitter<yglukhov> true. but my threadpool is
09:14:16FromGitter<gogolxdong> Are you working on Interoperability with c/c++ rather than translating into Nim?
09:14:21FromGitter<yyyc514> yes, it didn't like the var getting trapped in a closure, switching to ptr works
09:14:32*abm joined #nim
09:14:43Araqyyyc514, that error message got improved multiple times
09:14:53Araqwhy is it still not good enough?
09:15:18FromGitter<yglukhov> leorize: you can try this https://github.com/yglukhov/threadpools/blob/master/threadpool_simple.nim
09:15:21FromGitter<yyyc514> i guess the word capture to me has more context beside closure
09:15:39FromGitter<yyyc514> when i searched the compiler source and found it generated related to closures it made more sense
09:19:13Araqyglukhov: your threadpool doesn't use condition variables either
09:19:24Araqbut queues
09:19:31leorizeyglukhov: it works!
09:19:38leorizeit always works!
09:20:03leorizethe bad part is that I can no longer use the command call expression :(
09:20:06FromGitter<yglukhov> Araq: the channels are the queues and they use cond vars
09:20:21FromGitter<yglukhov> iirc
09:20:50FromGitter<yglukhov> leorize: what do you mean? show me a sample
09:21:15leorizehttps://ptpb.pw/Cy3T/nim
09:21:24leorizeplease replace threadpool to threadpool_simple
09:21:36leorizeline 28, 29 will not compile with your threadpool
09:21:54leorizethe compiler deduce it into a value type rather than a call expression
09:22:13FromGitter<yglukhov> yeah... that should be fixable.
09:22:25leorizeadding parentheses is enough to fix in my case
09:23:04leorizeparenthesis*
09:23:41*vlad1777d joined #nim
09:24:36*shashlick_ quit (Ping timeout: 250 seconds)
09:25:21*PMunch joined #nim
09:27:03*rlr joined #nim
09:27:24*Gertm joined #nim
09:28:03GertmHi, quick question. Is the book still up to date? I purchased it just after it came out. Is there an errata document?
09:29:23FromGitter<yglukhov> leorize: i'm getting test.nim(25, 6) Error: 'walk' can have side effects
09:29:41leorizeoh, yea, you'd have to change it from func -> proc
09:30:21leorizeturns out the old threadpool doesn't trigger the effects system
09:32:24FromGitter<yglukhov> leorize: fixed https://github.com/yglukhov/threadpools/commit/3ed739b32a1f0a4b8f3779d4c42a377ba3c4059c
09:35:56AraqGertm, the programs in the book are part of our test suite
09:36:07GertmAwesome.
09:36:12Araqand it's reasonably up-to-date except for the nil change
09:36:21Araq(nil is not valid for seqs/strings anymore)
09:36:31GertmAha, ok. Sounds like a good change.
09:36:42AraqI don't know about an errata though, we should have one eventually
09:37:30GertmOk thanks for the help. I can revisit my book without worries then. :)
09:38:25FromGitter<yglukhov> Araq, leorize: side effects is an interesting question though. Does `spawn` have side effects?
09:39:11Araqhmm
09:42:13leorizeI think launching threads is a kind of side effect
09:42:19FromGitter<yglukhov> i would say it more does than not...
09:42:59FromGitter<yglukhov> well yeah. and then there's `trySpawn` which returns bool depending on the state of the threadpool...
09:43:30FromGitter<yglukhov> so maybe it's safer to always assume it does have side effects
09:44:35leorizeso, when will this new threadpool take over? It does seems to work quite well here, and I doubt many people are using threadpool atm
09:47:30FromGitter<yglukhov> There are a few things I need to fix in it. I want to get rid of gc completely. I think there is a potential crash there...
09:47:42leorizeshashlick: I got this while trying to install treesitter_bash: https://ptpb.pw/fcW9
09:47:49FromGitter<yglukhov> Then Araq would have to decide smth about parallel.
09:47:51leorizeusing the latest Nim HEAD atm
09:51:00FromGitter<yyyc514> omgm that was easier than i thought :)
09:56:07FromGitter<yyyc514> i just wrote a tiny little mini process engine powered by async :)
09:57:30FromGitter<yyyc514> only 3 LOC to piggy back on the async stuff :)
10:11:42livcdThere's a forum post for errata @ manning but the latest entry is from Jul 31
10:12:57*dom96_w joined #nim
10:15:05FromGitter<gogolxdong> Anyone heard of AEAD GCM ?
10:38:57*abm quit (Quit: Leaving)
10:55:26*ng0 joined #nim
11:05:30*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:06:59cremWhere can I set up a notification to notify me when destructors appear in nim?
11:08:55*zakora joined #nim
11:09:20FromGitter<tim-st> should this fail: ```nim
11:09:52FromGitter<tim-st> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bf3eb7f4720c11e0e968924]
11:10:28FromGitter<tim-st> (ok, it also fails without try except)
11:11:44FromGitter<narimiran> @tim-st use proc instead of template
11:12:03FromGitter<tim-st> but my code uses 2 template blocks I cant change them easily
11:12:34FromGitter<tim-st> well maybe I can :D
11:13:12FromGitter<tim-st> ok, here is already an issue: https://github.com/nim-lang/Nim/issues/7632
11:14:56FromGitter<narimiran> @tim-st use `echo "it failed for $1" % $x` (import strutils)
11:15:01zakoraIs there something similar to Rust "cargo run" in Nim? That is: check if dependencies need to be dled/installed, check if need to compile the project, run the compiled binary.
11:15:15FromGitter<narimiran> zakora: nimble
11:16:56FromGitter<tim-st> @narimiran thanks
11:17:31FromGitter<narimiran> not as pretty as fmt, but at least it works ;)
11:18:13FromGitter<tim-st> Maybe I replace the template blocks with procs, I think templates look quite hacky and make more problems
11:18:17zakoraFromGitter, not sure I see how to do this with nimble. The closest I get is using "nimble build", put afaik there is no way to then run the binary in a single step.
11:18:18FromGitterzakora, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim
11:18:47zakoraoh, @ narimiran[m] then
11:19:04FromGitter<narimiran> without brackets :)
11:20:49FromGitter<narimiran> zakora: i don't use nimble, but i guess you could write a nimble task which does what you want
11:24:25zakoranarimiran , ok I will look at nimble task. Out of curiosity, how do you handle dependencies without using nimble?
11:25:08FromGitter<yyyc514> how efficient is the type/case stuff? is it just a union in C?
11:26:47FromGitter<narimiran> zakora: i don't have dependencies :D
11:27:51zakoranarimiran, everything gets simpler then :)
11:28:12FromGitter<narimiran> indeed :)
11:30:15FromGitter<narimiran> @alehander42 gara v0.2 looks lovely! (i just skimmed through the readme, and syntax is much nicer, IMO)
11:30:46FromGitter<narimiran> now i need to find the stuff where i can use it
11:32:28*stefanos82 quit (Quit: Quitting for now...)
11:36:58*seni joined #nim
11:37:44FromGitter<alehander42> @narimiran thank you(and also for the no `of` idea, you started this change)
11:38:25leorizeyyyc514: why don't you try it? :)
11:38:31FromGitter<alehander42> also, @pr-yemibedu please, if you use gara, update it to the 0.2 version (I added a PR to nimble packages, but it's not yet merged)
11:39:18FromGitter<yyyc514> this static typing is killing me trying to build a dynamic dispatch message system :)
11:40:47FromGitter<alehander42> @pr-yemibedu I haven't studied f# patterns in depth, but I've seen examples(e.g. the new indent-based syntax is closer to them, after miran's f#-based issue)
11:41:46FromGitter<alehander42> some features are inspired by scala, some by the other nim matching libs (patty and ast_pattern_matching) or other nimmers ideas
11:43:17FromGitter<narimiran> yeah, gara is now one step closer to F#'s matching (syntax), and this is a big plus in my book
11:45:08FromGitter<narimiran> it combines F# and nim, and the product is nice and elegant syntax!
11:46:28FromGitter<narimiran> staying just in nim land (using `of`, for example) or introducing F# stuff (e.g. `->` or `|`) just for the sake of it wouldn't give as nice results as currently
12:04:46*PMunch_ joined #nim
12:06:01*dom96_w joined #nim
12:07:42*PMunch quit (Ping timeout: 264 seconds)
12:08:37*PMunch_ quit (Client Quit)
12:08:46*PMunch joined #nim
12:11:43FromGitter<yyyc514> https://gist.github.com/yyyc514/5bb625bf1533d5d868a8371932c6c646 if i want subclasses of Lipr to have different inbox/recv types is there any clean way to do it?
12:27:57*dom96_w quit (Changing host)
12:27:57*dom96_w joined #nim
12:28:07dom96_wAm I being trolled here? https://forum.nim-lang.org/t/1152#27359
12:29:06FromGitter<narimiran> dom96_w i don't find you "snarky", if that helps :)
12:29:13dom96_w<3
12:30:37FromGitter<narimiran> and i find those comments strange, because usually in the past you were the one who was praised as "more welcoming" out of our "dynamic duo" :)
12:30:40*zahary joined #nim
12:31:05*zahary quit (Client Quit)
12:31:13dom96_wYes, either my lack of time has changed me more than I realise, or this person is trying to stir up a conflict
12:31:20*zahary joined #nim
12:31:20FromGitter<narimiran> but as Michael Scott would say: oh how turntables!
12:38:30FromGitter<narimiran> and one more proof that the world is changing: krux02 just said he liked something from @timotheecour! :D :D
12:40:58krux02dom96_w, who is trying to stir up a conflict.
12:41:45krux02and yes, I like it when issues are actually about something important. But currently I am worried that the real important issues are drowning in non important issues.
12:44:55Araqyeah I'm now the nice guy for Nim :P
12:46:37FromGitter<narimiran> krux02 i can/will help you with those boring/unimportant/alreadySolvedAndNobodyClosedThem issues, so you can concentrate on more important stuff
12:47:22krux02it is more the problem of the unsolved problems that have no easy or clear fix
12:47:33krux02they are a bit fuzzy and they are not worth spending time with
12:47:45krux02they are just bogging up the system
12:52:44PMunchdom96_w, for what it's worth I don't think you were particularly mean in that chain :P
12:53:57PMunchOr anywhere else for that matter
12:54:22krux02well I think I am from time to time a bit snarky
12:54:56krux02I guess things change when you change seats from writing issues to solving issues.
12:56:10FromGitter<narimiran> yes you are :) sometimes :)
12:57:05FromGitter<narimiran> i think all this was Araq's big PR plan to make him look better! Araq, you sly devil!
12:57:34FromGitter<narimiran> (PR = public relations, not pull request)
12:57:42PMunchWell once you know a lot about something it's easy to seem a bit dismissive of someone who asks questions that either don't make sense, or make claims that aren't true
12:58:34livcddom96_w: I wrote that btw
12:59:00livcdi mean the comment about you being snarky
12:59:14*FromGitter * narimiran grabs popcorn
13:00:28FromDiscord_<exelotl> Guys I've solved it. What if dom96 has an evil arch nemesis called dom69 who is constantly being rude to everyone
13:01:58PMunchDr. dom96 and Mr. dom69?
13:02:44FromGitter<narimiran> exelotl there was already a rumor that Araq and dom96 are the same person! have you seen them commit some changes at the same time? i didn't think so!
13:03:33livcddont think it's popcorn worthy and I also dont think it's rude it's just off-putting for newcomers
13:03:53Araqthen why would dom's PRs ever languish
13:04:07Araqwe're different persons, that's why
13:04:44FromGitter<narimiran> nice try, dom
13:05:16livcdis there a pic of you two standing next to each other ?
13:07:49Araqprobably, somewhere
13:14:47dom96_whaha, love your conspiracy theories :P
13:15:26dom96_wlivcd: Well, I stand by what I replied to you.
13:17:15*ng0 quit (Ping timeout: 256 seconds)
13:19:19Araqer ... uh, do I need to moderate?
13:19:39dom96_wFeel free. I think you'll agree with me though ;)
13:22:56AraqI think I do, but I don't know if livcd is moerm or not
13:23:26dom96_wAFAIK livcd is reddington
13:23:58*CcxWrk quit (Remote host closed the connection)
13:25:06Araqah ok
13:25:37Araqwell as far as I can see this has been settled with " My apologies." from moerm
13:26:17Araqand somebody needs to port more benchmarks to Nim (narimiran?)
13:27:26dom96_wThat apology wasn't directed at me though. Perhaps indirectly, so shrug
13:28:57Araqwe can always ban you later ;-)
13:30:29FromGitter<mratsim> I have plenty of HPC benchmarks now
13:30:39FromGitter<mratsim> I have implemented a BLAS as fast as OpenBLAS in Nim
13:31:14FromGitter<mratsim> https://github.com/numforge/laser/blob/master/benchmarks/gemm/gemm_bench_float32.nim#L186-L260
13:31:24Araqthat doesn't count though. the only benchmarks of value are those from TechEmpower
13:31:38*ng0 joined #nim
13:32:33Araqbecause it always matters for your website to be able to serve one million connections/users per second regardless of your site's popularity
13:33:03FromGitter<mratsim> > _>
13:33:40FromGitter<narimiran> @Araq i'll see what i can do about those benchmarks. this is, again, stuff i don't usually use
13:34:08dom96_wWhat really gets me is that I spent many days of my time creating a http server from scratch to get the most optimal results and this person dismisses them because it's missing from some of the categories :(
13:34:42FromGitter<narimiran> and @mratsim's benchmarks *do* count for us who do numerical stuff with nim
13:36:33Araqdon't take me seriously
13:37:32FromGitter<narimiran> i didn't, but this is for casual readers out there ;)
13:38:19FromGitter<narimiran> dom96_w welcome to the adult world (again), where the only way not to get hate is to do nothing ;)
13:38:38FromGitter<mratsim> na people will still find a way to complain
13:38:46FromGitter<mratsim> it’s a national sport in France ;)
13:38:50FromGitter<narimiran> well, even not doing anything doesn't guarantee that someone will not hate you
13:39:04*zakora quit (Quit: WeeChat 2.2)
13:40:09*FromGitter * narimiran is being snarky :D
13:40:58FromGitter<mratsim> I thought the term was Araqy ;)
13:41:17FromGitter<narimiran> :D :D
13:41:29*dddddd joined #nim
13:42:18*CcxWrk joined #nim
13:43:21livcddom96_w: and that frustration manifests into your replies. Being frustrated is ok but as I said some may see it as snarky which might be off-putting for newcomers in Nim.
13:45:53FromGitter<alehander42> @dom96 I think it was really a misunderstanding: the guy genuinely thought our existing frameworks are just too slow but was a bit too arrogant for a moment, on the other hand "ridiculous suggestions" was a bit insulting too: 90% of the people would think the same just looking at the benchmarks (this is what I thought too in the beginning)
13:47:10FromGitter<alehander42> tl;dr very often the same word/sentence is interpreted very differently by the writer/reader, that's why we need lojban 1.0 ASAP
13:50:44dom96_w"In "Plaintext" Nim at least was present but behind java, Python, ruby, and even PHP based candidates."
13:51:05dom96_wI don't see how that can be a misunderstanding, is this person looking at some strange TechEmpower run?
13:51:20dom96_wBecause I checked two so far and never have I seen an interpreted language above Nim in Plaintext
13:52:51FromGitter<alehander42> well, there are like at least 6 categories
13:53:08livcddom96_w: i think he meant this https://www.techempower.com/benchmarks/#section=data-r16&hw=cl&test=plaintext
13:53:23FromGitter<alehander42> again, I can see how it seems dismissive, but keep in mind this is probably a guy that just saw the benchmarks without being deep into web dev or nim frameworks
13:54:02FromGitter<alehander42> so the way they work and the interpretation of results that might be obvious to a framework creator
13:54:16FromGitter<alehander42> is probably way more unclear for a random guy
13:54:31dom96_wThey presented their case with a lot of confidence, which is why I reacted like that.
13:54:48FromGitter<alehander42> yeah, that can be annoying
13:55:27dom96_wIf they were presenting an old round as fact then that's still disingienious, even if it was a mistake.
13:55:56dom96_wBut yes, I should have said "Where are you seeing these results?"
13:55:58dom96_wSo it's on me as well
13:56:06FromGitter<narimiran> livcd: in the current round, httpbeast is in 14th place for plaintext
13:57:00livcdnarimiran: yes but he was looking for the one where interpreted languages do better than Nim
13:57:45FromGitter<alehander42> all in all, the conclusion is that we have to try to include code for nim frameworks in most categories and overally spend some time on those kinds of public benchmarks, as outside people(hn/reddit crowds) will think the same without somebody correcting them anyway
13:58:15FromGitter<narimiran> agreed
13:59:18livcdin this case it does not matter anyway
13:59:39livcdI think there was a round where the mofuw version was not compiled with -d:release
14:12:35Araqwow Nim supports .inline macros
14:12:40FromGitter<narimiran> speaking of (numerical) benchmarks: https://medium.com/@nwerneck/meeting-julia-a-great-new-alternative-for-numerical-programming-part-i-benchmarking-c03dd3289493 @mratsim, you want to tackle this?
14:13:11FromGitter<mratsim> what is an inline macro?
14:13:25Araqthe ultimate placebo
14:15:59FromGitter<alehander42> i bet it's the fact that "e = 2" is an inline macro that expands to e = 2
14:16:09FromGitter<mratsim> @narimiran here you go: http://software-lisc.fbk.eu/avx_mathfun/ 25% faster than math.h ;)
14:16:13FromGitter<mratsim> 25x*
14:16:15FromGitter<mratsim> sorry
14:16:30Araqnah it's a macro foo() {.inline.}
14:16:47Araqthe compiler doesn't flag it as an error
14:17:13FromGitter<mratsim> I will implement the fast exp and tanh functions, I need those for logistic regression, softmax and sigmoid
14:17:35*kapil____ quit (Quit: Connection closed for inactivity)
14:18:16FromGitter<alehander42> well, it's not an error, duh
14:18:22FromGitter<alehander42> :D
14:22:50*nsf quit (Quit: WeeChat 2.3)
14:25:25FromGitter<Varriount> @mratsim Hey! How's
14:25:44FromGitter<Varriount> How are your libraries going?
14:27:30FromGitter<mratsim> Probably need to release a new version of Arraymancer now, as the next one will have a completely revamped backend which should be much faster on CPU due to fused operations.
14:28:14FromGitter<mratsim> Otherwise you can know use Arraymancer for image, natural language processing and time series prediction
14:28:25*cstaeth quit (Quit: WeeChat 2.1)
14:28:46FromGitter<mratsim> though for natural language processing I need to add a text parser + vectorizer (transforming word to integer input for matrices)
14:29:31FromGitter<mratsim> I also started a proof-of-concept data visualization: https://github.com/numforge/monocle
14:29:58FromGitter<mratsim> but then I got sucked into low-level backend optimisations =)
14:30:58FromGitter<mratsim> low level optim are going very well, since I can reach almost 100% of the speed of OpenBLAS which has been tuned for 5+ years and is 95% Assembly code
14:33:31FromGitter<mratsim> Now I need to optimize convolutions as those are a bottleneck for image processing (blur, sharpen, edge detection, masking are based on convolution) and machine learning (for image, sound, time-series …). And the current CPU solutions are so-so.
14:35:09krux02mratsim: the problem is often that the isolated convolution is often already as fast as it can get, but some convolution + filter can be optimized further
14:36:27*xace quit (Ping timeout: 240 seconds)
14:36:29FromGitter<mratsim> the problem is cache miss, convolution should be compute-bound but a naively implementing it will make it memory bound
14:36:39FromGitter<timotheecour> @mratsim how about wrapping fftw for convolutions ?
14:37:14*vlad1777d quit (Ping timeout: 244 seconds)
14:37:17FromGitter<mratsim> FFT convolutions have perf issues for the common ML problem sizes
14:38:01FromGitter<mratsim> Here are example benchmark of naive convolution vs convolution reframes as matrix multiplication: https://github.com/numforge/laser/blob/master/benchmarks/convolution/conv2d_bench.nim#L148-L170
14:38:03*kapil____ joined #nim
14:38:08FromGitter<timotheecour> (for CPU, fftw should be as fast as one can hope; for GPU, there are other approaches)
14:38:10FromGitter<mratsim> 2GFLOPs vs 20GFLOPs on my machine
14:38:34FromGitter<mratsim> I’ve gathered all the papers I found here: https://github.com/numforge/laser/wiki/Convolution-optimisation-resources
14:39:13*CcxWrk quit (Quit: ZNC 1.7.1 - https://znc.in)
14:39:25krux02I think GPU should be renamed to something like parallel processing unit, since it is by far no longer anymore only for graphics
14:39:35FromGitter<mratsim> fast matrix multiplication relies on a “packing” procedure https://github.com/numforge/laser/blob/master/laser/primitives/matrix_multiplication/gemm_packing.nim#L24 to make data access contiguous
14:40:03FromGitter<mratsim> My idea is to merge im2col reshaping into the matrix multiplication packing
14:40:09FromGitter<timotheecour> (there’s https://github.com/ziotom78/nimfftw3 but it’s 4 y o, could be revived)
14:40:32FromGitter<mratsim> this would prevent the need of FFT, and reduce memory usage
14:41:02FromGitter<mratsim> Also Facebook at the same idea last week: https://github.com/pytorch/FBGEMM/blob/master/src/PackAWithIm2Col.cc
14:42:21FromGitter<timotheecour> @mratsim somewhat relevant, do you know about Halide http://halide-lang.org/ ?
14:42:54FromGitter<mratsim> yes I know, I’ve been following its development for more than a year ;)
14:43:16FromGitter<mratsim> I know about tensor comprehensions and TVM that are build on top of its IR as well
14:43:30FromGitter<timotheecour> they automate what would be tedious hand written code to optimize for cache performance a number of operations on tensors
14:45:24FromGitter<mratsim> I didn’t try it yet, main reason is C++, I fear the compile-time and the interactions of C++ destructors in Nim ref types
14:45:47FromGitter<mratsim> also you need to run an additional compiler on your binary iirc
14:49:52FromGitter<timotheecour> ya, it’s always a bit painful (dependencies etc) to use wrappers, but it also gives a giant head start, where one can pick what to re-implement and reuse from day 1 what we dont’ want to reimplement (halide, opencv, fftw etc) ; maybe @genotrance ’s new https://github.com/genotrance/nimterop could help for that in near future ; I haven’t tried
14:50:39FromGitter<mratsim> I’m curious about JIT using Halide IT though. For some reason, many are using a JIT assembler: Intel is using a custom JIT in libxsmm, it’s using Xbyak in mil-dnn and Facebook is using libjit in Glow https://github.com/pytorch/glow/tree/master/lib/Backends/CPU/libjit and I’m pretty sure I saw asmjit somewhere else
14:51:07FromGitter<mratsim> Xbyak in MKL-DNN*
14:52:56FromGitter<mratsim> Also one thing that I don’t think any third-party addresses are neural network layer fusion
14:53:36FromGitter<timotheecour> well that’s much more high-level/application specific
14:53:42FromGitter<mratsim> with a custom matrix multiplication or convolution I can fuse a sigmoid, tanh or relu with the copying of result
14:54:24FromGitter<mratsim> or a tanh_backward, sigmoid_backward and relu_backward with the packing of the weight matrices.
14:54:25FromGitter<timotheecour> but ya JIT has speedup potential in some domains like Halide's, adapting to image statistics
14:55:17FromGitter<timotheecour> Btw, r u talking about CPU or GPU for all these? (`with a custom matrix multiplication or convolution I can fuse a sigmoid, tanh or relu with the copying of result …`)
14:55:29FromGitter<mratsim> for CPU, CuDNNs already does that for GPU
14:56:18FromGitter<mratsim> well almost, but I might use cutlass to reimplement more flexible matrix multiplication and convolutions on GPU
14:56:32FromGitter<timotheecour> just out of curiosity, what’s your use case for speeding up these operations on CPU (given that GPU would likely give much larger speed gains anyway)
14:56:51FromGitter<mratsim> mobile devices
14:56:54*planetis[m] quit (Ping timeout: 264 seconds)
14:57:20FromGitter<mratsim> and on GPU CuBLAS doesn’t accept arbitrary strides, meaning everytime you slice you need a copy
14:58:04*planetis[m] joined #nim
15:31:01*zakora joined #nim
15:32:39*CcxWrk joined #nim
15:34:06*fowl quit (Ping timeout: 264 seconds)
15:34:18*fowl joined #nim
15:40:43PMunchHmm, what is it that causes nimsuggest to find Nim locally?
15:41:22PMunchIf you try to copy the nimsuggest binary to another path it is unable to find system.nim and shows things like "int" and "string" as "Error type"
15:41:39*Trustable joined #nim
15:43:49*FromGitter quit (Remote host closed the connection)
15:44:03PMunchUhm, did the gitter bridge just die`
15:44:05PMunch`
15:44:06PMunch?
15:44:07*FromGitter joined #nim
16:01:44zakoraHow can I access the project file name in "nim.cfg"? I tried putting `out %= "${projectfile}.out"` and other variants (like name, 1, …), but witout success.
16:07:14*xace joined #nim
16:07:48*narimiran joined #nim
16:15:42*nsf joined #nim
16:17:45FromGitter<mratsim> what do you want to do with this?
16:26:22*vivus joined #nim
16:33:51*floppydh quit (Quit: WeeChat 2.3)
16:34:07FromGitter<kdheepak> I think I broke something on my system (not sure how) and now I always get this error when I use nimble ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bf4377e6183a977eee94ae3]
16:34:25FromGitter<kdheepak> Any idea how to figure out which package this error is being propagated from?
16:34:30FromGitter<kdheepak> It's not my package.
16:34:57PMunchGrep for version?
16:34:58*leorize quit (Quit: WeeChat 2.3)
16:36:01*leorize joined #nim
16:36:33FromGitter<kdheepak> I tried that but it didn't work.
16:36:42*xace quit (Ping timeout: 252 seconds)
16:37:52FromGitter<kdheepak> I added the following line to my .nimble file ⏎ ⏎ ```version = staticExec("git describe --tags HEAD")[1..5]``` [https://gitter.im/nim-lang/Nim?at=5bf438609f5a9e6e411647ad]
16:38:26FromGitter<kdheepak> And the first time it installs correctly, but once it installs every nimble command after that breaks.
16:40:25*xace joined #nim
16:43:25FromGitter<kdheepak> Yup, that seems to be the problem.
16:44:14FromGitter<kdheepak> I changed the file manually in `~/.nimble/pkgs/package/nimble.nimble` to use a string version number and it worked.
16:48:23dom96_wNimble won't install the .git directory
16:48:30dom96_wso your static exec will fail
16:48:33dom96_wwhen it gets installed
16:57:32shashlicknimterop is functional but drawing board grade - i'm really hoping to get some code reviews from you all to ensure I'm going the right way
16:57:43FromGitter<kdheepak> Yes thanks. When nimble installs a package, is there a way to tell it to copy over a version.txt file?
16:59:11shashlickleorize: i will look into it - thanks for checking
16:59:22leorizeshashlick: don't worry, it was my fault
16:59:34leorizeI was running an older nimble left in ~/.nimble/bin :P
16:59:47shashlickOk cool
17:01:39dom96_wkdheepak: sure, but you can also use `const version = "..."` and then import the file where you've put that in your .nimble file
17:01:46dom96_wSee how Nimble's own nimble file does it
17:02:49FromGitter<kdheepak> @dom96_w thanks! I'll check it
17:14:16*leorize quit (Ping timeout: 260 seconds)
17:16:36*leorize joined #nim
17:21:53*leorize[m] joined #nim
17:22:56*leorize quit (Quit: WeeChat 2.3)
17:26:51FromGitter<kdheepak> How do you get the path to the current file in Nim?
17:28:31narimiranos.getCurrentDir()
17:28:59FromGitter<kdheepak> That gets the working directory
17:29:16FromGitter<kdheepak> That doesn't seem to be the same as the file's current directory
17:29:51*ofelas joined #nim
17:30:08*PMunch quit (Quit: Leaving)
17:31:57narimirangetAppDir ?
17:34:58Araqzakora, that doesn't work currently due to phase ordering problems (config is read before $projectDir is set...)
17:39:39*shashlick_ joined #nim
17:39:49*jjido joined #nim
17:40:17shashlickleorize: any feedback on treesitter?
17:41:17leorize[m]I haven't got enough time to play with it yet, sorry :p
17:41:24shashlickno worries
17:41:50leorize[m]A quick look shows that there's no high level wrapper for this thing...
17:52:14*zakora quit (Quit: WeeChat 2.2)
17:52:40shashlicknope
17:52:49shashlickbut check out nimterop for how i've used the api
17:53:00FromGitter<kdheepak> @dom96_w I wasn't able to use the method you suggested.
17:53:41FromGitter<kdheepak> I want to get the version from the git tag and store it in a file.
17:53:57FromGitter<kdheepak> And have that file show up in the nimble directory as well.
17:54:16FromGitter<kdheepak> Looks like right now, the only way to do it is to create a version.nim file programmatically.
17:54:34shashlick@kdheepak: getProjectDir()?
17:54:49shashlicknot sure if nimble gets it or that's nimscript only
17:55:02FromGitter<kdheepak> I've implemented this awful hack for now. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bf44a766183a977eee9cdd0]
17:55:04*elrood joined #nim
18:12:36FromGitter<zacharycarter> is there any way to keep track of a socket by it's FD?
18:12:58FromGitter<zacharycarter> so - if i keep track of it's FD, is there a way to get back a reference to the socket?
18:13:05FromGitter<zacharycarter> do I just do - `newSocket(fd)` ?
18:15:30*jjido quit (Ping timeout: 264 seconds)
18:16:03Araqyeah
18:16:15FromGitter<zacharycarter> thanks
18:20:57*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:25:41*dom96_w joined #nim
18:48:28*Trustable quit (Remote host closed the connection)
18:54:02shashlickis it possible to write a file at compile time
18:54:35FromGitter<tim-st> can I take a proc from stdlib that only works for type `T` for my type `U` when `U` doesnt match the signature but the proc body would work?
18:55:00FromGitter<tim-st> basically the same like it works with untyped template
18:56:11FromGitter<tim-st> something like getProcBodyFromProc(p) and insert it into my proc
19:05:17FromGitter<tim-st> I think I have a solution: include the nim file and before the include define the used type name as union type of the type used before and the new type :)
19:07:33*theelous3 joined #nim
19:14:56narimiran@tim-st can you convert your `U` to `T` and/or do something like `proc myproc(a: U) = stdlibproc(a: T)`
19:16:37FromGitter<tim-st> it's a zero copy type, so converting doesnt work
19:17:26*zachk joined #nim
19:17:50FromGitter<tim-st> I have to look if a `converter` will help here
19:20:02FromGitter<tim-st> no, wont help :\
19:20:39narimiranso copy-paste is the only solution? :D
19:20:41*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:22:32*zachk quit (Changing host)
19:22:32*zachk joined #nim
19:22:55FromGitter<tim-st> not sure, but it could work
19:28:08FromGitter<mratsim> cast through a pointer
19:28:50FromGitter<mratsim> but if you want to copy-past a proc body you can use a macro with getImpl(ident”yourProcIdentifier”)
19:33:25*narimiran quit (Remote host closed the connection)
19:35:12shashlickhow do you pass a static[string] in a macro to another macro that has a static[string] signature?
19:37:48FromGitter<mratsim> getAST or quote do or use a proc
19:40:23shashlickquote do worked 🙂
19:50:37FromGitter<tim-st> @mratsim thanks, that macro looks good, seems casting to string is quite difficult from uncheckedArray
20:08:18*brainproxy quit (Quit: WeeChat 2.3)
20:08:37*brainproxy joined #nim
20:13:40*valgrind joined #nim
20:13:55FromGitter<iffy> I have a hybrid nimble package (installing it installs a library AND a binary). I want for the binary to be able to use some static files from the library. currentSourcePath is not the way to go (because it's hard-coded in the binary at compile-time). What *is* the way to go?
20:14:22FromGitter<iffy> "the way" == "method for getting the path to a nimble package"
20:15:06FromGitter<iffy> Is it executing `nimble path mypackage` ?
20:16:43*vivus quit (Remote host closed the connection)
20:19:21FromGitter<tim-st> should this compile? `type string = char | string; echo string is system.string`
20:22:28shashlick@iffy: that would be an option, or look for the location of the binary itself
20:25:33shashlickwhy is getCurrentDir() not working in the VM? says cannot importc
20:27:09*dom96_w joined #nim
20:31:44FromGitter<iffy> shashlick: it works, it just points to a temporary build dir that no longer exists
20:31:56FromGitter<iffy> so "it works" meaning, it doesn't throw an exception
21:03:44*kungtotte joined #nim
21:06:41*PMunch joined #nim
21:09:13*valgrind quit (Quit: Lost terminal)
21:12:58*nsf quit (Quit: WeeChat 2.3)
21:15:40*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:19:24*abm joined #nim
21:35:57*PMunch quit (Remote host closed the connection)
21:41:25*jjido joined #nim
21:47:49*Vladar quit (Remote host closed the connection)
21:52:19*def-- quit (Ping timeout: 246 seconds)
22:00:06*gangstacat quit (Quit: Ĝis!)
22:03:59*PMunch joined #nim
22:08:43*gangstacat joined #nim
22:08:48*PMunch quit (Ping timeout: 244 seconds)
22:11:09*PMunch joined #nim
22:14:45shashlickhow do you make a recursive object with refs?
22:14:55shashlicki'm able to with ptr, but cannot assign to a ref field
22:16:17FromGitter<tim-st> whats your example that doesnt work?
22:19:44*def- joined #nim
22:27:12shashlick@tim-st: https://github.com/genotrance/nimterop/blob/master/nimterop/globals.nim#L4
22:27:26shashlickusing ptr there but want to make both parent and child references to Ast
22:27:33shashlickbut how do you then assign to node.parent
22:34:26*PMunch quit (Remote host closed the connection)
22:40:58FromGitter<tim-st> why does `parent*: ref Ast` not work?
22:43:50FromGitter<tim-st> ok, I see what you mean
22:45:48shashlickok got it working
22:45:57shashlickwas using a ridiculous amount of ram
22:46:38FromGitter<tim-st> how?
22:47:19FromGitter<tim-st> with ptr addr works, but I dont think this is garbage collected
22:49:30shashlickjust pushed code
22:49:33*kaliy joined #nim
22:49:36shashlickcheck the link again
22:50:05shashlickand check out lisp.nim to see how i'm doing new(Ast), etc.
22:50:47FromGitter<tim-st> ok, new solves it, thanks
22:51:05kaliyhi. I was looking around if someone used successfully nim on a ESP32 or similar, but couldn't find any writeup about it
22:51:23shashlickwas running out of RAM since the children in AST were nested instead of using ref/ptr
22:52:02*jacereda joined #nim
22:54:29FromGitter<Epictek> kaliy: https://disconnected.systems/blog/nim-on-adruino/
22:55:41FromGitter<Epictek> Not exactly ESP32 but should give you a bit of an idea
22:56:15FromGitter<Epictek> personally wouldn't recommend it because of the lack of libraries unless you feel like developing your own
22:58:49*vlad1777d joined #nim
23:02:38jaceredacan I have a sum type like this one with repeated field names? https://gist.github.com/jacereda/df986d518091b13bfd09fb7c892233e8
23:17:05*krux02 quit (Remote host closed the connection)
23:17:36*kapil____ quit (Quit: Connection closed for inactivity)
23:18:55*jjido quit (Quit: Leaving.)
23:19:03*ng0 quit (Ping timeout: 256 seconds)
23:20:06*ng0 joined #nim
23:26:20*vlad1777d quit (Ping timeout: 272 seconds)
23:26:39jaceredaalternatively, is it possible to have something like the field tags in Go, so I can parse a JSON where several node types have a 'name' field?
23:27:11jaceredaparse automatically I mean, via something like the 'to' macro in the json module...
23:29:18*shashlick_ quit (Ping timeout: 264 seconds)
23:31:20*shashlick_ joined #nim
23:31:55jaceredaor yet another possibility, can I somehow declare that field 'a' is present for kinds 'ka' and 'kb', and field 'b' is only present in 'kb'?
23:33:50*smt joined #nim
23:45:53*ng0 quit (Quit: Alexa, when is the end of world?)
23:50:23*theelous3 quit (Ping timeout: 268 seconds)
23:50:50FromGitter<rayman22201> @jacereda : unfortunately you cannot have variant types with the same field names: https://github.com/nim-lang/Nim/issues/3629
23:50:54FromGitter<rayman22201> it's a known issue
23:53:24*elrood quit (Remote host closed the connection)