00:07:59 | * | jrbrt quit (Quit: Oíche mhaith) |
01:21:36 | FromDiscord | <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:52 | FromGitter | <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:56 | Tanger | Hey guys, is there any issue with putting `quit` inside a template? |
06:38:21 | FromGitter | <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:15 | FromGitter | <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:15 | Araq | that templates do not work in .async is a major pita |
08:14:59 | * | xkapastel quit (Quit: Connection closed for inactivity) |
08:15:26 | euantor | The issues with `try/except` inside `{.async.}` can be confusing for people too |
08:16:14 | FromGitter | <alehander42> why does `{.async.}` matter for templates at all? |
08:19:03 | Araq | async needs to transform 'await' and 'return' |
08:19:18 | Araq | so these cannot be used in a template |
08:19:33 | Araq | because .async wouldn't see these |
08:19:54 | Araq | though maybe it would work in local templates hmmm |
08:20:53 | FromGitter | <alehander42> ah, so you can't invoke the async macro after all body macros have expanded ? |
08:26:09 | Araq | it takes an 'untyped' body |
08:26:21 | * | athenot quit (Ping timeout: 240 seconds) |
08:26:33 | Araq | and 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:48 | FromGitter | <Varriount> What about giving "await" a dummy value? |
09:07:07 | Araq | I want to introduce 'semityped' for macros, RFC pending |
09:07:33 | Araq | this would solve all these composability problems with macros |
09:07:36 | FromGitter | <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:39 | FromGitter | <alehander42> but probably not |
09:07:42 | FromGitter | <alehander42> ah semityped |
09:12:39 | * | dddddd joined #nim |
09:13:02 | FromGitter | <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:33 | Araq | that's a callsite aliasing issue |
09:16:52 | FromGitter | <Varriount> I suppose, but aliasing analysis can't be perfect, can it? |
09:18:19 | Araq | the answer to all static analysis problems is: you choose a pessimistic approximation |
09:22:04 | Araq | but 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:37 | FromGitter | <alehander42> is that subtree cmp slow though, can it slow down typecheck |
09:24:27 | FromGitter | <Varriount> By pessimistic approximation, you mean failing the aliasing check if it can't be definitively determined? |
09:24:44 | Araq | yes. |
09:26:35 | Araq | but note that I'm not trying to solve the aliasing problem for v1, it comes up rarely and we have bigger problems |
09:26:59 | Araq | also you can generate runtime checks to prevent it. |
09:50:29 | * | athenot quit (Ping timeout: 252 seconds) |
10:01:35 | dom96 | To fix the template problem we can simply implement support for {.async.} on templates |
10:06:25 | dom96 | Unless I'm missing something |
10:14:01 | Araq | hmm |
10:14:24 | Araq | I doubt templates support macro transformations |
10:27:14 | * | BitPuffin joined #nim |
10:33:05 | dom96 | oh |
10:36:48 | dom96 | that'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:51 | FromGitter | <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:09 | dom96 | Araq: https://github.com/niv/websocket.nim/issues/31#issuecomment-377141566 |
11:02:12 | dom96 | Soon the default? |
11:02:31 | * | Snircle joined #nim |
11:03:12 | dom96 | zetashift: I'd love to, but what does that entail? |
11:09:36 | FromGitter | <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:56 | dom96 | okay, feel free to PR that |
11:13:35 | FromGitter | <zetashift> Ah cool brb learning about Git! hehe |
11:16:26 | dom96 | You should be able to just click the edit button on github |
11:20:38 | FromGitter | <zacharycarter> wait - why? |
11:20:46 | FromGitter | <zacharycarter> nothing is wrong with the official sdl2 bindings |
11:20:51 | * | dddddd joined #nim |
11:21:03 | FromGitter | <zacharycarter> and if we're going to go down this route - we might as well deprecate the official ones |
11:21:04 | FromGitter | <admin0day> when i run nim source code it can't jump to definition in visual studio code |
11:21:15 | FromGitter | <zacharycarter> do you have nimsuggest running? |
11:21:16 | FromGitter | <admin0day> btw my nim is 0.18.0 |
11:24:11 | FromGitter | <admin0day> yes i do |
11:24:41 | FromGitter | <zacharycarter> and you have the vscode nim extension installed? |
11:25:09 | FromGitter | <admin0day> yes, i do it twice |
11:27:08 | FromGitter | <zacharycarter> not sure then... I don't generally have issues clicking through source with vscode and nim |
11:27:33 | FromGitter | <zacharycarter> I just tried and it works :P |
11:27:42 | FromGitter | <zacharycarter> hrmm what else could it be... |
11:28:38 | FromGitter | <zacharycarter> is hovering working? |
11:29:07 | FromGitter | <zacharycarter> I wonder if the extension is even working at all |
11:29:11 | FromGitter | <zacharycarter> syntax highlighting? |
11:29:26 | Yardanico | admin0day: do you have nim in your PATH? |
11:29:50 | Yardanico | if you don't - extension will not be able to do error checking or autocompletion/go to definition |
11:29:56 | FromGitter | <admin0day> yes just lighting up |
11:31:52 | FromGitter | <admin0day> just return message when i ran nim -v |
11:32:15 | FromGitter | <admin0day> it seem the path is working |
11:32:41 | FromGitter | <zacharycarter> unless your cwd is nim/bin :P |
11:34:22 | * | vlad1777d quit (Ping timeout: 268 seconds) |
11:34:53 | FromGitter | <admin0day> i am also install the nim under win10's ubuntu |
11:35:44 | FromGitter | <admin0day> the problem still exist |
11:38:46 | * | athenot joined #nim |
11:39:29 | FromGitter | <zacharycarter> maybe it's related to - https://github.com/pragmagic/vscode-nim/issues/58 ? I don't know |
11:39:35 | FromGitter | <zacharycarter> I gotta get ready for work, be back later |
11:41:53 | * | SenasOzys quit (Ping timeout: 248 seconds) |
11:42:44 | FromGitter | <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:55 | FromGitter | <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:13 | FromGitter | <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:21 | FromGitter | <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:07 | FromGitter | <Yardanico> @admin0day if you install nim under win10's ubuntu you wouldn't be able to use it in VSCode |
12:17:33 | FromGitter | <Yardanico> about your ./koch tools - it's very strange, maybe you can just use choosenim? |
12:17:41 | FromGitter | <Yardanico> remove your existing nim installation and install nim using choosenim |
12:18:58 | dom96 | yay for suggesting choosenim :) |
12:25:05 | * | gokr left #nim (#nim) |
12:36:59 | * | Trustable joined #nim |
12:37:24 | FromGitter | <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:58 | FromGitter | <narimiran> nay for suggesting choosenim on windows - only 32bit version available ;) |
12:42:14 | FromGitter | <zetashift> @narimiran fwiw I haven't encountered any problems with the 32bit choosenim so far |
12:46:46 | FromGitter | <narimiran> @zetashift i had some monstrosity of code :D |
12:47:55 | FromGitter | <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:28 | FromGitter | <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:28 | FromGitter | <mratsim> have to add* |
12:48:42 | FromGitter | <mratsim> a*a is always faster |
12:49:05 | FromGitter | <mratsim> but a proper compiler will transform a^2 into a*a anyway |
12:49:28 | FromGitter | <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:23 | FromGitter | <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:28 | FromGitter | <mratsim> want* |
12:50:40 | FromGitter | <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:32 | FromGitter | <phrmoy> Good morning Nim heros! |
13:11:26 | FromGitter | <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:03 | FromGitter | <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:26 | FromGitter | <zacharycarter> gitlab kubernetes integration is pretty nice - and the auto devops thing is even nicer |
13:49:08 | FromGitter | <alehander42> interesting |
13:49:18 | FromGitter | <alehander42> "If there is a Dockerfile, it will use docker build to create a Docker image." |
13:49:32 | FromGitter | <zacharycarter> yeah - and if you have kube integration set up |
13:49:33 | FromGitter | <alehander42> where is this container registry ? |
13:49:37 | FromGitter | <zacharycarter> it will deploy straight to your kube cluster |
13:49:49 | FromGitter | <alehander42> is that for instances only ? |
13:49:54 | FromGitter | <alehander42> (or also for gitlab.com ? ) |
13:50:13 | FromGitter | <zacharycarter> I think any gitlab repo can upload containers to the container registry |
13:50:31 | FromGitter | <zacharycarter> so every repo comes with container registry support I guess is what I'm trying to say |
13:50:34 | FromGitter | <alehander42> hm, but is the gitlab.com container registry public |
13:50:56 | FromGitter | <zacharycarter> I don't think so |
13:51:03 | FromGitter | <zacharycarter> you have to auth with gitlab to access it |
13:51:37 | FromGitter | <zacharycarter> https://gitlab.com/help/user/project/container_registry |
13:51:41 | FromGitter | <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:23 | FromGitter | <zacharycarter> maybe try out auto devops :D |
13:55:42 | FromGitter | <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:58 | FromGitter | <zetashift> echo() works fine |
13:57:06 | FromGitter | <zetashift> Nvm I'm dumb |
14:05:02 | FromGitter | <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:15 | FromGitter | <zetashift> Write a small blogposts about your adventure so people know it too >< |
14:06:43 | FromGitter | <Vindaar> already planned :) |
14:09:25 | FromGitter | <zacharycarter> > Nvm I'm dumb ⏎ ⏎ My response to basically every question I ask in here |
14:16:25 | * | PMunch joined #nim |
14:16:42 | PMunch | fowlmouth, you on anywhere? |
14:17:17 | * | r3d9u11 joined #nim |
14:17:50 | r3d9u11 | hello |
14:18:57 | r3d9u11 | Is there casting to sequence for openarray (without manually looping)? |
14:20:03 | FromGitter | <zetashift> @r3d9u11 : try feeding it to toSeq() ? |
14:20:09 | FromGitter | <zetashift> it's in sequtils |
14:20:55 | r3d9u11 | yes, it's not for openarray :( |
14:23:50 | r3d9u11 | maybe. I have exception: 'invalid type: 'openarray[int]' in this context: 'seq[openarray[int]]'' |
14:24:54 | FromGitter | <zacharycarter> PMunch: fowl hasn't been around for a whileeeeee |
14:25:14 | FromGitter | <zacharycarter> openarray isn't a concrete type |
14:25:18 | FromGitter | <zacharycarter> so that's not going to work I don't think |
14:25:26 | FromGitter | <zacharycarter> it can only be used as a parameter |
14:25:45 | PMunch | zacharycarter, ah that's a shame.. |
14:26:04 | FromGitter | <zacharycarter> what's your question? I've worked with quite a few of his repos |
14:26:13 | PMunch | Just got linked to his glossolalia library and wanted to ask about it |
14:26:31 | PMunch | This thing: https://github.com/fowlmouth/glossolalia |
14:28:27 | * | PMunch quit (Quit: Leaving) |
14:30:52 | FromGitter | <zacharycarter> ah yeah - that one I haven't worked with |
14:30:56 | FromGitter | <zacharycarter> but it does look interesting :) |
14:45:51 | FromGitter | <andreaferretti> can anyone recall which are the available GC options? |
14:46:08 | FromGitter | <andreaferretti> markAndSweep, bohem, go, v2? |
14:46:44 | FromGitter | <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:07 | FromGitter | <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:26 | Araq | what do you mean? |
15:06:37 | Araq | the GC needs shared lists for --threads:on |
15:11:09 | * | endragor quit (Ping timeout: 264 seconds) |
15:18:49 | FromGitter | <andreaferretti> well, I mean that I had a program using shared lists, hence it had `import slist` on top |
15:19:17 | FromGitter | <andreaferretti> suddenly when using `--gc:v2`, I got an error message that `SharedList` was ambiguous |
15:19:40 | FromGitter | <andreaferretti> it could be either `system.SharedList` or `slist.SharedList` |
15:20:40 | FromGitter | <andreaferretti> I assume `system` is only reexporting `slist`, right? |
15:23:17 | * | nsf joined #nim |
15:25:08 | Araq | that'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:51 | FromGitter | <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:34 | Araq | well they shouldn't corrupt memory in debug mode |
16:23:05 | Araq | but 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:10 | FromGitter | <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:36 | FromGitter | <mratsim> stack == none = regions so a bit confusing |
16:48:58 | * | btbytes joined #nim |
16:50:48 | Araq | nim --advanced |
16:50:58 | Araq | --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:40 | Sargun | How do I wait for a message across multiple channels? |
17:14:26 | * | kinkinkijkin quit (Read error: Connection reset by peer) |
17:23:31 | miran | https://forum.nim-lang.org/t/3701/2 |
17:23:45 | miran | can you guys open this link, or do you see 404? |
17:24:29 | * | kinkinkijkin joined #nim |
17:26:20 | dom96 | miran: fixed |
17:26:26 | dom96 | Sargun: I don't think that's implemented |
17:26:39 | miran | dom96: now that was fast! |
17:27:01 | Sargun | dom96: so you have to wait across multiple flowvars? |
17:30:40 | * | btbytes quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:34:23 | dom96 | Sargun: I think so. |
17:34:25 | * | btbytes joined #nim |
17:34:32 | * | btbytes quit (Client Quit) |
17:35:58 | * | btbytes joined #nim |
17:35:59 | dom96 | hrm, you can use awaitAny it seems |
17:36:17 | dom96 | https://nim-lang.org/docs/threadpool.html#awaitAny,openArray[FlowVarBase] |
17:36:28 | dom96 | Well I'm confused, you asked about channels and then mentioned flowvars |
17:36:42 | FromGitter | <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:29 | dom96 | https://github.com/nim-lang/Nim/issues/3850 |
17:37:41 | * | Snircle joined #nim |
17:46:21 | FromGitter | <abijahm> @dom96 procedures give the same error |
17:47:27 | * | SenasOzys quit (Ping timeout: 240 seconds) |
17:51:37 | kinkinkijkin | is there a way to use a switch statement to check all of the first parts of tuples in a seq of tuples? |
17:51:39 | kinkinkijkin | like |
17:52:37 | kinkinkijkin | case myVar: of matching name in myTupleSeq.name |
17:52:40 | kinkinkijkin | or something like that |
17:52:47 | dom96 | abijahm: can you paste what code you have for that? |
17:53:11 | dom96 | kinkinkijkin: Sounds like you want pattern matching? |
17:53:20 | kinkinkijkin | yeah I guess |
17:53:46 | kinkinkijkin | idk for sure |
17:53:50 | miran | kinkinkijkin: what are you doing after you check that? |
17:54:17 | kinkinkijkin | using the second variable in the matched tuple to set a variable |
17:54:43 | miran | any simple (pseudo) code example? |
17:55:04 | kinkinkijkin | the way I was doing it before was with a for loop |
17:56:07 | kinkinkijkin | for pair in mytupleseq: if input == pair.name: somevar = pair.token |
17:58:11 | kinkinkijkin | the way I'd want to do it with cases is probably something like |
17:58:57 | kinkinkijkin | case 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:17 | miran | i would do it like your first example with for loop. but somebody more experienced might give you some beter idea.... |
18:01:43 | kinkinkijkin | the idea is that with cases it could be much faster, because then I don't have to iterate |
18:01:57 | kinkinkijkin | depending on the implementation of something so ridiculous |
18:01:58 | FromGitter | <alehander42> hm the julia guys have some weird integration of their gitter activity panel which shows the newest stack overflow questions |
18:02:08 | FromGitter | <alehander42> I didnt know gitter has this |
18:03:04 | miran | kinkinkijkin: well, if you need to find one tuple that matches inside of seqOfTuples, iteration will happen, one way or another |
18:03:42 | kinkinkijkin | I guess |
18:03:48 | miran | what 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:11 | FromGitter | <abijahm> @dom96 ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abd2a9be3d0b1ff2c7fc450] |
18:05:53 | FromGitter | <dom96> @abijahm ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abd2b01bb1018b37a3ba988] |
18:06:15 | kinkinkijkin | I'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:04 | kinkinkijkin | I 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:54 | FromGitter | <abijahm> @dom96 thanks |
18:11:07 | * | Trustable joined #nim |
18:11:19 | * | kinkinkijkin_ joined #nim |
18:11:29 | kinkinkijkin_ | okay apparently that last part I said is false |
18:11:39 | kinkinkijkin_ | 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:38 | FromGitter | <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:55 | dom96 | Without your code I can't help... |
18:19:20 | vivus | Does anybody use gitlab pages? |
18:20:51 | FromGitter | <abijahm> sorry didnt realise the when |
18:24:47 | FromGitter | <abijahm> whats the difference between when and if |
18:25:07 | kinkinkijkin | when is evalued at compile time |
18:25:14 | * | PMunch joined #nim |
18:33:35 | kinkinkijkin | porting 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:54 | kinkinkijkin | instead of evaluating their length at their run time |
18:35:14 | kinkinkijkin | I 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:23 | FromGitter | <abijahm> thanks |
19:04:17 | * | btbytes joined #nim |
19:07:16 | FromGitter | <krux02> I wonder why libffi doesn't work out to be the way to call C functions from the nim compiler. |
19:07:32 | FromGitter | <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:24 | FromGitter | <genotrance> @krux02: why would you need that when nim can importc so easily? |
19:45:23 | kinkinkijkin | are you able to "case true: of bool1: sth of bool2: sth" ? |
19:45:56 | Yardanico | genotrance: maybe FFI at compile-time? |
19:46:08 | Yardanico | kinkinkijkin, yes |
19:46:28 | Yardanico | but maybe it's better to use "if true: bool1 else: bool2" |
19:47:08 | kinkinkijkin | I mean like equivalent to |
19:47:18 | kinkinkijkin | if bool1: elif bool2: |
19:48:09 | FromGitter | <genotrance> is it possible to figure out the signature of a proc in a macro? |
19:50:03 | FromGitter | <krux02> @genotrace: the problem is you cannot call C functions at compile time at all at the moment. |
19:50:08 | FromGitter | <krux02> And acutally it is a hard problem in C |
19:50:26 | FromGitter | <krux02> but the hard part has been done already as libffi. |
19:51:20 | FromGitter | <genotrance> makes sense |
19:55:42 | FromGitter | <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:15 | PMunch | Hmm, I wonder if I can get Vim to highlight doc-comments as RST.. |
20:11:20 | FromGitter | <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:50 | FromGitter | <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:20 | Araq | wu-lee. yeah. don't use 'var ref MyObject' |
20:24:18 | Yardanico | @wu-lee and for gerenal info - it's better to call that "compilation" and not "transpilation" :) |
20:25:20 | FromGitter | <wu-lee> @araq, @Yardanico, thanks, ok |
20:25:40 | * | find0x90 joined #nim |
20:26:45 | FromGitter | <wu-lee> I'm not explicitly var-reffing, but seems I'm calling a proc accepting a var, supplying a ref |
20:27:22 | FromGitter | <wu-lee> Which I had thought Nim would implicitly do the right thing for... |
20:30:36 | Araq | well it's a bug, report it if you want to. but it's caused by wrong code |
20:30:46 | Araq | when it fixed the compiler will reject your program. |
20:32:58 | * | yglukhov quit (Remote host closed the connection) |
20:34:15 | FromGitter | <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:55 | Araq | '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:49 | FromGitter | <genotrance> are nim tests failing right now? |
21:06:26 | * | xet7 joined #nim |
21:07:20 | FromGitter | <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:03 | Araq | the CIs are silent |
21:16:43 | FromGitter | <genotrance> tried testament on my local machine |
21:17:06 | FromGitter | <genotrance> i'm up to date and it fails for cat vm which I was planning on adding some tests to |
21:17:22 | Araq | which OS? |
21:17:27 | FromGitter | <genotrance> Win10 |
21:17:30 | FromGitter | <genotrance> 32-bit |
21:17:43 | FromGitter | <genotrance> am trying on my ubuntu box to compare |
21:17:48 | Araq | hmm that may be it, appveyor is 64bit |
21:20:13 | FromGitter | <genotrance> yep - works fine on my linux box |
21:28:31 | * | nsf quit (Quit: WeeChat 2.0.1) |
21:28:40 | FromGitter | <genotrance> @Araq should I submit issues for test failures on 32-bit Windows? |
21:30:13 | Araq | hmm sure |
21:30:59 | Araq | but we also need appveyor for 32bit |
21:31:21 | Araq | not sure how to pull that off though. |
21:34:38 | * | jrbrt joined #nim |
21:34:43 | FromGitter | <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:14 | Araq | we have it in our appveyor.yml |
21:35:18 | Araq | but it's commented out |
21:38:20 | Sargun | Can you pass a channel over a spawn? |
21:40:33 | Araq | if you use a 'ptr' to it |
21:42:21 | Sargun | https://gist.github.com/sargun/dc3e01db5320a6119768a2d663e7e69c |
21:42:44 | Sargun | unfortunately, that throws a type mistmatch |
21:43:01 | Sargun | in the recv |
21:43:39 | Araq | recv(chan[]) |
21:43:41 | Sargun | in the recv |
21:43:42 | Sargun | err |
21:43:55 | Sargun | is that requivalent to x[].recv() |
21:45:03 | Araq | yes |
21:46:47 | FromGitter | <krux02> Araq: I saw you made a libffi wrapper for Nim |
21:47:48 | FromGitter | <krux02> I wonder if it should be used as the default way to call into C libraries from Nim compiler. |
21:50:54 | Araq | I've told this story a couple of times now. |
21:51:21 | Araq | compiler/evalffi.nim works. the VM can use libffi to call into native code. |
21:51:51 | Araq | or at least it used to work. at one point I got an SDL renderer work at compile-time |
21:52:15 | Araq | but it opens a can of worms |
21:52:45 | Araq | and we have enough "fails when you look at it closely" problems in Nim already. |
21:54:04 | Sargun | Araq: if It's a ref, how do I construct it? https://gist.github.com/sargun/298db9e8aa32a3d5f3cb49c4b2a56c17 |
21:55:55 | Araq | 1. with 'new'. please read a tutorial. |
21:56:15 | Araq | 2. since you want to pass the channel across thread boundaries, use 'ptr', not 'ref'. |
21:56:54 | Araq | and spawn allows parameter passing anyway, you don't need a channel. |
21:58:24 | * | natrys quit (Quit: natrys) |
22:03:54 | Sargun | Araq: ref seems to work |
22:03:54 | * | btbytes quit (Read error: Connection reset by peer) |
22:05:00 | PMunch | Hmm, this is strange |
22:05:02 | PMunch | http://ix.io/14fD/ |
22:05:16 | PMunch | That fails with a SIGSEGV |
22:05:32 | PMunch | http://ix.io/14fF/ |
22:05:49 | Sargun | refs are copied right -- but channels can be copied safely, I thought |
22:09:41 | * | gokr quit (Ping timeout: 276 seconds) |
22:09:51 | FromGitter | <krux02> hmm I wonder how I can utilize this libffi from macros |
22:12:56 | PMunch | Interestingly it's only the second line that fails, the first one works fine.. |
22:13:01 | * | Vladar quit (Quit: Leaving) |
22:14:41 | dom96 | ooh yay, a compiler segfault |
22:14:45 | PMunch | And splitting it up over two lines so one initializes the object with "option: 1" and the next sets the value works fine |
22:15:00 | PMunch | Yeah, seems like a compiler bug |
22:16:46 | kinkinkijkin | what's the constructor for a set? I want to create a set of a single char |
22:17:02 | kinkinkijkin | because one of the strutils procs requires a set |
22:17:10 | kinkinkijkin | but I need to use it with a single char |
22:19:26 | Araq | {'a'} |
22:19:31 | kinkinkijkin | thanks |
22:22:51 | * | find0x90 joined #nim |
22:22:51 | FromGitter | <genotrance> does testament run multiple threads or in sequence? |
22:25:44 | * | gokr joined #nim |
22:25:51 | Sargun | Araq: Do you have a pointer to any tutorials that explain pointers in nim |
22:26:44 | Sargun | Araq: Around concurrency, locking rules, etc |
22:26:45 | * | endragor joined #nim |
22:26:49 | Sargun | and GC rules |
22:31:43 | * | endragor quit (Ping timeout: 260 seconds) |
22:32:12 | kinkinkijkin | okay, apparently you can't use .startsWith(Digits) |
22:32:17 | kinkinkijkin | that seems a little silly |
22:32:42 | PMunch | Sargun, this might help https://peterme.net/nim-types-originally-a-reddit-reply.html |
22:32:44 | kinkinkijkin | could just implement an iterator that checks each item in a set |
22:33:10 | PMunch | Not 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:51 | PMunch | kinkinkijkin, make a PR to strutils if you make one :) As you say it's a bit silly that it's not there |
22:34:31 | PMunch | Wait, couldn't you just do "someString[0] in Digits"? |
22:35:00 | PMunch | Check if the first character of a string is in the Digits character set |
22:35:39 | kinkinkijkin | the line I'm using this in is |
22:36:24 | kinkinkijkin | elif line.lin.startsWith('c') and lin.lin.strip(true, false, {'c'}).startsWith(Digits): |
22:36:32 | kinkinkijkin | I know it's messy |
22:36:41 | kinkinkijkin | line.lin* |
22:37:07 | * | user1101 quit (Quit: user1101) |
22:38:21 | PMunch | Yeah, so change it to this: |
22:38:39 | PMunch | elif line.lin.startsWith('c') and lin.lin.strip(true, false, {'c'})[0] in Digits: |
22:38:57 | kinkinkijkin | okay, I'll try that, thanks! |
22:39:06 | kinkinkijkin | would still be nice to have the convenience proc in strutils though |
22:39:24 | PMunch | Agreed, make a pull request for it :) |
22:39:37 | kinkinkijkin | unfortunately 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:47 | FromGitter | <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:53 | FromGitter | <zetashift> well played Nim, well played |
22:56:56 | Araq | maybe read the tutorials before programming in Nim. |
22:57:10 | Araq | they are not that long iirc. |
22:57:11 | kinkinkijkin | yeah, and also do it while doing so at first |
22:58:32 | FromGitter | <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:00 | Araq | alright, sorry :-) |
22:59:25 | FromGitter | <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:28 | kinkinkijkin | I haven't heard much good about go but it's not a big surprise that nim does it smaller |
23:00:45 | kinkinkijkin | a big design point of nim seems to be code compression |
23:00:57 | FromGitter | <zetashift> What I like about Nim's conciseness* sorry it's late here I should go to sleep |
23:01:25 | kinkinkijkin | sleep well, then |
23:01:28 | kinkinkijkin | if you do |
23:01:49 | FromGitter | <zetashift> With this newfound sexy code I'll probably be up for a bit more |
23:02:18 | dom96 | I feel like this doesn't deserve the 'oui' package name https://github.com/dom96/oui |
23:02:40 | kinkinkijkin | I apparently have a problem with not expanding my code needlessly |
23:03:22 | kinkinkijkin | I 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:44 | kinkinkijkin | my nim looks a lot like c# in terms of sheer size |
23:05:23 | FromGitter | <zetashift> That's...a good quality? |
23:05:40 | kinkinkijkin | no |
23:05:55 | kinkinkijkin | I'm writing compiler tools for pseudodemoscene |
23:06:28 | FromGitter | <genotrance> @araq: how come getCurrentDir() is in nimscript.nim and scriptconfig.nim but doesn't work in a nims file? |
23:07:06 | kinkinkijkin | generally demosceners like their tools running at double realtime or faster on their "modern" (xp-era) pcs and not going to swap |
23:07:19 | kinkinkijkin | but 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:42 | FromGitter | <zetashift> Is demoscene referring to the groups in the Amiga times? |
23:11:20 | dom96 | genotrance: It seems it's in nimscript.nim because `withDir` uses it |
23:12:28 | kinkinkijkin | zetashift yes, demoscene still exists |
23:12:43 | kinkinkijkin | it's less of demogroups and more of individuals making pieces of demos now |
23:13:22 | kinkinkijkin | mostly demomusic |
23:14:01 | dom96 | kinkinkijkin: You heading to revision? |
23:14:34 | kinkinkijkin | nop |
23:14:37 | kinkinkijkin | I'm in canada |
23:18:03 | kinkinkijkin | I 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:36 | dom96 | I see |
23:18:47 | dom96 | I've never personally been to a demoparty, but I'd love to go |
23:18:57 | kinkinkijkin | yeah they seem fun |
23:19:50 | FromGitter | <genotrance> @dom96, @Araq - so getCurrentDir() and setCurrentDir() are not exported - I always get thrown off by the missing * |
23:21:23 | kinkinkijkin | so 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:33 | dom96 | * means public |
23:21:55 | kinkinkijkin | I see |
23:22:08 | kinkinkijkin | it goes at the end of the proc name? |
23:23:46 | FromGitter | <genotrance> so are we okay adding pwd() = getCurrentDir(), cpDir() = copyDir(), mvDir() = moveDir() to nimscript? |
23:24:16 | Sargun | Is there a way to ask Nim to generate more readable C? |
23:27:18 | FromGitter | <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:04 | Araq | ugh |
23:33:13 | Araq | it uses different names because these are different |
23:33:33 | Araq | they support the Whatif option etc |
23:35:58 | FromGitter | <genotrance> okay cool |
23:36:58 | FromGitter | <genotrance> https://github.com/nim-lang/Nim/issues/7393 |
23:39:22 | Araq | are you shashlick? |
23:39:50 | FromGitter | <genotrance> yep |
23:40:29 | FromGitter | <genotrance> Matrix/Riot has been unreliable off late so switched to gitter |
23:41:27 | FromGitter | <genotrance> I submitted a PR for the vmops changes - https://github.com/nim-lang/Nim/pull/7440 |
23:42:58 | Araq | cool :-) |
23:49:33 | FromGitter | <kinkinkijkin> wondering whether the fromgitter shows my git username or my git name |
23:49:42 | kinkinkijkin | git username |
23:50:00 | * | kinkinkijkin left #nim ("Leaving") |
23:50:00 | FromGitter | <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) |