<<10-02-2019>>

00:05:51FromGitter<Varriount> Araq, dom96: IRC logs are down. :(
00:07:03dom96No they aren't
00:07:14dom96They just break when nobody says anything after midnight
00:12:28*theelous3 quit (Read error: Connection reset by peer)
00:14:02*thomasross joined #nim
00:27:33FromDiscord_<Avatarfighter> weird
00:31:48*erik_ joined #nim
00:39:50libmananything after midnight
00:58:29FromDiscord_<libman> Tiobe updated - https://www.tiobe.com/tiobe-index/ - still no Nim. I always like to make observations compared to previous month ( https://archive.fo/nTt2r ), let's see...
01:00:10*zachk quit (Quit: night all)
01:03:44FromDiscord_<libman> Winners: Dlang and VB.net are up?! Losers: Java, C, C++, Python, C#, PHP, Ruby, Go, Dart, Rust, Julia are all down?!
01:07:32*erik_ quit (Quit: leaving)
01:17:55ng0Tiobe is kinda irrelevant noise professors like to point at or something. amplified google searches etc
02:33:45FromDiscord_<libman> They must have changed their methodology, because C# and VB.net numbers don't make sense unless there's another planet we don't know about and everyone there codes VB.
02:34:20*ng0_ joined #nim
02:35:02*ng0_ quit (Client Quit)
02:37:47*ng0 quit (Ping timeout: 256 seconds)
03:02:27*banc quit (Quit: Bye)
03:21:08*Tyresc quit (Remote host closed the connection)
03:23:28*banc joined #nim
03:42:17FromGitter<MisterBianco> Whats the correct way to check for superuser priviledges in nim?
03:55:03FromGitter<MisterBianco> Nm got it figured out, for anyone else: ⏎ ⏎ ```import posix ⏎ ⏎ echo geteuid()``` [https://gitter.im/nim-lang/Nim?at=5c5fa097253c2b5ea3e78a64]
04:12:52*dddddd quit (Remote host closed the connection)
04:23:24FromDiscord_<juan_carlos> https://github.com/nim-lang/Nim/pull/10618#issue-251693718
04:24:23FromDiscord_<libman> https://www.phoronix.com/scan.php?page=news_item&px=HTML5-Golang-Desktop-Apps
04:30:10*noonien quit (Quit: Connection closed for inactivity)
05:11:18disruptekanything after midnight
05:16:11*nsf joined #nim
05:20:03*vlad1777d quit (Ping timeout: 245 seconds)
05:39:57*ashirase_ joined #nim
06:15:16*vlad1777d joined #nim
06:56:13*narimiran joined #nim
07:38:03*nsf quit (Quit: WeeChat 2.3)
07:50:56*vlad1777d quit (Remote host closed the connection)
07:51:57*vlad1777d joined #nim
08:00:00*gmpreussner quit (Quit: kthxbye)
08:04:42*gmpreussner joined #nim
08:33:19*yitshak joined #nim
08:33:43*yitshak quit (Remote host closed the connection)
08:41:17*vlad1777d quit (Ping timeout: 244 seconds)
08:45:16*nsf joined #nim
09:11:02narimiranZevv: you here?
09:36:18*nsf quit (Quit: WeeChat 2.3)
10:04:37*ashirase_ quit (Ping timeout: 268 seconds)
10:06:26*vlad1777d joined #nim
10:13:14*aguspiza joined #nim
10:13:27*ashirase joined #nim
10:16:22*neceve joined #nim
10:16:37*neceve quit (Client Quit)
10:16:59*neceve joined #nim
10:30:27*Vladar joined #nim
10:33:34Zevvyes kind of
10:33:43Zevvtraveliing, properly online in an hour or so
10:33:45*vlad1777d quit (Ping timeout: 246 seconds)
10:33:48narimiranok, no hurry
10:34:02Zevvk
10:58:48*aguspiza quit (Ping timeout: 245 seconds)
11:00:58*nsf joined #nim
11:16:39*ng0 joined #nim
11:17:48*Perkol joined #nim
11:18:44*aguspiza joined #nim
11:28:31*yunfan left #nim ("leave for finding the question of 42")
11:41:49Zevvnarimiran: sup?
11:41:58narimirannot much, you? :P
11:42:19Zevvsame here, slow sunday :)
11:42:42*dddddd joined #nim
11:45:08*aguspiza quit (Ping timeout: 268 seconds)
11:46:28narimiranok, nuff small talk :P
11:46:36Zevvtell me
11:47:04narimiranyesterday we talked about pascal-nim connection. and i haven't touched pascal in 15+ years.
11:47:25narimiranand then this morning i stumble upon this "modern pascal" tutorial: https://castle-engine.io/modern_pascal_introduction.html
11:47:53narimirani scrolled through it, and if one is not careful enough, one could think he's reading nim tutorial
11:47:58Zevv"object" pascal
11:48:07*Zevv reading
11:49:02narimiranbtw, it has nicer `case` syntax that i would really like to see in nim
11:49:57ZevvI'd love to have "end"s at the end of each block scope, but lets concentrate on the positives :)
11:50:11Zevvso, this is like nim, minus the metaprogramming
11:51:18ZevvI must admit a lot has changed in pascal land
11:51:38Zevvfor me its also 25 years ago, I think
11:51:55narimiranok, grampa
11:52:30ZevvNah, i just was *very* young when doing pascal :)
11:55:54ZevvMust admit indeed, I never realized how pascallish Nim is
11:55:57Zevvnice find, thanks
11:57:07ZevvI got infected with C before starting Pascal, so I never seriously use it
13:00:44Zevvyeah funny how the nim case syntax is just a bit different from pascal. Maybe araq acidentally messed up the parser and decided its better to keep it like this :)
13:00:52narimiran:)
13:06:14*nsf quit (Quit: WeeChat 2.3)
13:33:04Araqno.
13:33:18AraqI improved the syntax because Pascal's sucks
14:00:01*noonien joined #nim
14:27:46Zevv:)
14:29:18*Perkol quit (Quit: Leaving)
14:30:29FromDiscord_<hotdog> Does anyone have a way of parsing json at compile time? I only found a forum thread about it where it doesn't look possible
14:33:54ZevvI think I heard it's not possible (IIRC the JSON parser relies on object variants which are not supported in the Nim VM)
14:35:09leorizeZevv: NimNodes are object variants...
14:38:07FromDiscord_<hotdog> Currently I get "VM is only allowed to 'cast' between integers of same size"
14:48:54*Cthalupa quit (Ping timeout: 246 seconds)
14:50:05*Cthalupa joined #nim
14:50:48FromGitter<Vindaar> @hotdog: It's not quite possible. But the reason is the handling of the string, since `parsejson` uses `lexbase` (makes use of e.g. `moveMem`, which isn't supported at compile time). I once hacked in a "lexbase CT". It did work, but it was horribly slow (esp. because of my string handling in my fake stream, heh). I guess it's certainly possible to properly support
14:51:17*nsf joined #nim
14:53:20*NimBot joined #nim
14:53:21Zevvleorize: yes of course, sorry about that
14:54:03Zevvthere is some similar reason why pegs can not compile patterns at compile time
14:54:14Zevvso the whole peg interpreter has to go in the binary
14:56:13AraqVindaar: oh, PR please?
14:56:39Araqhotdog: marshal uses json and parts of it work at compile-time
15:02:03FromGitter<Vindaar> @Araq: I still have the code. I can try to clean it up sometime soon
15:02:05FromGitter<arnetheduck> ok, finally found an `nlvm` gc bug that I've been thinking slowly about for months.. turns out that sometimes nlvm will stick stuff into `RBP`, like for instance temporaries that are pointers to heap objects.. this would be fine, except that `setjmp` applies "encryption" to `rbp` to prevent some obscure attacks, meaning that when mark-and-sweep uses `setjmp` to copy the registers, anything in `rbp` will be
15:02:05FromGitter... obfuscated, and therefor the value pointed-to will be released... lovely.
15:06:48FromGitter<arnetheduck> this is pretty nasty - the `c` gen gets away by being inefficient and storing the temporary on the stack instead of a register :/ if there's interest, I can do a quick post on the forum outlining the code gen difference
15:09:29FromGitter<kayabaNerve> @arnetheduck Sounds fascinating
15:15:34FromGitter<arnetheduck> @kayabaNerve that's not the word that first came to mind when I finally realized what was going on
15:35:20*vlad1777d joined #nim
15:42:19*aguspiza joined #nim
15:46:21*Ven`` joined #nim
16:21:21*stefanos82 joined #nim
16:41:20Araqarnetheduck: I've read about setjmp "encryption" but didn't know that this has been implemented
16:41:57*neceve quit (Read error: Connection reset by peer)
16:43:49FromGitter<arnetheduck> been around in glibc since 2006ish
16:45:25FromGitter<arnetheduck> what's worse, I'm not quite sure what to do about it :/ using a temporary is actually no guarantee, compilers are too smart these days.. otoh, making everything volatile feels a bit like overreacting
16:50:53FromGitter<mratsim> @narimiran I'm around
16:53:53narimiranhey @mratsim!
16:54:53narimiranwe tried to build Arraymancer with Nim 0.19.9 (as a part of our Nimble testing) and were greeted with two errors
16:55:19narimiranone is: you're relying on the long-deprecated `sequtils.map`, which is now removed in devel
16:55:45FromGitter<mratsim> fixed
16:56:01narimiransecond one is: `$(Tensor)` is somehow confused with `$(HSlice)`
16:56:42FromGitter<mratsim> iirc the first issue is something related to sugar: https://github.com/mratsim/Arraymancer/issues/348
16:56:58FromGitter<mratsim> a type resolution issue in `=>`
16:57:24FromGitter<mratsim> anyway, it compiles on my machine and passes Linux/Mac/Windows CI on both Nim stable and devel
16:57:52FromGitter<mratsim> PR with CI: https://github.com/mratsim/Arraymancer/pull/349
16:58:30narimirani tested arraymancer on friday, this PR is 3 hours old
16:59:31FromGitter<mratsim> yes it was broken by a devel change between my previous commit (Dec 23) and the current devel
17:01:01FromGitter<Varriount> @arnetheduck araq: https://stackoverflow.com/questions/28059021/what-are-the-actual-stuff-in-the-jmp-buf-when-using-setjmp-and-longjmp/28059176#28059176
17:01:48narimiran@mratsim yes, just re-run the tests and that is now passing, but i now get "could not import: cblas_dgemm" :/
17:04:00FromGitter<mratsim> you need to install openblas in the CI
17:04:53FromDiscord_<exelotl> I managed to parse JSON at compile time with https://github.com/OpenSystemsLab/jsmn.nim but it's pretty cumbersome
17:05:00FromGitter<mratsim> once Laser is done this will be optional but right now there is too much perf diff
17:05:05narimiranhmm, this is on my machine, where i have installed blas and cblas (but not openblas)
17:05:43FromGitter<mratsim> actually I guess most popular libs will wrap/use complex libs at one point
17:05:55narimiranon the positive side, there are no more these map/=>/$ regressions! (cc Araq)
17:08:51FromGitter<mratsim> can you clone nimblas and run `nimble test`: https://github.com/unicredit/nimblas
17:09:35narimiranyep, the same error
17:10:03narimiranoops, not the same: "could not import: cblas_ddot"
17:10:24FromGitter<mratsim> that's the same error
17:10:45FromGitter<mratsim> cblas is just a common API and it should dispatch to a BLAS library I think
17:10:54FromGitter<mratsim> try installing openblas and it should fix this
17:11:01FromGitter<mratsim> are you on Mac or Linux?
17:11:35narimiranlinux, and i'd rather not do that because i remember the last time i did that some other things broke (don't remember the details anymore)
17:12:01FromGitter<deansher> I just wandered through a fairly tortured trail trying to find out the best way to start using the nightlies. I wound up with `choosenim devel`. Is that best? ⏎ ⏎ It certainly isn't something a newbie will readily find. ⏎ Starting by googling *nim install nghtlies*, I went through "We currently don't offer nightly builds"; ⏎ then a Nim forum post with a github-API/wget one-liner that gives me a .tgz file with
17:12:02FromGitter... no instructions; ... [https://gitter.im/nim-lang/Nim?at=5c605b61adf6cb0b2c966a93]
17:12:32FromGitter<mratsim> I've been using choosenim devel for months without issues
17:12:54FromGitter<kaushalmodi> "We currently don't offer nightly builds" <- that is now obsolete
17:13:08FromGitter<kaushalmodi> narimiran? dom96?
17:13:11narimiranalready fixed in the website repo, but not yet pushed to the server
17:13:38FromGitter<kaushalmodi> @deansher See https://github.com/nim-lang/nightlies/releases
17:14:23FromGitter<mratsim> @narimiran I tried with blas + cblas and I get could not import: cblas_dgemm
17:14:47FromGitter<deansher> @kaushalmodi I did find that page through google, but then didn't know how to install them.
17:14:51narimiran@deansher as usual, our documentation/instructions sucks. but `choosenim` is great, you can easily switch between stable and devel
17:14:56FromGitter<arnetheduck> @Varriount yeah, though `getcontext` doesn't really say what it puts in the given variable either, from what I can tell.. the `setjmp` trick is ugly, but the same as `boehm` uses.. I guess this kind of code generation is less common if you go via `c` because of the way `clang` generates bytecode, so it doesn't happen that often, in practice.. in fact, even in `nlvm` it's very very rare and requires some pretty
17:14:56FromGitter... special code
17:15:04FromGitter<deansher> @mratsim That certainly encourages me that life with `choosenim devel` will be good!
17:15:05FromGitter<kaushalmodi> @deansher what is your OS?
17:15:14FromGitter<deansher> osx
17:15:54narimiran@deansher you can periodically do `choosenim update devel`, and that's it. quite easy and friendly.
17:16:01FromGitter<kaushalmodi> you just download the osx tar.gz, extract and run install.sh
17:16:10FromGitter<kaushalmodi> but yes, if choosenim works for you, go for that
17:16:27FromGitter<arnetheduck> `choosenim` is great, until it's not.. tends to mess up the library path when compiling the compiler, so if you get weird stuff happening while using it, removing it from `PATH` usually solves things
17:16:35narimiran@mratsim should we open an issue in the nimblas repo?
17:16:46FromGitter<kaushalmodi> also choosenim doesn't yet work on grandpa systems like mine
17:16:57FromGitter<mratsim> I never had an issue with the library path
17:17:29FromGitter<deansher> Seems like the point of convergence would be to prominently point folks to choosenim and then harden choosenim?
17:17:30narimiran@arnetheduck: yep, i've experienced that recently and decided to abandon `choosenim`, but for someone who is just *using* nim, it should be the easiest way to switch between the versions and update
17:17:42FromGitter<deansher> :-) Or the other way around?
17:18:28FromGitter<mratsim> @narimiran I think it's the default BLAS that is broken or is missing procs, I'm trying to compare with `nm -D /usr/lib/libcblas.so` and `nm -D /usr/lib/libblas.so`
17:18:53FromGitter<kaushalmodi> on another note, looks like nightlies builds for osx/linux is failing for past two days: https://travis-ci.org/nim-lang/nightlies/builds
17:19:42FromGitter<mratsim> ah I have an idea
17:21:15FromGitter<mratsim> I have the fix @narimiran
17:21:32narimiranok, i'll still report it to Andrea, just in case
17:22:26narimiranhttps://github.com/unicredit/nimblas/issues/3
17:25:08FromGitter<mratsim> fix: https://github.com/unicredit/nimblas/pull/4
17:45:03*Ven`` quit (Ping timeout: 245 seconds)
18:03:58shashlick@kaushalmodi we need better notification
18:09:55FromGitter<kaushalmodi> I agree
18:30:29Araqkaushalmodi: I know, I've been restarting the builds but nothing changed
18:30:49Araqit could be caused by my commit, but that only affects the Travis Windows instances which are green
18:47:55*nsf quit (Quit: WeeChat 2.3)
19:03:35FromGitter<brentp> bools in nim are 1 byte? or is sizeof incorrect?
19:04:14Araq1 byte, yes
19:04:38Araqyou cannot address single bits easily on today's machines, the memory uses byte addressing
19:05:29Araq(which is pretty stupid in this age where computing power is limited by memory access times)
19:06:16dom96arnetheduck: narimiran: where are your issue reports? :)
19:06:45*abm joined #nim
19:07:11FromGitter<brentp> ok. I implemented something using seq[bool] and then was trying to cast to uint8 to get 8 values at a time--which can't work.
19:11:56FromGitter<akavel> Hi! What's the "devel" branch vs "0.19.x" policy in Nim? a.k.a. release schedule or something?
19:13:02FromGitter<akavel> I just realized the subsequent 0.19.x are not "devel" snapshots, but the branches diverged ~0.19.1
19:13:13FromGitter<akavel> or .0
19:21:29FromGitter<arnetheduck> @dom96 I'm just waiting for a some of my `nimble` reports to be fixed before issuing more ;) gotta prioritize..
19:28:08Araqakavel: well the 0.19.x releases are pure bugfix releases, development moved over to 0.19.9 which will be 0.20
19:30:33FromGitter<akavel> Araq: Ok, thx! Do the 0.20 etc. releases have some kind of a rough schedule, or is it mostly when you feel they're ready? (not meant in a bad way!)
19:31:46dom96arnetheduck: Either you create a PR, someone else will, or you'll need to be very patient :)
19:31:57FromGitter<arnetheduck> pretty neat - qt creator debugging nlvm-compiled app... note the source code and disassembly intertwined - supports all the fancy breakpoints, memory views, etc: https://imgur.com/a/sQMgv8K
19:32:37Araqakavel: april seems realistic, but don't quote me on that
19:33:48FromGitter<arnetheduck> and yeah, can skip the disassembly and just step through source.. but I sometimes like to know how what's actually going on - can't trust these high-level languages :)
19:34:46FromGitter<akavel> Araq: thanks! Anyway generally are you trying to do them at some specific pace, or something? just trying to get a feel how this works
19:38:59dom96narimiran: Araq: Can you guys send me your public SSH keys? I'll create an account for website pushes and then we won't have this bottleneck
19:39:56Araqakavel: https://github.com/nim-lang/Nim/milestone/6 we need to create issues for the bullet points
19:40:48FromGitter<akavel> Araq: thanks!
19:41:06Araqdom96: sure thing
19:42:41*Tyresc joined #nim
19:47:32narimirandom96: "where are your issue reports? :)" i've reported it to you the other day, remember? ;)
19:48:04dom96if it's not in the issue tracker it doesn't exist in my mind :)
19:50:58Zevvdom96: I messed up with Nimble in a creative way the other day: I forgot to add the .nimble file to git. Package got published but was very broken.
19:51:36ZevvI'm looking to add a check to nmble for this; does nimble know about all files that are supposed to go in the package from a PackageInfo?
19:52:01ZevvSo that `git ls-files` at least matches the expected list of files
19:52:34*sealmove joined #nim
19:55:16dom96`nimble check` is a thing, but it expects to see the package on the file system
19:55:18dom96might be able to make use of it though
19:55:20Zevvok, ta
19:55:40Zevvwell, having the package on the filesystem seems like a sane prerequisite for publishing, I guess
19:59:00dom96narimiran: can you PM me your ssh key?
20:03:38FromDiscord_<demotomohiro> arnetheduck, your screenshot looks pretty nice!
20:10:34*kungtotte quit (Ping timeout: 250 seconds)
20:21:01*vlad1777d quit (Remote host closed the connection)
20:23:17shashlickdom96 - how does the init.sh for choosenim get updated on the website?
20:23:33*vlad1777d joined #nim
20:26:38Araqhttp://jultika.oulu.fi/files/nbnfioulu-201302081026.pdf fyi confirms TLSF was a good choice
20:30:25Zevvwell well, that might come handy; I'm having similar Lua fragmentation issues on a low-memory device
20:39:39FromGitter<brentp> where can I find the code for iterating over system.sets? I'm hitting a bottleneck with that.
20:41:18AraqI think it's just an items in system.nim
20:42:56dom96shashlick: manually, by me
20:42:58dom96I'll do it later
20:44:13shashlickOk then I can start using choosenim on windows Travis as well
20:47:48FromGitter<brentp> ok. I see it. thanks @Araq
20:48:47FromGitter<mratsim> iterating over sets is slow because you need to iterate over the whole range
20:50:21FromGitter<brentp> aye. but I sped up `card` 3X yesterday and got another 3X today. Hoping there is something similar for iteration.
20:51:04Araqyeah you can use 'scan for next set bit' instructions
20:51:08FromGitter<mratsim> for card, you can just store set + len in a wrapper type
20:51:24FromGitter<mratsim> would be instant speed :p
20:51:38Araqsystem.nim uses the most stupid algorithm for it and hopes the C optimizer detects the pattern
20:52:17FromGitter<brentp> this additional change to `card` gives the extra 3X: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c608f014003460b2d2b5141]
21:01:10xace_any reason why these paste links from gitter get surrounded in brackets? really anyoying that you have to filter them out when you double click to select the url
21:02:11Araqbecause of our gitter bridge
21:12:52FromGitter<arnetheduck> @brentp why are you casting each byte to `int32` one by one if you've already resorted to pointer casts to `uint64` just above? also, your code will likely crash on some platforms (due to alignment issues).. also.. if you really care about performance, `unlikely` is a pretty blunt tool for it (vs PGO for example)
21:18:20AraqPGO is hard to use
21:23:23FromGitter<arnetheduck> like I said.. if you care about performance ;) mozilla manages to, with firefox - if they can.. it would be trivial to add to nim bootstrap for example - could compile itself and the newly added top-20 nimble packages or whatever to produce the release build for a free 10-15% boost
21:26:08Araqbe my guest, I'm working on a 25% boost fwiw, indirectly
21:26:19Araqand slowly :-)
21:26:30FromGitter<arnetheduck> I wonder if `unlikely` breaks pgo / which takes precedence.. I can imagine that if I had an app where I specifically wanted some case to be faster, even if it's not the most common case (as pgo determines), I'd decorate with `likely` (I've been in that situation where the common case was uninteresting for a perf pov)
21:27:35FromGitter<arnetheduck> you mean the incremental compile stuff?
21:28:44Araqno, I mean my work on memory regions for Nim
21:29:58FromGitter<arnetheduck> right.. did you try with `--gc:none`? given that the compiler is fairly shortlived, that could work too, with some care ;)
21:34:23Araqiirc 400MB vs 16GB
21:34:37Araq--gc:none is crap
21:35:16*ashirase quit (Remote host closed the connection)
21:40:13*aguspiza quit (Ping timeout: 268 seconds)
21:57:21*wildlander quit (Quit: Konversation terminated!)
21:59:35FromGitter<mratsim> likely/unlikely is most likely placebo
22:00:12*qwertfisch is now known as qwerfich
22:03:55Araqmaybe not for ARM, mratsim
22:04:14*sealmove quit (Quit: WeeChat 2.3)
22:04:40*sealmove joined #nim
22:05:50*qwerfich is now known as qwerzfichk
22:08:10*narimiran quit (Remote host closed the connection)
22:09:13FromGitter<mratsim> in doubt I use them ;)
22:10:13Araqthey also improve readability IMO
22:10:43AraqI like to know the common cases
22:10:54FromGitter<mratsim> btw, do you have an example of expression templates in Nim? I'm hitting bindSym, {.compileTime.} and macros edge cases.
22:11:18Araq!= is an expression template
22:12:25FromGitter<mratsim> I'm talking about C++-like expression template >_>
22:12:41*Vladar quit (Remote host closed the connection)
22:13:45Araqwhy would you use them? Use TR macros instead
22:14:24*qwerzfichk is now known as qwertfisch
22:16:04FromGitter<mratsim> I want to build a computation graph with delayed execution.
22:16:28FromGitter<mratsim> i.e. describe the operations (like + * -) and then eval them
22:16:59FromGitter<mratsim> similar to this: https://github.com/mratsim/compute-graph-optim/blob/master/e03_expr_macro.nim
22:17:51FromGitter<mratsim> bindSym doesn't work though with {.compileTime.}: https://github.com/nim-lang/Nim/issues/10628
22:18:43FromGitter<brentp> @arnetheduck because countBits32 requires a an int32
22:19:45Araqthat's beyond my knowledge, but you're misusing bindSym afaict
22:19:55shashlickHow many of you use the command line actively during development
22:20:00FromGitter<mratsim> I do
22:20:37AraqbindSym should be used inside a macro
22:20:50FromGitter<mratsim> a computation graph is just an AST, leafs are "variable"
22:20:56shashlickVersus a gui / ide F5 to build and run type of approach
22:21:08FromGitter<mratsim> but I'd like to build the AST block by block.
22:21:35FromGitter<mratsim> a macro forces me to build everything in single block.
22:21:51Araqthat's kinda the point
22:22:36Araq"wash me but don't make me wet"
22:22:51sealmovedoes nimscript support shebang?
22:23:21FromGitter<mratsim> I need some composability, i.e. assign the AST produced to an intermediate variable.
22:23:48Araqsealmove: even better, Nimscript supports gangbang
22:24:02sealmove:d
22:24:27Araq#! is a comment, so yeah it does
22:25:13FromGitter<mratsim> because after I have some processing to do on the AST: broadcast it on an input tensor, parallelize it with OpenMP and vectorize it on whatever SIMD x86/ARM/MIPS support.
22:25:31Araqmratsim: well you can wrap the bindSym in a dummy macro
22:25:58FromGitter<mratsim> ah good hack :p
22:26:28*PMunch joined #nim
22:27:30FromGitter<mratsim> I also need to check compiler/* because I'm pretty sure there are alternative in there that I can use instead of those bindSym and {.compileTime.} hack
22:30:22FromGitter<mratsim> actually the dummy macro doesn't work same error (got int expected NimNode)
22:30:24FromGitter<arnetheduck> @brentp the point is that if you're locking your impl down to support 64-bit x86_64 only, you might as well count bits by 8-byte chunks (using countbits64) - it has the added bonus that at least it won't crash on other platforms, just be slow on <64-bit.. once you've done that, the next natural step is to make sure you use the right instructions for the problem, and then see if by removing the if == 0, you get
22:30:24FromGitter... better or worse results... some compilers do pattern recognition and that countbits32/64 function just *might* be standard enough that it'll smartly turn it into the right instruction..
22:31:09xace_shashlick: i use the terminal pretty much exclusively. so mostly command line... but occassionally i setup a key to make/run the code... i like nimcr, but i feel like it needs a patch to speedup when it doesnt need recompiling
22:31:35sealmoveAraq/dom is it possible to change nickname in forum?
22:32:10xace_sealmove: you could also #!/usr/bin/env nimcr # for full nim code (dont forget to chmod +x)
22:33:05Araqsealmove: no, I don't think so
22:33:32sealmovexace_: oh! thanks! (why the name nimcr?)
22:34:12sealmove@Araq: Ok... I'll make a new account (old one was "rect0x51")
22:34:37Araqwhat's wrong with rect0x51?
22:35:06xace_sealmove: nim c -r => nimcr
22:35:18sealmovenothing, I just love this new nickname that I came up with (I can tell you meaning if you like to hear a story)
22:35:45sealmovexace_: sweet!
22:36:18PMunchxace_, sealmove, yeah I didn't care to be too inventive with that name :P
22:36:30FromGitter<brentp> @arnetheduck . I know very little about this stuff, but how is it locking into support 64bit only? and you mean countBits32 could get turned into builtin popcount?
22:37:07shashlickthanks xace_
22:37:15sealmovePMunch: nah, lack of imagination by me
22:37:18sealmovename is fine
22:37:25PMunchI meant nimcr
22:38:00*stefanos82 quit (Remote host closed the connection)
22:38:41shashlickmy running theory for my text editor is that you use an editor for editing but spend a lot of time in the command line doing things
22:38:56shashlickso might as well make the command line an interface for the editor
22:39:07PMunchWith vim you can spend all your time in the command line :)
22:40:08shashlickno doubt
22:40:24sealmovedo you know xonsh?
22:40:25shashlickbut vim, emacs and others have created a while world inside their editor
22:40:55xace_PMunch: dw about it, its a good one imho... a problem though. i feel like it is really slow to detect if the code needs to recompile or not... basically there's a significant delay until it runs the actual executable, eventough its up to date (my best guess atm is that nimcr recompiles it eventough it shouldnt, ill debug it and let you know later)
22:41:22PMunchxace_, hmm that sounds strange
22:41:31PMunchIt should be pretty instant
22:41:51FromGitter<arnetheduck> @brentp you're increasing i by 1 (sometimes), then using it as an offset and a pointer dereference - that will cause an unaligned memory read which causes crashes on some platforms, slowness on others (and mostly nothing on x86_64 where the slowness only happens when you cross a cache line).. all that is to say that optimization is easy to get wrong once you get into casts and points (which is why they're
22:41:51FromGitter... discouraged).. what many implementations of bitsets do instead is to use an array of the natural int type - then they can avoid these pitfalls and still enjoy the benefits
22:41:59xace_PMunch: yeah, i re-read your wording in the readme.md several times to make sure i didnt misunderstand the script. but i guess ill have to hack on it to figure it out
22:42:12xace_PMunch: also another possibility, my machine belongs to a museum
22:42:16PMunchDo you have an example?
22:42:46xace_PMunch: even a `echo hello world` would take more than 1 seconds to run on my pc
22:43:05xace_its faster than nim c -r, but slower than ./helloworld
22:43:23FromGitter<arnetheduck> also, once you get to popcount, there's no speed difference between calling it for 1 and 8 bytes, so by simply doing 8 bytes at a time, you speed up by 8x.. also, if you use popcount, the if will slow you down - the reason it's *maybe* helpful in the other case is because countbits32 calculates the count using bit tricks and not popcount instruction
22:45:11FromGitter<brentp> ah. understood. and its is using bit tricks currently.
22:45:36xace_PMunch: my best guess atm is that it has to do with my computer being "special", so dont spend your time on it, i will figure it out and let you know if it would be of interest for you
22:45:58Araqhere is how to fix it: create an llvm/clang issue that the for+if doesn't generate a popcount instruction :P
22:46:05PMunchxace_, on my machine it adds about 0.002 seconds to the execution
22:46:23FromGitter<brentp> :|
22:46:49PMunchxace_, that's with the entire path of the executable, no options
22:46:53xace_PMunch: yeah, no in my case its much more than just running it, i dont mind 0.002 difference, but 1-5 seconds is a measurable difference and a bit of annoyance at times...
22:47:08PMunchYeah that's way too long
22:47:22xace_PMunch: yeah, something is most likely wrong with my setup...
22:47:58FromGitter<arnetheduck> @brentp afair, yes.. https://github.com/nim-lang/Nim/blob/devel/lib/system/sets.nim
22:51:21FromGitter<brentp> yeah. I was stating. here's the change I made yesterday that does the opposite of what you say, that gave good speed improvement: https://github.com/nim-lang/Nim/pull/10619/files
22:53:31*Marumoto joined #nim
22:53:39Marumoto /msg nickserv identify macewindu
22:53:52*Marumoto quit (Remote host closed the connection)
22:54:00FromGitter<arnetheduck> yeah, so you're most likely not getting a popcount in that case, but it's easy to verify with https://gcc.godbolt.org/
22:55:40FromGitter<arnetheduck> also, at what bit set rates did you get the speedup? 0%? 50%? 100%?
22:56:56FromGitter<brentp> closer to 0.
22:58:28FromGitter<arnetheduck> wonder what the tipover point is, where the extra branch becomes more expensive
23:00:13FromGitter<arnetheduck> with all that said, bitsets is one of those things I wouldn't mind if they moved into a library, with some minimal glue in compiler :) would be easier to optimize, and wouldn't have to be reimplemented in every backend
23:01:47*ng0 quit (Ping timeout: 256 seconds)
23:02:18*PMunch quit (Read error: Connection reset by peer)
23:02:43FromGitter<brentp> and I would be happy to use such a library. :)
23:07:14FromGitter<brentp> can sets use the builtin popcnts from lib/pure/bitops ?
23:10:34Araqwith some effort.
23:10:57Araqsystem.nim refactorings are on-going and may might it easier
23:17:00Araq*may make
23:17:53*Jesin quit (Quit: Leaving)
23:19:41FromGitter<brentp> ok. I'll open a tracking issue unless that's just adding noise.
23:19:42*sealmove quit (Quit: WeeChat 2.3)
23:20:34Araqplease don't
23:21:03Araqfix it or don't, but yesterday I closed a couple of issues in an attempt to find a certain one
23:21:14Araqand failed to find it.
23:21:32FromGitter<brentp> ok
23:22:39*Jesin joined #nim