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