<< 29-03-2018 >>

00:07:59*jrbrt quit (Quit: Oíche mhaith)
01:21:36FromDiscord<timotheecour> Hi, not sure I understand how to use `compiles` inside macros ; see failing example here: https://forum.nim-lang.org/t/3701/1#23068
01:52:08*gokr quit (Ping timeout: 260 seconds)
01:57:55*tefter joined #nim
02:24:59*xkapastel quit (Quit: Connection closed for inactivity)
02:33:56*dddddd quit (Read error: Connection reset by peer)
02:38:59*endragor joined #nim
02:43:31*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:20:25*xkapastel joined #nim
03:48:40*SenasOzys quit (Remote host closed the connection)
03:49:35*mwbrown quit (Ping timeout: 248 seconds)
03:50:25*joshbaptiste quit (Ping timeout: 248 seconds)
03:50:25*MonsterAbyss quit (Ping timeout: 248 seconds)
03:50:48*joshbaptiste joined #nim
03:51:13*MonsterAbyss joined #nim
03:51:46*mwbrown joined #nim
03:57:36*athenot quit (Read error: Connection reset by peer)
03:57:57*athenot joined #nim
04:14:52*smt` is now known as smt
04:28:52FromGitter<cn-care> How to operate float64 dividing?
05:12:06*r3d9u11 joined #nim
05:14:42*max3 quit (Quit: Connection closed for inactivity)
05:47:16*r3d9u11 quit (Remote host closed the connection)
06:05:06*nsf joined #nim
06:25:56TangerHey guys, is there any issue with putting `quit` inside a template?
06:38:21FromGitter<narimiran> @cn-care can you be more specific?
06:38:52*arecaceae quit (Remote host closed the connection)
06:39:10*arecaceae joined #nim
06:39:15FromGitter<terasakisatoshi> ``
06:42:19*yglukhov joined #nim
06:46:04*gokr joined #nim
07:02:11*yglukhov quit (Remote host closed the connection)
07:02:37*xet7 joined #nim
07:03:35*yglukhov joined #nim
07:12:51*Trustable joined #nim
07:25:00*floppydh joined #nim
07:48:40*Cthalupa quit (Ping timeout: 268 seconds)
07:51:52*Cthalupa joined #nim
07:56:05*jaco60 joined #nim
07:59:02*sendell joined #nim
08:02:52*SenasOzys joined #nim
08:03:43*rokups joined #nim
08:12:15Araqthat templates do not work in .async is a major pita
08:14:59*xkapastel quit (Quit: Connection closed for inactivity)
08:15:26euantorThe issues with `try/except` inside `{.async.}` can be confusing for people too
08:16:14FromGitter<alehander42> why does `{.async.}` matter for templates at all?
08:19:03Araqasync needs to transform 'await' and 'return'
08:19:18Araqso these cannot be used in a template
08:19:33Araqbecause .async wouldn't see these
08:19:54Araqthough maybe it would work in local templates hmmm
08:20:53FromGitter<alehander42> ah, so you can't invoke the async macro after all body macros have expanded ?
08:26:09Araqit takes an 'untyped' body
08:26:21*athenot quit (Ping timeout: 240 seconds)
08:26:33Araqand has to because 'await' is not declared anywhere
08:27:43*athenot joined #nim
08:40:03*Tanger quit (Quit: Leaving)
08:43:31*Vladar joined #nim
09:03:48FromGitter<Varriount> What about giving "await" a dummy value?
09:07:07AraqI want to introduce 'semityped' for macros, RFC pending
09:07:33Araqthis would solve all these composability problems with macros
09:07:36FromGitter<alehander42> yeah, that's how I did the js `async` macro too, but still maybe you can generate a new asyncFinish pragma for typed and then analyze after expanding the others
09:07:39FromGitter<alehander42> but probably not
09:07:42FromGitter<alehander42> ah semityped
09:12:39*dddddd joined #nim
09:13:02FromGitter<Varriount> Araq: How would the problem of value aliasing be fixed with openarrays? For example, for a procedure `proc foo(s: var string, a: openarray[char])`, if `s` and `a` are aliases, modifying `s` might cause `a` to become invalid?
09:14:33Araqthat's a callsite aliasing issue
09:16:52FromGitter<Varriount> I suppose, but aliasing analysis can't be perfect, can it?
09:18:19Araqthe answer to all static analysis problems is: you choose a pessimistic approximation
09:22:04Araqbut if you embrace value based datatypes the analysis is rather easy, two locations overlap iff a is subtree of b or vice versa
09:22:37FromGitter<alehander42> is that subtree cmp slow though, can it slow down typecheck
09:24:27FromGitter<Varriount> By pessimistic approximation, you mean failing the aliasing check if it can't be definitively determined?
09:24:44Araqyes.
09:26:35Araqbut note that I'm not trying to solve the aliasing problem for v1, it comes up rarely and we have bigger problems
09:26:59Araqalso you can generate runtime checks to prevent it.
09:50:29*athenot quit (Ping timeout: 252 seconds)
10:01:35dom96To fix the template problem we can simply implement support for {.async.} on templates
10:06:25dom96Unless I'm missing something
10:14:01Araqhmm
10:14:24AraqI doubt templates support macro transformations
10:27:14*BitPuffin joined #nim
10:33:05dom96oh
10:36:48dom96that's a shame
10:42:05*vlad1777d joined #nim
10:44:30*natrys joined #nim
10:53:45*dddddd quit (Ping timeout: 264 seconds)
11:00:51FromGitter<zetashift> Is there a chance Vladar4's SDL(https://github.com/Vladar4/sdl2_nim) could become the main one? I found it a lot easier to get started with than the current one in the nim github
11:02:09dom96Araq: https://github.com/niv/websocket.nim/issues/31#issuecomment-377141566
11:02:12dom96Soon the default?
11:02:31*Snircle joined #nim
11:03:12dom96zetashift: I'd love to, but what does that entail?
11:09:36FromGitter<zetashift> Well the easy way would probably be adding a line to the nimlangs sdl repo saying "We recommend the package of Vladar4, it includes a lot more bells and whistles" and letting Vladar4 know through a quick PM maybe
11:11:56dom96okay, feel free to PR that
11:13:35FromGitter<zetashift> Ah cool brb learning about Git! hehe
11:16:26dom96You should be able to just click the edit button on github
11:20:38FromGitter<zacharycarter> wait - why?
11:20:46FromGitter<zacharycarter> nothing is wrong with the official sdl2 bindings
11:20:51*dddddd joined #nim
11:21:03FromGitter<zacharycarter> and if we're going to go down this route - we might as well deprecate the official ones
11:21:04FromGitter<admin0day> when i run nim source code it can't jump to definition in visual studio code
11:21:15FromGitter<zacharycarter> do you have nimsuggest running?
11:21:16FromGitter<admin0day> btw my nim is 0.18.0
11:24:11FromGitter<admin0day> yes i do
11:24:41FromGitter<zacharycarter> and you have the vscode nim extension installed?
11:25:09FromGitter<admin0day> yes, i do it twice
11:27:08FromGitter<zacharycarter> not sure then... I don't generally have issues clicking through source with vscode and nim
11:27:33FromGitter<zacharycarter> I just tried and it works :P
11:27:42FromGitter<zacharycarter> hrmm what else could it be...
11:28:38FromGitter<zacharycarter> is hovering working?
11:29:07FromGitter<zacharycarter> I wonder if the extension is even working at all
11:29:11FromGitter<zacharycarter> syntax highlighting?
11:29:26Yardanicoadmin0day: do you have nim in your PATH?
11:29:50Yardanicoif you don't - extension will not be able to do error checking or autocompletion/go to definition
11:29:56FromGitter<admin0day> yes just lighting up
11:31:52FromGitter<admin0day> just return message when i ran nim -v
11:32:15FromGitter<admin0day> it seem the path is working
11:32:41FromGitter<zacharycarter> unless your cwd is nim/bin :P
11:34:22*vlad1777d quit (Ping timeout: 268 seconds)
11:34:53FromGitter<admin0day> i am also install the nim under win10's ubuntu
11:35:44FromGitter<admin0day> the problem still exist
11:38:46*athenot joined #nim
11:39:29FromGitter<zacharycarter> maybe it's related to - https://github.com/pragmagic/vscode-nim/issues/58 ? I don't know
11:39:35FromGitter<zacharycarter> I gotta get ready for work, be back later
11:41:53*SenasOzys quit (Ping timeout: 248 seconds)
11:42:44FromGitter<admin0day> when i run ./koch.exe tools -d:release it returns bin\nim.exe c --noNimblePath -p:compiler -d:release -o:bin\nimsuggest.exe nimsuggest/nimsuggest.nim ⏎ Hint: used config file 'D:\Dev\nim-0.18.0_x64\nim-0.18.0\config\nim.cfg' [Conf] ⏎ Hint: system [Processing] ⏎ Error: cannot open 'D:\Dev\nim-0.18.0_x64\nim-0.18.0\lib\system.nim' ⏎ FAILURE [https://gitter.im/nim-lang/Nim?at=5abcd13492f5d62057719a6d]
11:42:55FromGitter<admin0day> when i run ./koch.exe tools -d:release it returns bin\nim.exe c --noNimblePath -p:compiler -d:release -o:bin\nimsuggest.exe nimsuggest/nimsuggest.nim ⏎ Hint: used config file 'D:\Dev\nim-0.18.0_x64\nim-0.18.0\config\nim.cfg' [Conf] ⏎ Hint: system [Processing] ⏎ Error: cannot open 'D:\Dev\nim-0.18.0_x64\nim-0.18.0\lib\system.nim' ⏎ FAILURE [https://gitter.im/nim-lang/Nim?at=5abcd13fc4d0ae800713eb47]
11:47:13FromGitter<admin0day> 版本 1.21.1 ⏎ 提交 79b44aa704ce542d8ca4a3cc44cfca566e7720f1 ⏎ 日期 2018-03-14T14:46:47.128Z ⏎ Shell 1.7.9 ⏎ 渲染器 58.0.3029.110 ... [https://gitter.im/nim-lang/Nim?at=5abcd241e4ff28713a87d57c]
11:49:10*SenasOzys joined #nim
11:49:21FromGitter<admin0day> my vscode version notes↑
11:49:34*SenasOzys quit (Remote host closed the connection)
11:50:41*SenasOzys joined #nim
12:08:59*DarkArctic quit (Read error: Connection reset by peer)
12:14:56*rockcavera quit (Ping timeout: 276 seconds)
12:16:36*Trustable quit (Remote host closed the connection)
12:17:07FromGitter<Yardanico> @admin0day if you install nim under win10's ubuntu you wouldn't be able to use it in VSCode
12:17:33FromGitter<Yardanico> about your ./koch tools - it's very strange, maybe you can just use choosenim?
12:17:41FromGitter<Yardanico> remove your existing nim installation and install nim using choosenim
12:18:58dom96yay for suggesting choosenim :)
12:25:05*gokr left #nim (#nim)
12:36:59*Trustable joined #nim
12:37:24FromGitter<zetashift> @zacharycarter when I first tried out the sdl2 package in the nim repo, it absolutely fine no hate on that, I just think that Vladar4 one, because it has support for some other nifty stuff and has nicer docs/examples, that when one someone is looking for a sdl2 package for Nim they'd want that one. Most likely this only counts for beginners, as more sdl2-savvy people wouldn't really give too much about it
12:40:58FromGitter<narimiran> nay for suggesting choosenim on windows - only 32bit version available ;)
12:42:14FromGitter<zetashift> @narimiran fwiw I haven't encountered any problems with the 32bit choosenim so far
12:46:46FromGitter<narimiran> @zetashift i had some monstrosity of code :D
12:47:55FromGitter<mratsim> I think my loop fusion library is feature complete. https://github.com/numforge/loop-fusion. I just have an issue @Araq, I can do that `forEach x in a, y in b, z in c:` but this won’t parse `let c = forEach x in a, y in b:`. I have to had parenthesis `let c = forEach(x in a, y in b):`. Will it be allowed in the future for for expression?
12:48:28FromGitter<narimiran> hey @mratsim, you might know - is it better to have `a*a` instead of `a^2`, where `a` is a float. any performance differences?
12:48:28FromGitter<mratsim> have to add*
12:48:42FromGitter<mratsim> a*a is always faster
12:49:05FromGitter<mratsim> but a proper compiler will transform a^2 into a*a anyway
12:49:28FromGitter<narimiran> i thought it might be, and i noticed the difference when compiling it without `-d:release`. using that, i didn't notice the difference....
12:50:23FromGitter<mratsim> If you really ant in-depth optimizing information: check the number of cycles and latencies of each x86 instructions here: http://www.agner.org/optimize/optimizing_cpp.pdf
12:50:28FromGitter<mratsim> want*
12:50:40FromGitter<narimiran> i don't :D :D
12:52:59*Trustable quit (Remote host closed the connection)
13:05:29*nsf quit (Quit: WeeChat 2.0.1)
13:06:32FromGitter<phrmoy> Good morning Nim heros!
13:11:26FromGitter<diegogub> @phrmoy morning!
13:16:59*athenot_ joined #nim
13:17:21*athenot quit (Ping timeout: 240 seconds)
13:20:37*athenot joined #nim
13:21:21*athenot_ quit (Ping timeout: 240 seconds)
13:26:03FromGitter<zetashift> Wish it was morning here!
13:30:35*rockcavera joined #nim
13:31:02*rockcavera quit (Remote host closed the connection)
13:32:14*rockcavera joined #nim
13:37:06*xkapastel joined #nim
13:46:26FromGitter<zacharycarter> gitlab kubernetes integration is pretty nice - and the auto devops thing is even nicer
13:49:08FromGitter<alehander42> interesting
13:49:18FromGitter<alehander42> "If there is a Dockerfile, it will use docker build to create a Docker image."
13:49:32FromGitter<zacharycarter> yeah - and if you have kube integration set up
13:49:33FromGitter<alehander42> where is this container registry ?
13:49:37FromGitter<zacharycarter> it will deploy straight to your kube cluster
13:49:49FromGitter<alehander42> is that for instances only ?
13:49:54FromGitter<alehander42> (or also for gitlab.com ? )
13:50:13FromGitter<zacharycarter> I think any gitlab repo can upload containers to the container registry
13:50:31FromGitter<zacharycarter> so every repo comes with container registry support I guess is what I'm trying to say
13:50:34FromGitter<alehander42> hm, but is the gitlab.com container registry public
13:50:56FromGitter<zacharycarter> I don't think so
13:51:03FromGitter<zacharycarter> you have to auth with gitlab to access it
13:51:37FromGitter<zacharycarter> https://gitlab.com/help/user/project/container_registry
13:51:41FromGitter<alehander42> hm, I was just preparing a docker image for gitlab CI, I planned to use a runner on a local machine as I did before
13:53:23FromGitter<zacharycarter> maybe try out auto devops :D
13:55:42FromGitter<zetashift> Any reason why I would get a stdin.write() error on Windows10(x64): ```nimonkey.nim(7) nimonkey ⏎ repl.nim(8) startRepl ⏎ sysio.nim(80) checkErr ⏎ sysio.nim(72) raiseEIO ⏎ system.nim(2833) sysFatal ... [https://gitter.im/nim-lang/Nim?at=5abcf05ee4ff28713a887831]
13:55:58FromGitter<zetashift> echo() works fine
13:57:06FromGitter<zetashift> Nvm I'm dumb
14:05:02FromGitter<Vindaar> having Nim compile to C is just awesome. cross compiled some hello world code for a ZynqBerry, a board w/ Raspberry Pi form factor but a Xilinx Zynq SoC (FPGA + 2 ARM cores) and `it just works™`
14:06:10*DarkArctic joined #nim
14:06:15FromGitter<zetashift> Write a small blogposts about your adventure so people know it too ><
14:06:43FromGitter<Vindaar> already planned :)
14:09:25FromGitter<zacharycarter> > Nvm I'm dumb ⏎ ⏎ My response to basically every question I ask in here
14:16:25*PMunch joined #nim
14:16:42PMunchfowlmouth, you on anywhere?
14:17:17*r3d9u11 joined #nim
14:17:50r3d9u11hello
14:18:57r3d9u11Is there casting to sequence for openarray (without manually looping)?
14:20:03FromGitter<zetashift> @r3d9u11 : try feeding it to toSeq() ?
14:20:09FromGitter<zetashift> it's in sequtils
14:20:55r3d9u11yes, it's not for openarray :(
14:23:50r3d9u11maybe. I have exception: 'invalid type: 'openarray[int]' in this context: 'seq[openarray[int]]''
14:24:54FromGitter<zacharycarter> PMunch: fowl hasn't been around for a whileeeeee
14:25:14FromGitter<zacharycarter> openarray isn't a concrete type
14:25:18FromGitter<zacharycarter> so that's not going to work I don't think
14:25:26FromGitter<zacharycarter> it can only be used as a parameter
14:25:45PMunchzacharycarter, ah that's a shame..
14:26:04FromGitter<zacharycarter> what's your question? I've worked with quite a few of his repos
14:26:13PMunchJust got linked to his glossolalia library and wanted to ask about it
14:26:31PMunchThis thing: https://github.com/fowlmouth/glossolalia
14:28:27*PMunch quit (Quit: Leaving)
14:30:52FromGitter<zacharycarter> ah yeah - that one I haven't worked with
14:30:56FromGitter<zacharycarter> but it does look interesting :)
14:45:51FromGitter<andreaferretti> can anyone recall which are the available GC options?
14:46:08FromGitter<andreaferretti> markAndSweep, bohem, go, v2?
14:46:44FromGitter<andreaferretti> I thought it was written here https://nim-lang.org/docs/gc.html but I cannot find it
14:47:13*endragor quit (Remote host closed the connection)
14:48:01*r3d9u11 quit (Ping timeout: 248 seconds)
14:50:07FromGitter<andreaferretti> also, is there a reason why using `--gc:v2` I find shared lists in `system`, while they have to be imported with `import slist` otherwise? are the two implementations even the same?
14:56:20*WhiskeyNick joined #nim
14:58:29*Vladar quit (Quit: Leaving)
14:59:12*BitPuffin quit (Remote host closed the connection)
15:05:06*miran joined #nim
15:06:25*endragor joined #nim
15:06:26Araqwhat do you mean?
15:06:37Araqthe GC needs shared lists for --threads:on
15:11:09*endragor quit (Ping timeout: 264 seconds)
15:18:49FromGitter<andreaferretti> well, I mean that I had a program using shared lists, hence it had `import slist` on top
15:19:17FromGitter<andreaferretti> suddenly when using `--gc:v2`, I got an error message that `SharedList` was ambiguous
15:19:40FromGitter<andreaferretti> it could be either `system.SharedList` or `slist.SharedList`
15:20:40FromGitter<andreaferretti> I assume `system` is only reexporting `slist`, right?
15:23:17*nsf joined #nim
15:25:08Araqthat's a bug, v2 should use 'import', not 'include'
15:38:25*Vladar joined #nim
15:49:39*gokr joined #nim
15:49:48*gokr left #nim (#nim)
16:08:14*jrbrt joined #nim
16:12:10*r3d9u11 joined #nim
16:16:51FromGitter<Varriount> Araq: Should the strutils.find procedures display invalid behavior when the start and end parameters are outside the range of the string?
16:20:34Araqwell they shouldn't corrupt memory in debug mode
16:23:05Araqbut I actually they should just work. if start >= input.len, find doesn't find anything.
16:40:48*gokr joined #nim
16:41:06*gokr left #nim (#nim)
16:44:10FromGitter<mratsim> @andreaferretti : deferred reference counting with cycle detection (default), mark and sweep, boehm or no GC (memory regions) (I had to hunt them for the D vs Nim comparison repo)
16:44:36FromGitter<mratsim> stack == none = regions so a bit confusing
16:48:58*btbytes joined #nim
16:50:48Araqnim --advanced
16:50:58Araq --gc:refc|v2|markAndSweep|boehm|go|none|regions
16:51:13*sendell quit (Remote host closed the connection)
16:55:58*vivus joined #nim
17:02:24*btbytes quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:03:34*btbytes joined #nim
17:11:31*Sargun joined #nim
17:11:40SargunHow do I wait for a message across multiple channels?
17:14:26*kinkinkijkin quit (Read error: Connection reset by peer)
17:23:31miranhttps://forum.nim-lang.org/t/3701/2
17:23:45mirancan you guys open this link, or do you see 404?
17:24:29*kinkinkijkin joined #nim
17:26:20dom96miran: fixed
17:26:26dom96Sargun: I don't think that's implemented
17:26:39mirandom96: now that was fast!
17:27:01Sargundom96: so you have to wait across multiple flowvars?
17:30:40*btbytes quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:34:23dom96Sargun: I think so.
17:34:25*btbytes joined #nim
17:34:32*btbytes quit (Client Quit)
17:35:58*btbytes joined #nim
17:35:59dom96hrm, you can use awaitAny it seems
17:36:17dom96https://nim-lang.org/docs/threadpool.html#awaitAny,openArray[FlowVarBase]
17:36:28dom96Well I'm confused, you asked about channels and then mentioned flowvars
17:36:42FromGitter<abijahm> Hello people, whats wrong with this generic code ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abd242a270d7d370871dc20]
17:37:01*Snircle quit (Read error: Connection reset by peer)
17:37:08*floppydh quit (Quit: WeeChat 2.1)
17:37:29dom96https://github.com/nim-lang/Nim/issues/3850
17:37:41*Snircle joined #nim
17:46:21FromGitter<abijahm> @dom96 procedures give the same error
17:47:27*SenasOzys quit (Ping timeout: 240 seconds)
17:51:37kinkinkijkinis there a way to use a switch statement to check all of the first parts of tuples in a seq of tuples?
17:51:39kinkinkijkinlike
17:52:37kinkinkijkincase myVar: of matching name in myTupleSeq.name
17:52:40kinkinkijkinor something like that
17:52:47dom96abijahm: can you paste what code you have for that?
17:53:11dom96kinkinkijkin: Sounds like you want pattern matching?
17:53:20kinkinkijkinyeah I guess
17:53:46kinkinkijkinidk for sure
17:53:50mirankinkinkijkin: what are you doing after you check that?
17:54:17kinkinkijkinusing the second variable in the matched tuple to set a variable
17:54:43miranany simple (pseudo) code example?
17:55:04kinkinkijkinthe way I was doing it before was with a for loop
17:56:07kinkinkijkinfor pair in mytupleseq: if input == pair.name: somevar = pair.token
17:58:11kinkinkijkinthe way I'd want to do it with cases is probably something like
17:58:57kinkinkijkincase input: of name from pair in myTupleSeq: somevar = pair.token
17:59:49*nsf quit (Quit: WeeChat 2.0.1)
18:00:38*SenasOzys joined #nim
18:01:17mirani would do it like your first example with for loop. but somebody more experienced might give you some beter idea....
18:01:43kinkinkijkinthe idea is that with cases it could be much faster, because then I don't have to iterate
18:01:57kinkinkijkindepending on the implementation of something so ridiculous
18:01:58FromGitter<alehander42> hm the julia guys have some weird integration of their gitter activity panel which shows the newest stack overflow questions
18:02:08FromGitter<alehander42> I didnt know gitter has this
18:03:04mirankinkinkijkin: well, if you need to find one tuple that matches inside of seqOfTuples, iteration will happen, one way or another
18:03:42kinkinkijkinI guess
18:03:48miranwhat you didn't write in the example is that you should probably `break` as soon as you find your first match
18:03:53*SenasOzys_ joined #nim
18:04:03*SenasOzys quit (Read error: Connection reset by peer)
18:04:11FromGitter<abijahm> @dom96 ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abd2a9be3d0b1ff2c7fc450]
18:05:53FromGitter<dom96> @abijahm ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abd2b01bb1018b37a3ba988]
18:06:15kinkinkijkinI'm not entirely sure how a switch statement works, I know that it's faster than an if statement when it makes sense to use over an if statement, but I'm not entirely sure of the assembly generated
18:07:04kinkinkijkinI know most modern ISAs have some sort of stuff facilitating it, which is why it exists in the first place, but I don't actually know what happens
18:08:23*dgwana joined #nim
18:09:54FromGitter<abijahm> @dom96 thanks
18:11:07*Trustable joined #nim
18:11:19*kinkinkijkin_ joined #nim
18:11:29kinkinkijkin_okay apparently that last part I said is false
18:11:39kinkinkijkin_it's entirely compiler optimizations
18:11:55*kinkinkijkin quit (Disconnected by services)
18:11:59*kinkinkijkin_ is now known as kinkinkijkin
18:13:52*btbytes quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:16:17*btbytes joined #nim
18:16:38FromGitter<abijahm> @dom96 now i get ⏎ ⏎ ```prog.nim(8, 10) Error: attempting to call undeclared routine: 'value'``` [https://gitter.im/nim-lang/Nim?at=5abd2d85e4ff28713a89b15c]
18:17:55dom96Without your code I can't help...
18:19:20vivusDoes anybody use gitlab pages?
18:20:51FromGitter<abijahm> sorry didnt realise the when
18:24:47FromGitter<abijahm> whats the difference between when and if
18:25:07kinkinkijkinwhen is evalued at compile time
18:25:14*PMunch joined #nim
18:33:35kinkinkijkinporting a project started in C# when I didn't really know what I was doing and it's got so many massive hacks, like I expanded commands by literally just placing them again in the command queue
18:33:54kinkinkijkininstead of evaluating their length at their run time
18:35:14kinkinkijkinI had a whole 7-layer-deep function just for expanding loop zone commands
18:44:39*r3d9u11 quit (Remote host closed the connection)
18:45:18*r3d9u11 joined #nim
18:54:09*r3d9u11 quit (Remote host closed the connection)
18:57:46*btbytes quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:02:23FromGitter<abijahm> thanks
19:04:17*btbytes joined #nim
19:07:16FromGitter<krux02> I wonder why libffi doesn't work out to be the way to call C functions from the nim compiler.
19:07:32FromGitter<krux02> I mean Araq wrote a libffi wrapper
19:12:39*btbytes quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:17:42*gokr joined #nim
19:33:02*DarkArctic quit (Ping timeout: 276 seconds)
19:34:46*jjido joined #nim
19:36:55*yglukhov quit (Read error: Connection reset by peer)
19:37:27*yglukhov joined #nim
19:38:24FromGitter<genotrance> @krux02: why would you need that when nim can importc so easily?
19:45:23kinkinkijkinare you able to "case true: of bool1: sth of bool2: sth" ?
19:45:56Yardanicogenotrance: maybe FFI at compile-time?
19:46:08Yardanicokinkinkijkin, yes
19:46:28Yardanicobut maybe it's better to use "if true: bool1 else: bool2"
19:47:08kinkinkijkinI mean like equivalent to
19:47:18kinkinkijkinif bool1: elif bool2:
19:48:09FromGitter<genotrance> is it possible to figure out the signature of a proc in a macro?
19:50:03FromGitter<krux02> @genotrace: the problem is you cannot call C functions at compile time at all at the moment.
19:50:08FromGitter<krux02> And acutally it is a hard problem in C
19:50:26FromGitter<krux02> but the hard part has been done already as libffi.
19:51:20FromGitter<genotrance> makes sense
19:55:42FromGitter<krux02> I just tried out libffi and it works so far pretty well
19:57:38*yglukhov quit (Remote host closed the connection)
19:57:54*nsf joined #nim
19:58:04*yglukhov joined #nim
19:59:27*yglukhov quit (Read error: Connection reset by peer)
20:00:02*yglukhov joined #nim
20:01:15PMunchHmm, I wonder if I can get Vim to highlight doc-comments as RST..
20:11:20FromGitter<wu-lee> Anyone seen Nim's transpiled code make gcc barf like this before? ⏎ nimcache/ball.c:237:16: error: expected ‘;’ before ‘->’ token ⏎ T1_ = &&result->Sup; ⏎ ⏎ ``` ^``` [https://gitter.im/nim-lang/Nim?at=5abd4867bb1018b37a3c3b68]
20:12:32*find0x90 joined #nim
20:19:50FromGitter<zetashift> wait what did you compile the C generated code and not running nim c? :O
20:21:12*find0x90 quit (Quit: find0x90)
20:22:20Araqwu-lee. yeah. don't use 'var ref MyObject'
20:24:18Yardanico@wu-lee and for gerenal info - it's better to call that "compilation" and not "transpilation" :)
20:25:20FromGitter<wu-lee> @araq, @Yardanico, thanks, ok
20:25:40*find0x90 joined #nim
20:26:45FromGitter<wu-lee> I'm not explicitly var-reffing, but seems I'm calling a proc accepting a var, supplying a ref
20:27:22FromGitter<wu-lee> Which I had thought Nim would implicitly do the right thing for...
20:30:36Araqwell it's a bug, report it if you want to. but it's caused by wrong code
20:30:46Araqwhen it fixed the compiler will reject your program.
20:32:58*yglukhov quit (Remote host closed the connection)
20:34:15FromGitter<wu-lee> Odd, I see one of the signatures for new is `proc new*T (a: var ref T)`, which seems to violate that rule...
20:34:23*btbytes joined #nim
20:34:37*miran_ joined #nim
20:34:41*miran quit (Ping timeout: 248 seconds)
20:35:39*miran_ quit (Client Quit)
20:35:50*xet7 quit (Quit: Leaving)
20:36:52*btbytes quit (Client Quit)
20:36:55Araq'var ref T' itself is fine but you passed a subtype
20:37:20*btbytes joined #nim
20:37:40*btbytes quit (Client Quit)
20:40:03*btbytes joined #nim
20:40:42*user1101 quit (Ping timeout: 246 seconds)
20:42:17*find0x90 quit (Quit: find0x90)
20:42:37*user1101 joined #nim
20:42:46*Trustable quit (Remote host closed the connection)
20:50:35*jrbrt quit (Quit: Oíche mhaith)
20:52:11*btbytes quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:55:36*vivus quit (Quit: Leaving)
20:59:32*yglukhov joined #nim
21:03:05*jaco60 quit (Read error: Connection reset by peer)
21:04:22*btbytes joined #nim
21:05:49FromGitter<genotrance> are nim tests failing right now?
21:06:26*xet7 joined #nim
21:07:20FromGitter<genotrance> tvmmisc.nim(23) tvmmisc ⏎ lib\pure\algorithm.nim(199) sort ⏎ lib\pure\algorithm.nim(130) merge ⏎ lib\pure\algorithm.nim(25) * ⏎ lib\pure\algorithm.nim(25, 22) Error: unhandled exception: value out of range [https://gitter.im/nim-lang/Nim?at=5abd5588e3d0b1ff2c80983f]
21:08:25*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:10:17*rokups quit (Quit: Connection closed for inactivity)
21:13:03Araqthe CIs are silent
21:16:43FromGitter<genotrance> tried testament on my local machine
21:17:06FromGitter<genotrance> i'm up to date and it fails for cat vm which I was planning on adding some tests to
21:17:22Araqwhich OS?
21:17:27FromGitter<genotrance> Win10
21:17:30FromGitter<genotrance> 32-bit
21:17:43FromGitter<genotrance> am trying on my ubuntu box to compare
21:17:48Araqhmm that may be it, appveyor is 64bit
21:20:13FromGitter<genotrance> yep - works fine on my linux box
21:28:31*nsf quit (Quit: WeeChat 2.0.1)
21:28:40FromGitter<genotrance> @Araq should I submit issues for test failures on 32-bit Windows?
21:30:13Araqhmm sure
21:30:59Araqbut we also need appveyor for 32bit
21:31:21Araqnot sure how to pull that off though.
21:34:38*jrbrt joined #nim
21:34:43FromGitter<data-man> Yes, 32bit for appveyor. :) As template we can grab appveyor.yml from facebook/zstd: https://github.com/facebook/zstd/blob/dev/appveyor.yml
21:35:14Araqwe have it in our appveyor.yml
21:35:18Araqbut it's commented out
21:38:20SargunCan you pass a channel over a spawn?
21:40:33Araqif you use a 'ptr' to it
21:42:21Sargunhttps://gist.github.com/sargun/dc3e01db5320a6119768a2d663e7e69c
21:42:44Sargununfortunately, that throws a type mistmatch
21:43:01Sargunin the recv
21:43:39Araqrecv(chan[])
21:43:41Sargunin the recv
21:43:42Sargunerr
21:43:55Sargunis that requivalent to x[].recv()
21:45:03Araqyes
21:46:47FromGitter<krux02> Araq: I saw you made a libffi wrapper for Nim
21:47:48FromGitter<krux02> I wonder if it should be used as the default way to call into C libraries from Nim compiler.
21:50:54AraqI've told this story a couple of times now.
21:51:21Araqcompiler/evalffi.nim works. the VM can use libffi to call into native code.
21:51:51Araqor at least it used to work. at one point I got an SDL renderer work at compile-time
21:52:15Araqbut it opens a can of worms
21:52:45Araqand we have enough "fails when you look at it closely" problems in Nim already.
21:54:04SargunAraq: if It's a ref, how do I construct it? https://gist.github.com/sargun/298db9e8aa32a3d5f3cb49c4b2a56c17
21:55:55Araq1. with 'new'. please read a tutorial.
21:56:15Araq2. since you want to pass the channel across thread boundaries, use 'ptr', not 'ref'.
21:56:54Araqand spawn allows parameter passing anyway, you don't need a channel.
21:58:24*natrys quit (Quit: natrys)
22:03:54SargunAraq: ref seems to work
22:03:54*btbytes quit (Read error: Connection reset by peer)
22:05:00PMunchHmm, this is strange
22:05:02PMunchhttp://ix.io/14fD/
22:05:16PMunchThat fails with a SIGSEGV
22:05:32PMunchhttp://ix.io/14fF/
22:05:49Sargunrefs are copied right -- but channels can be copied safely, I thought
22:09:41*gokr quit (Ping timeout: 276 seconds)
22:09:51FromGitter<krux02> hmm I wonder how I can utilize this libffi from macros
22:12:56PMunchInterestingly it's only the second line that fails, the first one works fine..
22:13:01*Vladar quit (Quit: Leaving)
22:14:41dom96ooh yay, a compiler segfault
22:14:45PMunchAnd splitting it up over two lines so one initializes the object with "option: 1" and the next sets the value works fine
22:15:00PMunchYeah, seems like a compiler bug
22:16:46kinkinkijkinwhat's the constructor for a set? I want to create a set of a single char
22:17:02kinkinkijkinbecause one of the strutils procs requires a set
22:17:10kinkinkijkinbut I need to use it with a single char
22:19:26Araq{'a'}
22:19:31kinkinkijkinthanks
22:22:51*find0x90 joined #nim
22:22:51FromGitter<genotrance> does testament run multiple threads or in sequence?
22:25:44*gokr joined #nim
22:25:51SargunAraq: Do you have a pointer to any tutorials that explain pointers in nim
22:26:44SargunAraq: Around concurrency, locking rules, etc
22:26:45*endragor joined #nim
22:26:49Sargunand GC rules
22:31:43*endragor quit (Ping timeout: 260 seconds)
22:32:12kinkinkijkinokay, apparently you can't use .startsWith(Digits)
22:32:17kinkinkijkinthat seems a little silly
22:32:42PMunchSargun, this might help https://peterme.net/nim-types-originally-a-reddit-reply.html
22:32:44kinkinkijkincould just implement an iterator that checks each item in a set
22:33:10PMunchNot so much about concurrency and locking rules, but should at least give you an overview of how types work in general in Nim
22:33:51PMunchkinkinkijkin, make a PR to strutils if you make one :) As you say it's a bit silly that it's not there
22:34:31PMunchWait, couldn't you just do "someString[0] in Digits"?
22:35:00PMunchCheck if the first character of a string is in the Digits character set
22:35:39kinkinkijkinthe line I'm using this in is
22:36:24kinkinkijkinelif line.lin.startsWith('c') and lin.lin.strip(true, false, {'c'}).startsWith(Digits):
22:36:32kinkinkijkinI know it's messy
22:36:41kinkinkijkinline.lin*
22:37:07*user1101 quit (Quit: user1101)
22:38:21PMunchYeah, so change it to this:
22:38:39PMunchelif line.lin.startsWith('c') and lin.lin.strip(true, false, {'c'})[0] in Digits:
22:38:57kinkinkijkinokay, I'll try that, thanks!
22:39:06kinkinkijkinwould still be nice to have the convenience proc in strutils though
22:39:24PMunchAgreed, make a pull request for it :)
22:39:37kinkinkijkinunfortunately I'm not so good at working with strings
22:42:10*find0x90_ joined #nim
22:42:48*gokr quit (Ping timeout: 260 seconds)
22:43:13*find0x90 quit (Ping timeout: 248 seconds)
22:43:33*yglukhov quit (Read error: Connection reset by peer)
22:44:07*yglukhov joined #nim
22:47:16*yglukhov quit (Remote host closed the connection)
22:55:47FromGitter<zetashift> I just spend 1 hour trying to map an AST written in Go to Nim with like 30+ lines of code and now I see this: https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants
22:55:53FromGitter<zetashift> well played Nim, well played
22:56:56Araqmaybe read the tutorials before programming in Nim.
22:57:10Araqthey are not that long iirc.
22:57:11kinkinkijkinyeah, and also do it while doing so at first
22:58:32FromGitter<zetashift> Araq, I did and I liked it. However can't remember everything so when I had this mapping problem I went back to it
22:59:00Araqalright, sorry :-)
22:59:25FromGitter<zetashift> What I ment wasn't a stab at Nim, I liked how I needed so much Go code for what in Nim is quite concise
23:00:28kinkinkijkinI haven't heard much good about go but it's not a big surprise that nim does it smaller
23:00:45kinkinkijkina big design point of nim seems to be code compression
23:00:57FromGitter<zetashift> What I like about Nim's conciseness* sorry it's late here I should go to sleep
23:01:25kinkinkijkinsleep well, then
23:01:28kinkinkijkinif you do
23:01:49FromGitter<zetashift> With this newfound sexy code I'll probably be up for a bit more
23:02:18dom96I feel like this doesn't deserve the 'oui' package name https://github.com/dom96/oui
23:02:40kinkinkijkinI apparently have a problem with not expanding my code needlessly
23:03:22kinkinkijkinI search so much for the saving of a byte or two of memory per iteration of a loop that I make my code far slower
23:03:44kinkinkijkinmy nim looks a lot like c# in terms of sheer size
23:05:23FromGitter<zetashift> That's...a good quality?
23:05:40kinkinkijkinno
23:05:55kinkinkijkinI'm writing compiler tools for pseudodemoscene
23:06:28FromGitter<genotrance> @araq: how come getCurrentDir() is in nimscript.nim and scriptconfig.nim but doesn't work in a nims file?
23:07:06kinkinkijkingenerally demosceners like their tools running at double realtime or faster on their "modern" (xp-era) pcs and not going to swap
23:07:19kinkinkijkinbut my applications use so little memory they can fit in cache on my 2001 laptop
23:08:23*find0x90_ quit (Quit: find0x90_)
23:09:55*WhiskeyNick quit (Quit: Leaving)
23:10:42FromGitter<zetashift> Is demoscene referring to the groups in the Amiga times?
23:11:20dom96genotrance: It seems it's in nimscript.nim because `withDir` uses it
23:12:28kinkinkijkinzetashift yes, demoscene still exists
23:12:43kinkinkijkinit's less of demogroups and more of individuals making pieces of demos now
23:13:22kinkinkijkinmostly demomusic
23:14:01dom96kinkinkijkin: You heading to revision?
23:14:34kinkinkijkinnop
23:14:37kinkinkijkinI'm in canada
23:18:03kinkinkijkinI wish to live in france but I don't even live in québec, as québecois, and québec is where all of the speedrun marathons and canadian demoparties and metal shows are
23:18:21*SenasOzys_ quit (Ping timeout: 264 seconds)
23:18:36dom96I see
23:18:47dom96I've never personally been to a demoparty, but I'd love to go
23:18:57kinkinkijkinyeah they seem fun
23:19:50FromGitter<genotrance> @dom96, @Araq - so getCurrentDir() and setCurrentDir() are not exported - I always get thrown off by the missing *
23:21:23kinkinkijkinso the asterisk is needed? I'm confused about this still because I haven't tried using my audio library yet in my mml compiler
23:21:33dom96* means public
23:21:55kinkinkijkinI see
23:22:08kinkinkijkinit goes at the end of the proc name?
23:23:46FromGitter<genotrance> so are we okay adding pwd() = getCurrentDir(), cpDir() = copyDir(), mvDir() = moveDir() to nimscript?
23:24:16SargunIs there a way to ask Nim to generate more readable C?
23:27:18FromGitter<genotrance> I'd prefer reusing the same proc names as in os but given nimscript uses a different name for most of them already, I'm okay continuing with that
23:30:27*jrbrt quit (Quit: Oíche mhaith)
23:30:37*PMunch quit (Quit: Leaving)
23:33:04Araqugh
23:33:13Araqit uses different names because these are different
23:33:33Araqthey support the Whatif option etc
23:35:58FromGitter<genotrance> okay cool
23:36:58FromGitter<genotrance> https://github.com/nim-lang/Nim/issues/7393
23:39:22Araqare you shashlick?
23:39:50FromGitter<genotrance> yep
23:40:29FromGitter<genotrance> Matrix/Riot has been unreliable off late so switched to gitter
23:41:27FromGitter<genotrance> I submitted a PR for the vmops changes - https://github.com/nim-lang/Nim/pull/7440
23:42:58Araqcool :-)
23:49:33FromGitter<kinkinkijkin> wondering whether the fromgitter shows my git username or my git name
23:49:42kinkinkijkingit username
23:50:00*kinkinkijkin left #nim ("Leaving")
23:50:00FromGitter<mratsim> @miran here is an awesome low-level optimization I managed today. Carefully massaging the compiler into doing multiprecision addition with 2 instructions (including carry flag that we do not have access to): https://github.com/status-im/mpint/issues/10 (loop is unrolled it seems)
23:54:45*smt quit (Read error: Connection reset by peer)