00:05:27 | FromGitter | <Obround> <rayman22201> -- I'm writing a compiler that transpiles to Nim. For that I need to disable a few Nim built-ins. |
00:09:02 | rayman22201 | Why not catch the offending procs on your end (when you are parsing the source language)? |
00:11:37 | FromGitter | <kayabaNerve> That exception should be in a static block |
00:12:00 | rayman22201 | no. I tested it, works just fine. |
00:12:22 | FromGitter | <kayabaNerve> *possibly* |
00:12:29 | FromGitter | <Obround> <rayman22201> -- Because I don't want to have a few reserved procs that do nothin |
00:13:37 | rayman22201 | having a few extra reserved words seems much easier than trying to modify the target language... I'm just sayin... |
00:14:08 | rayman22201 | That being said, as long as you control all the resulting nim code, you can use the methods above. Just be aware that you can't affect other nim code that you don't control. (I.E. other Nim library code) |
00:18:18 | FromGitter | <kayabaNerve> rayman22201: Not to function at all. To function properly. |
00:18:28 | FromGitter | <kayabaNerve> You can detect this at compile time. No need to do it at runtime. |
00:20:15 | rayman22201 | you can't throw exceptions at compile time |
00:21:11 | rayman22201 | or at least I can't: `/home/ray/.choosenim/toolchains/nim-#head/lib/system.nim(3421, 9) Error: cannot evaluate at compile time: e176018` |
00:21:21 | rayman22201 | That is what happens when I put the exception in a static block |
00:25:12 | rayman22201 | you could do this to make it error at compile time, which is cool: |
00:25:15 | rayman22201 | `template echo(args: untyped) {.error: "no echo allowed" .} = discard` |
00:26:26 | rayman22201 | @kayabaNerve, it's a good point anyway. This is a thing that can be caught at compile time. |
00:37:32 | * | cornfeedhobo quit (Ping timeout: 245 seconds) |
00:50:26 | FromGitter | <kayabaNerve> Oh, sorry. I forgot about that. |
00:50:44 | * | NimBot joined #nim |
01:04:16 | * | cornfeedhobo joined #nim |
01:05:04 | * | seni quit (Quit: Leaving) |
01:31:41 | FromGitter | <ratiotile> Is there a way to make paths in nim.cfg relative to the project root, not the invocation dir? I'd like to avoid absolute paths, as that messes up the repo. I notice that my include path changes depending on where my working directory is |
01:32:49 | FromGitter | <kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d27e341c3740260bb079489] |
01:33:27 | FromGitter | <kayabaNerve> My nims in under tests/. That uses a nimcache under build/. thisDir() returns the Nimscript file's folder. |
01:39:57 | FromGitter | <ratiotile> thanks |
01:46:28 | FromGitter | <metasyn> I'm seeing some interesting behavior between seq and array, that I've never noticed before. Is anyone familiar with why this might happen? I'm sending two UDP packets, but when I send it as an array, the data comes as I would expect - a sequence however, seems to mangle the datagram contents: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ When I am listening on tcpdump: [https://gi |
01:46:29 | FromGitter | ... tter.im/nim-lang/Nim?at=5d27e6747dbfff3242911041] |
01:51:24 | FromGitter | <metasyn> If anyone has a clue, I'm super curious, this one for some reason took me a long time to figure out what was causing it, until eventually, I was trying to make a minimal repro, and then ran into this. |
01:53:33 | FromGitter | <metasyn> To the best of my knowledge, I cannot use an array here since the array size is dynamic and unknown at compile time |
01:58:54 | * | theelous3 quit (Ping timeout: 272 seconds) |
02:04:13 | * | cornfeedhobo quit (Ping timeout: 245 seconds) |
02:18:47 | FromGitter | <ratiotile> ugh, vs2017 detection is broken again |
02:20:36 | FromGitter | <ratiotile> I had fixed this before... https://github.com/nim-lang/Nim/pull/9672/commits/7b92086df919d4d1d0b1b5495cd18713d7a26394 |
02:20:46 | FromGitter | <ratiotile> someone took out VS150COMNTOOLS |
02:28:42 | * | cornfeedhobo joined #nim |
02:45:36 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
02:46:08 | * | laaron joined #nim |
02:47:53 | leorize[m] | @metasyn that's not how you send a seq |
02:48:24 | leorize[m] | if you want the data pointer, do `seqData[0].addr` |
02:49:57 | * | akito joined #nim |
02:50:20 | * | akito is now known as Guest36097 |
02:50:34 | leorize[m] | a seq internally is an object with capacity, length and a data pointer |
02:50:47 | leorize[m] | so using addr directly on the seq gets you the object address instead |
02:51:18 | FromGitter | <metasyn> @<leorize[m]> Thanks! That was totally it. and completely fixes this issue. I see. So I need the address of the first item in the sequence, since, I'm already providing the length information to the sendTo proc and the capacity is more or less irrelevant |
02:52:54 | leorize[m] | that asides, someone really need to add a high level interface for sending sequences of byte |
02:53:46 | leorize[m] | we have one for string already |
02:55:16 | FromGitter | <metasyn> I see - cool. Thanks for helping me out :) |
02:57:34 | FromGitter | <ratiotile> turns out VS2017 works in devel, just not on 0.20 |
02:57:37 | * | Guest36097 quit (Remote host closed the connection) |
03:07:50 | * | fjellfras joined #nim |
03:22:33 | * | lritter quit (Ping timeout: 245 seconds) |
03:33:23 | * | leorize quit (Quit: WeeChat 2.3) |
03:35:39 | * | leorize joined #nim |
03:51:26 | FromGitter | <zacharycarter> Here's the issue re: hotcode reloading from last night - https://github.com/nim-lang/Nim/issues/11718 |
03:57:29 | * | leorize quit (Quit: WeeChat 2.3) |
04:01:52 | FromGitter | <zacharycarter> shashlick - if I don't plan on reading from loaded plugins on any thread but the main thread - I don't need the shared stuff right? |
04:02:51 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
04:03:26 | FromGitter | <zacharycarter> I mean the shared seqs / strings you're working on |
04:12:26 | rayman22201 | I hate to say it, but I'm afraid we are going to end up with an annoying ecosystem split between HCR and shashlicks system. Similar to Status's async vs. the stdlib asyc.... |
04:15:13 | shashlick | yes, but since the monitoring thread and main thread communicate about plugins to load when they change, it is still needed |
04:15:18 | shashlick | i'm still dealing with some bugs in shared |
04:16:01 | FromGitter | <zacharycarter> hmm okay |
04:16:09 | FromGitter | <zacharycarter> well - if HCR doesn't work for anything beyond simple toy examples |
04:16:19 | FromGitter | <zacharycarter> I feel like HCR will fall into that unmaintained experimental feature state |
04:16:21 | shashlick | well, i'll eventually adapt the HCR stuff once it becomes more stable |
04:16:58 | shashlick | but it also needs the ability to not reload, but i think i read it can be turned off as well, not sure |
04:17:35 | shashlick | one caveat is that HCR is invisible to the user, which means no DLLs show up |
04:17:43 | shashlick | plus you need nim to keep it working |
04:17:55 | shashlick | since the dlls are loaded from nimcache |
04:18:24 | shashlick | anyway, my understanding is quite limited to the docs which i perused once |
04:21:39 | rayman22201 | It's a chicken and egg problem. HCR needs more users to find the bugs. We need guinnie pigs lol |
04:23:25 | shashlick | i'm also spreading myself too thin |
04:23:38 | rayman22201 | @shashlick: you make good points. I'm don't know much more either. |
04:23:50 | shashlick | i don't have the kind of time to keep up with any of this |
04:24:06 | rayman22201 | Also fair. I totally understand |
04:27:41 | FromGitter | <zacharycarter> well regarding HCR - a guy was hired to implemented it - he implemented it and explained that it was basically a toy because of useNimRtl being untested - and useNimRtl has been around since I started using Nim |
04:28:00 | FromGitter | <zacharycarter> so I am not optimistic that it will ever become fully baked |
04:28:39 | FromGitter | <zacharycarter> shashlick: I threw together some of the files from fued using 0.20 and without your shared library, and here's what I got - ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d280c774d750532412e717b] |
04:28:59 | FromGitter | <zacharycarter> I do have a dll now though :) |
04:30:05 | rayman22201 | It's unfortunate. The guy was hired to basically made a prototype, and then he bailed... but it needs more ongoing support. ☹️ |
04:30:21 | FromGitter | <zacharycarter> well he did make a prototype |
04:30:37 | FromGitter | <zacharycarter> but prototype doesn't always mean it's going to work beyond small simple implementations |
04:30:49 | FromGitter | <zacharycarter> he even states that in the grant proposal issue |
04:31:00 | FromGitter | <zacharycarter> it definitely needs someone who understands how it works - because lord knows I don't |
04:31:19 | shashlick | ya don't use 0.20.0, it won't work |
04:31:31 | FromGitter | <zacharycarter> okay - I'll try with 0.19.6 - I remember you mentioning that last night |
04:31:33 | shashlick | use 0.19.6 and boehm and it will be fine |
04:31:56 | shashlick | upgrading to 0.20.0 is what took me down this shared rabbit hole |
04:32:00 | shashlick | i've been in there for a month now |
04:32:14 | FromGitter | <zacharycarter> :P |
04:32:36 | FromGitter | <zacharycarter> well - writing code that is synchronized is not easy |
04:32:41 | FromGitter | <zacharycarter> so props to you for doing it |
04:39:42 | FromGitter | <zacharycarter> well - I'm still crashing - but it's because I can't find where `ctx.plugins` gets initialized |
04:42:04 | shashlick | well it is a table so shouldn't need to be initialized |
04:42:08 | shashlick | there's initPlugins() |
04:42:17 | FromGitter | <zacharycarter> tables have to be initialized I'm pretty sure |
04:42:28 | FromGitter | <zacharycarter> there's the method - `initTable` |
04:43:24 | FromGitter | <zacharycarter> heyyyy |
04:43:24 | FromGitter | <zacharycarter> it works |
04:43:32 | FromGitter | <zacharycarter> well - it does a thing anyway - when I init the table |
04:43:51 | FromGitter | <zacharycarter> may want to add the line - `ctx.plugins = initTablestring, Plugin ()` - to `initPlugins` |
04:44:01 | FromGitter | <zacharycarter> unless in 0.20 you don't need to init tables any longer or something |
04:45:08 | shashlick | ya 0.20 doesn't need it anymore |
04:47:57 | * | nsf joined #nim |
04:48:59 | shashlick | actually, i'm using feud right now and it is built with 0.20.0 |
04:50:20 | shashlick | i think the 64-bit build is broken, not 32-bit somehow |
04:50:58 | shashlick | if i had a better memory, i'd remember why i've been working on this shared stuff |
04:58:36 | FromGitter | <Obround> I have a (definitely simple) question I couldn't find the answer to. Is there a resource where I can learn how to slice arrays? |
05:00:18 | FromGitter | <zacharycarter> :P |
05:00:24 | FromGitter | <zacharycarter> I'm going to try compiling with 0.20 |
05:01:06 | FromGitter | <zacharycarter> it works now with 0.20.0 too |
05:01:37 | FromGitter | <zacharycarter> cool - I gotta go to work but I'll play around more with it when I get home |
05:06:21 | * | narimiran joined #nim |
05:31:55 | * | absolutejam joined #nim |
05:31:57 | shashlick | cool beans |
05:43:32 | * | lf-araujo joined #nim |
05:54:34 | FromGitter | <zacharycarter> shashlick: I didn't look at your plugin code too closely - do you have a way to manage state? |
05:55:52 | FromGitter | <mratsim> Very nice read on parser optimization: https://bjou-lang.org/blog/7-10-2019-self-hosting-a-million-lines-per-second-parser/7-10-2019-self-hosting-a-million-lines-per-second-parser.html |
05:58:28 | shashlick | what do you mean by state |
06:02:51 | FromGitter | <zacharycarter> shashlick: like if a plugin has its own state - some way to preserve that between loading and unloading of the shared library |
06:04:26 | FromGitter | <zacharycarter> nim HCR achieves this with before/afterCodeReload hooks |
06:10:29 | * | lf-araujo quit (Remote host closed the connection) |
06:19:44 | FromGitter | <zacharycarter> honestly - luajit is looking more and more appealing, especially since stuff like - https://github.com/jangko/nimLUA - already exists |
06:20:33 | FromGitter | <Varriount> @mratsim That's a really nice article! |
06:31:20 | FromGitter | <zacharycarter> bJou looks interesting |
06:33:20 | FromGitter | <mratsim> luajit is not maintained anymore is it? Like it will forever lag behind Lua |
06:36:16 | FromGitter | <zacharycarter> I think certain forks are - but I know like raptorJit doesn't support Windows |
06:36:30 | FromGitter | <zacharycarter> does it really matter if it lags behind lua? |
06:36:38 | FromGitter | <zacharycarter> also - I wonder how difficult it would be to add HCR to - https://github.com/arnetheduck/nlvm |
06:37:58 | * | absolutejam quit (Ping timeout: 245 seconds) |
06:39:04 | FromGitter | <mratsim> The issue is the fragmented Lua community |
06:39:10 | FromGitter | <mratsim> just like Python 2 vs Python 3 |
06:39:17 | FromGitter | <mratsim> or Perl (was it 5) |
06:43:13 | FromGitter | <zacharycarter> I think a lot of game engines are already using luajit - so I could just use the last stable version and probably never have to worry about updating it |
06:48:51 | * | jjido joined #nim |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:01:38 | * | leorize joined #nim |
07:04:45 | * | gmpreussner joined #nim |
07:05:03 | * | PMunch joined #nim |
07:13:53 | FromGitter | <zacharycarter> or maybe I could use terra and embed it in my Nim code |
07:14:24 | * | brakmic joined #nim |
07:14:25 | * | Senketsu quit (Quit: WeeChat 2.5) |
07:19:29 | * | ikan-keli_ quit (Ping timeout: 248 seconds) |
07:19:57 | * | absolutejam joined #nim |
07:20:38 | * | ikan-keli_ joined #nim |
07:25:18 | * | Senketsu joined #nim |
07:37:00 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:39:04 | * | actuallybatman quit (Ping timeout: 246 seconds) |
07:39:50 | FromGitter | <mratsim> Terra is also somewhat unmaintained I think. |
07:40:16 | FromGitter | <mratsim> The author is now working at Facebook and is maintaining their Arraymancer-like library |
07:44:27 | FromDiscord_ | <Stuffe> Noob question; what does this error mean? Error: type mismatch: got <seq[morpheme_result]> but expected 'seq[morpheme_result]' |
07:44:53 | FromDiscord_ | <Stuffe> I have a proc that returns seq[morpheme_result], (morpheme_result is a tuple) |
07:45:04 | FromGitter | <zacharycarter> ah |
07:45:17 | FromGitter | <zacharycarter> well - it seems like the options for supporting any sort of scripting are limited |
07:45:20 | FromDiscord_ | <Stuffe> And I call the proc and store the result to a variable that I initialed with the same type seq[morpheme_result] |
07:45:27 | FromGitter | <zacharycarter> and hcr is unstable |
07:45:28 | FromGitter | <mratsim> it means a bug, :p |
07:45:39 | FromGitter | <zacharycarter> so - if anyone has any recommendations on this - I'm open to them |
07:45:54 | FromGitter | <mratsim> Are you using, generics, statics, typedesc, templates or macros? it seems weird with pure procs |
07:45:55 | FromDiscord_ | <Stuffe> mratsim, I will make a quick poc then |
07:45:59 | FromGitter | <zacharycarter> my goals are basically to achieve some type of iteration improvement over having to re-compile my program every time I change things |
07:46:20 | FromGitter | <mratsim> why is HCR unusable? |
07:46:59 | FromGitter | <zacharycarter> it's not that it's unusable - but please see this issue I made this morning: https://github.com/nim-lang/Nim/issues/11718 |
07:47:06 | FromGitter | <zacharycarter> it seems unreliable |
07:50:49 | * | stefanos82 joined #nim |
07:50:54 | * | Vladar joined #nim |
07:52:17 | FromGitter | <mratsim> it's only 3 months old |
07:53:34 | Zevv | zacharycarter: what time zone are you in? |
07:55:20 | FromGitter | <zacharycarter> EEST |
07:56:09 | FromGitter | <zacharycarter> @mratsim - understandable, but the fact that it needs work still doesn't help me today |
07:56:14 | Zevv | statistically, you don't sleep very much :) |
07:56:31 | FromGitter | <mratsim> yeah of course |
07:56:41 | FromGitter | <zacharycarter> I'm not trying to complain - I'm just looking for a solution to my need |
07:56:45 | FromGitter | <zacharycarter> Zevv: this is true |
07:57:08 | FromGitter | <mratsim> well, Lua or Terra are working, it's just the future that is more obscure, if you need somethign right now use those |
07:59:25 | FromGitter | <zacharycarter> yeah - I think I'll give luajit a go when I get home |
07:59:34 | FromGitter | <zacharycarter> I remember terra having some very funky things going on with types |
08:00:44 | * | jjido joined #nim |
08:08:07 | * | absolutejam quit (Ping timeout: 246 seconds) |
08:13:00 | * | solitudesf joined #nim |
08:17:13 | * | solitudesf quit (Ping timeout: 246 seconds) |
08:18:19 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:19:04 | FromGitter | <zacharycarter> https://github.com/jangko/razcal/blob/master/razcal.nim - looks like a nice starting point |
08:19:34 | * | floppydh joined #nim |
08:26:11 | Araq | https://www.twitch.tv/araq4k it's streaming time (apparently...) |
08:27:45 | PMunch | What's the topic for the stream Araq? |
08:28:52 | Araq | finishing "araq-better-run" |
08:28:56 | livcd | narimiran: you sound like you are angry :D |
08:29:37 | livcd | definitely better ..brigthened my day |
08:29:51 | narimiran | :P |
08:34:11 | * | jjido joined #nim |
08:34:16 | livcd | Besser Ceee :D |
08:35:04 | narimiran | nimBetterRun, or short: nimBeeR |
08:35:16 | livcd | I am wondering did you try to get some EU funding for Nim ? Or you did / dont want to do that ? |
08:35:50 | * | jjido quit (Client Quit) |
08:37:07 | livcd | I dont know more but VLC received some EU money |
08:38:16 | livcd | I never heard Araq crying this is a first :D |
08:46:22 | * | shomodj joined #nim |
08:50:30 | narimiran | PMunch: did you report your VM problems? |
08:50:37 | narimiran | ...from yesterday |
08:50:43 | livcd | call him chipmunk :) |
08:51:10 | livcd | but chipmunks are cute... |
09:03:03 | narimiran | "echo L.bufpos; L.bufpos = 0; echo L.bufpos -- They both echo the same thing." |
09:03:46 | narimiran | !eval import parsesql; static: (var p: SqlParser; echo p.bufpos) |
09:03:49 | NimBot | Compile failed: Error: unhandled exception: intVal is not accessible [FieldError] |
09:04:29 | * | lf-araujo joined #nim |
09:11:59 | * | jjido joined #nim |
09:12:27 | * | dwdv joined #nim |
09:13:04 | * | Senketsu quit (Quit: WeeChat 2.5) |
09:21:02 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:26:14 | * | brakmic_ joined #nim |
09:27:18 | * | brakmic quit (Ping timeout: 272 seconds) |
09:31:45 | PMunch | narimiran, nope |
09:32:07 | narimiran | PMunch: it's ok, we found it and we're working on it currently |
09:32:08 | * | brakmic_ quit () |
09:32:20 | PMunch | Nice |
09:32:33 | * | brakmic joined #nim |
09:32:38 | PMunch | What was the issue |
09:33:37 | * | abm joined #nim |
09:33:55 | Araq | parseqsl uses inheritance twice :P |
09:34:20 | PMunch | Yeah I thought that could be what caused it :P |
09:35:49 | narimiran | PMunch: now to more important question - how is your nick pronounced, the english way or the german way? |
09:36:34 | livcd | narimiran: i think it's "german way" |
09:36:45 | livcd | he pronounced it like that in his talk about Nim metaprogramming |
09:38:28 | livcd | narimiran: https://www.youtube.com/watch?v=JMkEJ__2Meg&feature=youtu.be&t=20 |
09:39:12 | narimiran | sounds like P.Munck :) |
09:39:32 | narimiran | (and that is the silent/german way) |
09:49:24 | * | shomodj joined #nim |
09:50:08 | * | shomodj quit (Client Quit) |
09:50:55 | * | shomodj joined #nim |
09:51:38 | * | shomodj_ joined #nim |
09:55:39 | * | shomodj quit (Ping timeout: 268 seconds) |
10:01:41 | FromGitter | <zacharycarter> I wonder - has anyone ever tried to embed mono in a Nim application? |
10:05:33 | FromGitter | <zacharycarter> https://yizhang82.dev/hosting-coreclr - would be an interesting experiment to try out with Nim |
10:07:50 | * | lf-araujo quit (Ping timeout: 272 seconds) |
10:11:56 | * | couven92 joined #nim |
10:13:06 | FromGitter | <zacharycarter> actually - forking the compiler and using - https://github.com/Serenitor/embeddedNimScript - might be a good option fo rme |
10:13:09 | FromGitter | <zacharycarter> for* me |
10:13:29 | FromGitter | <zacharycarter> only reason to fork the compiler is because of this - https://github.com/Serenitor/embeddedNimScript#areas-of-improvement |
10:18:04 | narimiran | still streaming at https://www.twitch.tv/araq4k for those of you who missed the earlier announcement |
10:30:14 | * | solitudesf joined #nim |
10:31:24 | * | alexander92 joined #nim |
10:32:17 | * | fjellfras quit (Quit: Leaving) |
10:37:05 | PMunch | livcd, narimiran, well it's complicated.. |
10:37:49 | PMunch | We have stacks of correspondence with the national news channels on how to pronounce our family name |
10:38:08 | PMunch | The way I pronounced it in that talk is not the same way I pronounce it in Norwegian |
10:40:16 | FromGitter | <zacharycarter> would there be any way to add vmhooks without having to fork the compiler? |
10:41:49 | PMunch | https://digitaltmuseum.no/011085440396/en-hilsen-fra-edvard-munch <- about 0:11 he says it the way we say it |
10:46:04 | PMunch | By the way, ran into a new compiler error: http://ix.io/1Of6 |
10:48:22 | Zevv | is this a bug: http://paste.ubuntu.com/p/T8xkBfbT3X/ |
10:49:09 | Zevv | Tables mgetOrPut is modifyable but modififactions to the table value are lost |
10:51:02 | leorize[m] | looks like a bug to me |
10:51:35 | Zevv | well no, shoot. It's not a ref |
10:52:17 | Zevv | hmm, so basically it makes no sens to do mget/mgetOrPut to a non-ref key type |
10:53:26 | leorize[m] | ? |
10:55:04 | Zevv | s/non ref key type/non ref value type/ |
10:56:44 | leorize[m] | no? |
10:57:18 | leorize[m] | it should be possible. mget returns a hidden reference to the value |
10:57:22 | leorize[m] | so it should work |
10:58:00 | Zevv | oh it does? |
11:04:33 | Zevv | I get a copy now it seems |
11:07:47 | Zevv | docs do not lie, it is modifyable :) |
11:07:54 | * | laaron quit (Remote host closed the connection) |
11:10:12 | * | laaron joined #nim |
11:11:53 | FromDiscord_ | <demotomohiro> Zevv:You can modify like this way: |
11:11:55 | FromDiscord_ | <demotomohiro> https://wandbox.org/permlink/0J15tZWvcrar6sw9 |
11:13:42 | Zevv | yeah, that makes sense - but it might still not be expected behaviour |
11:13:44 | FromDiscord_ | <demotomohiro> ``mGetOrPut`` returns l-value, and your code is copying returned l-value to var u. |
11:13:49 | Zevv | sure |
11:14:11 | * | brakmic quit (Read error: Connection reset by peer) |
11:14:26 | * | brakmic joined #nim |
11:14:55 | * | brakmic quit (Client Quit) |
11:15:16 | * | brakmic joined #nim |
11:19:48 | FromDiscord_ | <kodkuce> is new runtime still heppening? |
11:19:55 | Araq | yup |
11:22:00 | alexander92 | Araq, have you seen any langs with alias-like annotations |
11:22:27 | Araq | 'restrict' in Ansi C? |
11:22:37 | alexander92 | yeah but mor egeneral |
11:22:57 | alexander92 | one idea i found before, which i thought might work for a toy lang was |
11:23:28 | alexander92 | to somehow parametrize them, e.g. you have |
11:24:08 | FromGitter | <ahcm> hmm Error: ambiguous call; both io.open ... memfiles.open, so how do you disambiguate? |
11:24:53 | Araq | system.open vs memfiles.open |
11:25:04 | FromGitter | <ahcm> ah, system, not io |
11:25:06 | FromGitter | <ahcm> thx |
11:25:22 | alexander92 | change(arg: Text, other: Text not on arg) (equivalent to e.g. if #<a> is an um unique path to the expr: change[First, Second: First != Second](arg: Text#First, other: Text#Second) -> Text#First) |
11:25:33 | alexander92 | change(arg: Text, other: Text on arg) -> Text on arg etc |
11:25:58 | alexander92 | somehow overloading/specifying when certain things alias with each other or dont and specialize code based on that |
11:25:59 | FromGitter | <zacharycarter> Reading through - https://github.com/Serenitor/embeddedNimScript#areas-of-improvement - does anyone know what is being referred to by `get type from VmArgs`? I don't see anything like that in ast.nim |
11:26:21 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:27:28 | * | nsf quit (Quit: WeeChat 2.4) |
11:31:11 | * | lf-araujo joined #nim |
11:33:25 | FromDiscord_ | <kodkuce> nice |
11:38:33 | * | lf-araujo quit (Ping timeout: 250 seconds) |
11:39:11 | PMunch | ahcm, you can also prevent the import of memfiles.open if you only use the system version |
11:40:31 | * | absolutejam joined #nim |
11:45:43 | lqdev[m] | so nimscript can be embedded? I'd refrain from doing that since pulling in the whole compiler seems like a pretty big dependency |
11:47:53 | FromGitter | <zacharycarter> lqdev[m]: any suggestions for achieving a scripting system where I can reload scripts at runtime? |
11:48:38 | FromGitter | <zacharycarter> right now I think the most promising options are - 1) shashlick's plugin code 2) lua |
11:49:31 | * | jjido joined #nim |
11:50:55 | lqdev[m] | Lua is a pretty good option |
11:51:27 | lqdev[m] | dunno about feud's plugin system |
11:51:50 | FromGitter | <zacharycarter> yeah - lua + moonscript might be a good option too |
11:51:56 | PMunch | Hmm, if you import the compiler and only run NimScript stuff, will deadCodeElim be able to trip away all the stuff you don't use? |
11:52:32 | lqdev[m] | just keep in mind the high-level nimLUA wrapper is broken on latest stable, and you'll have to fix it. |
11:53:16 | lqdev[m] | PMunch: but doesn't NimScript use the whole Nim parser and whatnot? seems like a really big dep. |
11:53:40 | PMunch | Well yeah the parser is obviously in there.. |
11:53:49 | PMunch | I wonder how big it would be though |
11:54:16 | FromGitter | <zacharycarter> I don't mind updating the nimLua wrapper |
11:54:33 | FromGitter | <zacharycarter> probably will be easier than figuring out how to make other options work |
11:54:39 | FromGitter | <zacharycarter> famous last words |
11:55:23 | lqdev[m] | that's partially why I started working on rod, I needed a scriping language for Nim with a small footprint. but, I haven't worked on it for ages since I burnt myself out with constant changes I was making to the language |
11:55:45 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:55:54 | FromGitter | <zacharycarter> heh - maybe it's time to actually start reading crafting interpreters :P |
11:56:17 | lqdev[m] | ha, except crafting interpreters isn't finished so you're on your own with a lot of stuff |
11:57:02 | lqdev[m] | but it's getting there |
11:57:35 | FromGitter | <zacharycarter> yeah - maybe by the time I finish reading it and implementing what I learn in the available chapters it will be :P |
11:58:42 | lqdev[m] | rn I want to achieve something simple (variables, flow control, procs, structs) without super-fancy stuff |
12:01:45 | FromGitter | <zacharycarter> that'd be nice |
12:03:49 | * | Snircle joined #nim |
12:05:41 | * | absolutejam quit (Ping timeout: 258 seconds) |
12:07:23 | Araq | well I do know about VmArgs but I don't see the problem |
12:07:51 | Araq | you need to do a MyType -> PNode, PNode -> MyType translation, sure |
12:08:04 | Araq | but you have to do this translation with Lua or Python too |
12:08:39 | Araq | also, this works with 0.18 and we're at 0.20 and the API did become more useful in the meantime |
12:08:54 | Araq | see tcompilerapi for an example of how to use it. |
12:09:12 | Araq | I also used it in my 'NimEdit' project as the scripting environment |
12:10:07 | Araq | but even if you're unhappy with nimscript, copying the VM from compiler/ and throwing away the stuff you don't need is one day of work. writing a VM from scatch takes months. |
12:22:49 | * | shomodj joined #nim |
12:26:00 | * | absolutejam joined #nim |
12:26:04 | * | shomodj_ quit (Ping timeout: 246 seconds) |
12:26:29 | FromGitter | <mratsim> This is nice: https://repology.org/project/nim/badges, https://repology.org/project/nim/versions |
12:29:10 | * | jjido joined #nim |
12:29:28 | FromGitter | <arnetheduck> I've often wondered what a small, script-focused c or rust implemenation of nim would entail / how big it would be.. the more we can outsource to the std lib, the better |
12:30:40 | shashlick | @zacharycarter sorry was asleep - you have plugin local data which can come and go with dll reload |
12:31:07 | shashlick | There's also data stored in ctx if you want it preserved thru reload |
12:31:17 | shashlick | See pluginapi.nim |
12:31:34 | shashlick | Also see the plugins - how it is done |
12:32:14 | FromGitter | <mratsim> @arnetheduck it would look like csources? :P |
12:32:39 | shashlick | Every plugin dll is a first class citizen so it has full access to everything thru ctx |
12:33:29 | narimiran | is there a way to pass a cstring to a proc that takes openArray? (other than `$myCstring`) |
12:33:33 | FromGitter | <mratsim> I think that's one of Araq's goal, like reimplementing the ^1 operator with BackwardsIndex instead of a compiler magic |
12:33:45 | shashlick | https://github.com/genotrance/feud/blob/master/src/pluginapi.nim#L84 |
12:33:52 | FromGitter | <mratsim> @narimiran, no, because cstring don't have a size |
12:34:15 | FromGitter | <mratsim> and scanning the cstring to get a size, and then rescanning it in the proc would be extremely inefficient. |
12:34:16 | FromGitter | <arnetheduck> except the generated c code is horrible :) nim is a compiler, remember, not a transpiler. very important and convenient distinction. |
12:34:50 | narimiran | @mratsim i will need its `len` either way. so `$` is my best course of action? |
12:35:10 | FromGitter | <mratsim> http://composition.al/blog/2017/07/30/what-do-people-mean-when-they-say-transpiler/ |
12:35:57 | FromGitter | <mratsim> if you don't care about perf for it's use, use $ |
12:36:22 | narimiran | and if i do care? :) |
12:36:42 | FromGitter | <mratsim> if you do some operation in a loop on the cstring, and that is perf critical, you should get the length later ideally, just apply the algorithm and stop when you get \0 |
12:36:52 | FromGitter | <mratsim> and save that. |
12:37:27 | FromGitter | <arnetheduck> I solved it by calling it a translator: https://github.com/arnetheduck/j2c :) |
12:37:31 | FromGitter | <mratsim> also it depends if it's something that you will always use in the future or if it's just a proof of concept |
12:38:26 | FromGitter | <mratsim> And if you like parsing cstring, this article is my highlight of the day ;) https://bjou-lang.org/blog/7-10-2019-self-hosting-a-million-lines-per-second-parser/7-10-2019-self-hosting-a-million-lines-per-second-parser.html |
12:39:14 | narimiran | thanks for the link, will read it later :) |
12:40:39 | FromGitter | <mratsim> but to be honest, I didn't yet focus on string performance and parsing. Later for natural language processing, like in 6 months :p |
12:41:36 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:53:06 | * | tiorock joined #nim |
12:53:06 | * | tiorock quit (Changing host) |
12:53:06 | * | tiorock joined #nim |
12:53:06 | * | rockcavera is now known as Guest80661 |
12:53:07 | * | Guest80661 quit (Killed (tolkien.freenode.net (Nickname regained by services))) |
12:53:07 | * | tiorock is now known as rockcavera |
12:58:46 | * | fredrik92 joined #nim |
13:00:15 | * | MasterdonY quit (Ping timeout: 245 seconds) |
13:02:08 | * | couven92 quit (Ping timeout: 245 seconds) |
13:02:58 | * | masterdonx joined #nim |
13:03:44 | * | absolutejam quit (Ping timeout: 268 seconds) |
13:08:12 | * | dddddd joined #nim |
13:29:01 | * | Cadey quit (Quit: oops) |
13:29:21 | FromGitter | <zacharycarter> thanks shashlick |
13:29:57 | FromGitter | <zacharycarter> and Araq |
13:30:00 | * | Xe joined #nim |
13:30:58 | * | natrys joined #nim |
13:42:57 | * | solitudesf quit (Ping timeout: 245 seconds) |
13:44:13 | alexander92 | arnetheduck, what do you mean by scripted-focused |
13:44:15 | alexander92 | and by small? |
13:44:33 | alexander92 | like , an implementation of a subset of nim? |
13:45:58 | alexander92 | as an embeddable vm? i have to agree, if its just nim, nimscript's compiler dep shouldnt be such a big dep, after if you dont depend on parser/etc, you just have to write them on your own anyway |
13:50:38 | * | Senketsu joined #nim |
13:50:55 | FromGitter | <arnetheduck> a mini-implementation, yes, akin to lua or sqlite - something that's easily embeddable.. |
13:54:42 | * | blackbeard420 joined #nim |
13:56:52 | * | fredrik92 quit (Quit: Client disconnecting) |
13:59:40 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:02:36 | * | sealmove joined #nim |
14:08:18 | * | Xe is now known as Cadey |
14:08:59 | * | shomodj joined #nim |
14:10:01 | disruptek | i'd love to hear how and where you think you can do better than lua, but i'll have to take my answer off the air. ;-) |
14:14:20 | Araq | you can replace 'while'/'break' etc by 'goto' in Lua and then you'll have a smaller Lua |
14:14:51 | Araq | and then you can slowly transform Lua into a Forth |
14:15:29 | FromGitter | <arnetheduck> to start with, we get `!=` instead of `~=`, that's a win already :) |
14:15:52 | Araq | I patched my Lua to use '&' instead of '..' back then |
14:16:26 | FromGitter | <arnetheduck> lua is small enough that you can actually do that :) |
14:16:26 | Araq | ;-) |
14:18:21 | Araq | back to the topic: create a Nim without the configuration subsystem (omg, please can we remove this...), that ignores the effect system pragmas, that only compiles to C++ and that uses --newruntime and --quirkyExceptions |
14:18:24 | FromGitter | <alehander42> i guess having a good jit should be important then? iirc luajit is still preferred in a lot of cases |
14:18:41 | FromGitter | <alehander42> and this is more work than the scripting lang itself probably |
14:18:52 | Araq | and then you would have a pretty nice, minimal Nim |
14:19:41 | Araq | extra points for removing the VM by simply creating helper .exe files via the C++ codegen |
14:19:57 | * | PMunch quit (Remote host closed the connection) |
14:20:47 | FromGitter | <alehander42> hm btw i wondered these days: hcr/repl is hard because native code |
14:21:10 | FromGitter | <alehander42> but its still probably going to be slower because of indirection even with dll-s |
14:21:31 | FromGitter | <alehander42> what if the repl/hrc just ran nim into something like a emulator |
14:21:51 | FromGitter | <alehander42> where you just interpret the native code anyway |
14:24:07 | Araq | good idea, there are x86 emulators around |
14:24:21 | shashlick | I had some questions about shared mem and threads |
14:25:03 | shashlick | When you use createThread and pass an arg, I've seen typically use ptr object |
14:25:45 | shashlick | Is that object expected to have been allocated using allocShared? |
14:26:02 | shashlick | Or a regular object ptr okay? |
14:26:14 | Araq | well it's shared |
14:26:31 | Araq | that means either allocShared or addr of a global or thread local |
14:28:58 | disruptek | nim->llvm->graalvm, then you get access to the jvm and anything that can target it. |
14:29:14 | shashlick | I've used a thread local object and it's worked fine so far but wondering what best practices are |
14:29:41 | shashlick | So what is the intent of =deepCopy |
14:30:26 | shashlick | What would you really do in it if you were to override it |
14:30:31 | Araq | it's called for parameter passing to a different thread. more or less |
14:31:41 | * | MarderIII joined #nim |
14:33:33 | FromGitter | <mratsim> btw, I was looking into Nim threadpool to see which primitives can be reused, and the cache line size is wrong :/ https://github.com/nim-lang/Nim/blob/master/lib/pure/concurrency/threadpool.nim#L46, all X86 are 64 bytes, and most ARM are 64 bytes as well (with some 32, or apparently 128 for Samsung designs) |
14:34:13 | shashlick | Araq: so i have been using thread local objects so that they can get destructed with my custom =destroy |
14:34:19 | disruptek | anyone here have a 4k display? |
14:34:25 | shashlick | i noticed you cannot have a =destroy for a ref type |
14:36:46 | FromGitter | <mratsim> you have finalizers |
14:36:50 | shashlick | okay, so another question - if I share a thread local object across threads, is the GC careful to destruct it only after it goes out of scope out of the last thread using it? |
14:37:04 | FromGitter | <mratsim> the GC is not multithreaded |
14:37:30 | shashlick | yes, that's why i'm doing this whole shared project so that I can get strings and seqs safely across threads |
14:37:59 | shashlick | but i am using regular objects since only those have =destroy where i can do the shared mem maintenance |
14:38:05 | FromGitter | <mratsim> you need to hold a reference to it one way or another, possibly using GC_ref() |
14:38:05 | shashlick | what's a finalizer |
14:38:18 | FromGitter | <mratsim> new myRef, myfinalizer |
14:39:00 | FromGitter | <mratsim> example: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/backend/opencl_backend.nim#L42-L44 |
14:39:18 | FromGitter | <mratsim> and it's associated to the instance here: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/backend/opencl_backend.nim#L51 |
14:39:21 | FromGitter | <mratsim> in the new proc |
14:39:35 | FromGitter | <mratsim> so the GC automatically calls it when the ref reaches the end of its lifetime |
14:40:10 | shashlick | oh nice, i didn't know that |
14:40:42 | shashlick | so right now, my code works fine since i create the object in main thread, send it to child thread and i can share just fine |
14:41:13 | shashlick | but when the object goes out of scope in the child, =destroy doesn't get called, so it all works fine since the parent calls join and then =destroy gets called |
14:41:44 | shashlick | i'm just wondering if i do the opposite, will it still work - is the GC aware that the object is still in use in the parent even if it was created in the child |
14:42:16 | * | Senketsu quit (Quit: WeeChat 2.5) |
14:43:51 | FromGitter | <mratsim> you need to GC_ref() from the child |
14:44:33 | shashlick | but then you need to manually GC_unref() somewhere in the parent |
14:44:55 | shashlick | effectively, i'm trying to give a stdlib experience with shared objs |
14:45:57 | shashlick | anyway, i think part of the deal is that the child wouldn't even be able to share it with the parent after the fact - you'd have to have some shared obj which points to it that was initially shared via createThread |
14:46:10 | FromGitter | <mratsim> TBH, that seems very difficult without a GC designed for multithreading from the ground up. And multithreaded GC are very difficult |
14:46:24 | shashlick | can you take a look at my shared implementation? |
14:46:47 | shashlick | actually, let me push these changes first then it will be great if you can see what i'm doing |
14:47:27 | shashlick | i'm basically using thread local objects that point to shared memory which i maintain |
14:47:34 | FromGitter | <mratsim> Also make sure to watch this video: https://youtu.be/zULU6Hhp42w?t=1776 |
14:48:02 | FromGitter | <mratsim> if you don't have time just the next 2 minutes from the time I linked, otherwise the whole thing. |
14:48:49 | FromGitter | <mratsim> I.e. if you want mutability, you will need to manage contention and it's very easy to have bad perf or worse deadlocks |
14:49:40 | FromGitter | <mratsim> Looking into https://github.com/genotrance/shared |
14:50:02 | shashlick | well, performance is not the goal right now, so there's a lot of copying and a single global lock |
14:50:38 | shashlick | that can be considered later |
14:55:04 | * | jjido joined #nim |
14:55:50 | * | jjido quit (Client Quit) |
14:58:08 | FromGitter | <mratsim> so to append a new element to a sharedSeq, you copy to a seq in the main thread, append there, and copy back to a shared seq? |
14:58:32 | shashlick | yep, it's super inefficient, but good for a first version |
15:00:44 | * | floppydh quit (Quit: WeeChat 2.5) |
15:03:28 | * | Senketsu joined #nim |
15:05:09 | * | MarderIII quit (Quit: Leaving) |
15:08:59 | shashlick | so right now, i was wondering whether i should create a duplicate copy of the thread local object in =deepCopy but pointing to the same shared memory inside |
15:09:26 | shashlick | but =deepCopy works on refs or ptrs only, so I cannot create a thread local object in =deepCopy since it goes out of scope right there |
15:09:45 | * | Senketsu quit (Quit: WeeChat 2.5) |
15:11:06 | * | Senketsu joined #nim |
15:17:08 | FromGitter | <arnetheduck> unless it's a queue, it's rare that a collection is the right granularity for shared data.. java learned this the hard way when they (practically) deprecated Vector and the other locked collections.. it's mostly about correctness, even though efficiency plays part of it as well |
15:18:49 | FromGitter | <zacharycarter> I'm attempting to compile NimEdit's nimscriptsupport.nim, and I'm running into - `Error: unhandled exception: assignment to discriminant changes object branch; compile with -d:nimOldCaseObjects for a transition period [FieldError]`. Does the compiler currently get compiled with that flag? |
15:20:08 | shashlick | you might be better off using c2nim's or nimble's instead |
15:21:45 | leorize[m] | @zacharycarter: yea |
15:21:57 | FromGitter | <zacharycarter> gotcha - thanks! |
15:22:17 | leorize[m] | Araq said the language development outpaced the compiler's |
15:22:44 | shashlick | @zacharycarter - gave up on feud plugin? let me know if you need any help with it |
15:22:54 | shashlick | i recently removed the compiler from nimble |
15:23:11 | FromGitter | <zacharycarter> I didn't give up - but I'd prefer a scripting system over a plugin system if I can achieve such a thing |
15:23:48 | shashlick | see what i did in nimble - i just run `nim e` and it works fine |
15:23:48 | * | sealmove quit (Quit: WeeChat 2.5) |
15:24:04 | shashlick | of course, it runs in a separate memory space so not quite as powerful |
15:25:17 | FromGitter | <ratiotile> why do {.importcpp.} variables need to be var, even if in c++ they are a const? The Nim compiler will allow assignment, which is then caught in the C++ compiler. |
15:26:25 | leorize | let requires a value |
15:26:28 | leorize | that's the only reason |
15:27:05 | leorize | I've never tried, but maybe you can make a template that {.emit.} the c code directly so it won't be a variable |
15:29:36 | FromGitter | <ratiotile> it seems I can importcpp into a temp var, then assign to an exported `let`. |
15:30:03 | leorize | it'll allocate memory for the let |
15:30:06 | leorize | so not optimal |
15:30:53 | FromGitter | <ratiotile> so shouldn't the language support importcpp into let directlly then? |
15:31:33 | leorize | nice to have, but not much of a priority when you think about it |
15:31:49 | leorize | and tbh giving them `let` is still not enough |
15:32:07 | leorize | `unsafeAddr` can take address of `let` variables, but constants don't have address |
15:32:40 | FromGitter | <ratiotile> the problem with const is that the compiler would have to read the imported cpp code |
15:33:29 | leorize | either you hardcode that to your wrapper, or you do the `var` thing |
15:33:33 | leorize | I'd recommend hard coding |
15:33:44 | leorize | `#define` usually never changes |
15:34:43 | FromGitter | <ratiotile> right and constexpr should never change either |
15:35:59 | leorize | also hard-coding let you do compile-time maths |
15:36:17 | FromGitter | <ratiotile> yeah sounds like something to add to c2nim |
15:36:32 | * | alexander92 quit (Ping timeout: 272 seconds) |
15:36:42 | leorize | doesn't c2nim already do that? |
15:37:05 | FromGitter | <ratiotile> no, it makes a var, which is what made me ask |
15:38:18 | leorize | are you using the --header switch? |
15:38:18 | leorize | oh, you're working with C++ interop, right? |
15:38:33 | FromGitter | <ratiotile> yeah does the --header not work with c++ headers? |
15:38:54 | leorize | you must use that switch for proper c++ interop actually |
15:39:03 | leorize | and a side-effect is that it won't convert const |
15:39:31 | FromGitter | <ratiotile> well, if the code is already there to convert const, it should be simple to fix |
15:39:46 | leorize | without --header you can't import C++ functions |
15:40:46 | FromGitter | <ratiotile> I mean to invoke that code on header variables that are assigned literal values |
15:41:02 | FromGitter | <ratiotile> since in C++ you can assign values directly in header files |
15:42:00 | * | Trustable joined #nim |
15:43:29 | * | actuallybatman joined #nim |
15:54:49 | * | nsf joined #nim |
15:59:22 | Araq | that would require the concept of a "const without value" |
15:59:30 | FromGitter | <mratsim> yeah I agree with @arnetheduck, probably queue and hashmaps are worth sharing but I don't think a vector is @shashlick |
15:59:36 | Araq | which would suck |
15:59:54 | Araq | though maybe not as much as not having it |
16:00:31 | Araq | skConst is used 41 times in the compiler, we would need to go through all 41 occurences to check for "hasValue" |
16:00:47 | Araq | in other words, PRs are welcome :P |
16:01:22 | FromGitter | <ratiotile> Yeah I'll work on it, after I get done with a couple of other C++ features |
16:01:45 | Araq | wow, thanks |
16:01:52 | FromGitter | <ratiotile> can someone review the 2 PRs I have open? |
16:02:06 | Araq | Monday is our review-day |
16:02:10 | FromGitter | <ratiotile> ok |
16:02:54 | FromGitter | <mratsim> cc @cooldome: https://forum.nim-lang.org/t/3762#23453 |
16:04:33 | shashlick | well, i'm not building for traditional high performance multi-thread use cases |
16:04:48 | FromGitter | <mratsim> what's your use case? |
16:05:09 | shashlick | most people use seqs all over the place and more cores = more threads |
16:05:37 | shashlick | making seq usable across threads is worthwhile instead of using channels and queues |
16:06:46 | shashlick | in my use case, i have a monitor thread that checks if code has changed and recompiles dlls |
16:06:51 | shashlick | it then notifies the main thread to reload |
16:07:05 | Araq | we should distinguish between 'shared' and 'locked' |
16:07:16 | Araq | or maybe 'transferable' and 'shared' |
16:07:35 | shashlick | so nothing complex but i have to invent some bogus protocol across channels to coordinate |
16:07:43 | Araq | shashlick wants to have transferable seqs (something with Java, C#, C++, etc give you out of the box) |
16:07:45 | * | lritter joined #nim |
16:08:00 | Araq | *which |
16:08:11 | shashlick | and sharedlist and sharedtable don't allow non GC'd values so they are very limited |
16:08:19 | Araq | Rust calls it 'sendable' iirc |
16:09:03 | shashlick | i'm not transferring Araq, i am sharing across threads and coordinating with locks, if that's good terminology |
16:09:34 | shashlick | so both threads can read and write, perhaps main thread owns but that's what i'm trying to figure out how to ensure the destructor/finalizer runs at the right time |
16:19:39 | * | ng0 joined #nim |
16:20:55 | shashlick | Araq - if I have ptr object and I derefernce with [], should overloaded `=` still be used? http://ix.io/1OgB |
16:32:54 | * | Senketsu quit (Quit: WeeChat 2.5) |
16:41:40 | FromGitter | <zacharycarter> I just finished updating - https://github.com/Serenitor/embeddedNimScript - to work with 0.20.0 |
16:42:52 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:49:40 | * | lf-araujo joined #nim |
16:59:53 | * | solitudesf joined #nim |
17:01:53 | * | theelous3 joined #nim |
17:02:49 | * | theelous3 quit (Read error: Connection reset by peer) |
17:07:32 | * | Senketsu joined #nim |
17:09:42 | * | lf-araujo quit (Quit: lf-araujo) |
17:09:55 | * | lf-araujo joined #nim |
17:17:05 | FromDiscord_ | <Sporgity> Hey, um when I run `finish.exe` it doesn't seem to install mingw and I tried to run a file and this shows an error |
17:17:05 | FromDiscord_ | <Sporgity> `Hint: used config file 'C:\nim-0.20.0\config\nim.cfg' [Conf] |
17:17:05 | FromDiscord_ | <Sporgity> Hint: system [Processing] |
17:17:05 | FromDiscord_ | <Sporgity> Hint: widestrs [Processing] |
17:17:05 | FromDiscord_ | <Sporgity> Hint: io [Processing] |
17:17:06 | FromDiscord_ | <Sporgity> Hint: test [Processing] |
17:17:07 | FromDiscord_ | <Sporgity> CC: stdlib_io.nim |
17:17:09 | FromDiscord_ | <Sporgity> Error: invocation of external compiler program failed. The system cannot find the file specified. |
17:17:14 | FromDiscord_ | <Sporgity> Additional info: "Requested command not found: \'gcc.exe -c -w -mno-ms-bitfields -IC:\\nim-0.20.0\\lib -IC:\\Users\\Rizwan\\Desktop\\Projects\\Nim! -o C:\\Users\\Rizwan\\nimcache\\test_d\\stdlib_io.nim.c.o C:\\Users\\Rizwan\\nimcache\\test_d\\stdlib_io.nim.c\'. OS error:" 2` |
17:18:01 | FromGitter | <zacharycarter> I think I had a similar issue - and just ended up installing mingw without finish.exe |
17:19:53 | FromDiscord_ | <Sporgity> so. where do I install mingw? I tried to download it from https://nim-lang.org/install_windows.html and for some reason it was corrupted |
17:20:51 | * | shomodj joined #nim |
17:22:10 | shashlick | Try again, it is good |
17:22:28 | FromGitter | <ratiotile> I am currently able to call inherited C++ functions by manually creating a proc importcpp in derived_class.nim that points to base_class.h. Is there a better way to get Nim to recognize functions inherited from the base class? |
17:22:30 | * | nsf quit (Quit: WeeChat 2.4) |
17:22:42 | FromGitter | <zacharycarter> https://nim-lang.org/download/mingw64-6.3.0.7z |
17:22:49 | FromGitter | <zacharycarter> assuming you're after a 64 bit version |
17:23:23 | FromGitter | <zacharycarter> what would be the best way to grab a specific directory from a git repository |
17:23:47 | FromDiscord_ | <Sporgity> wdym by that |
17:23:56 | FromDiscord_ | <Sporgity> the git repo one |
17:24:25 | FromGitter | <zacharycarter> I need a copy of Nim's stdlib but I don't want to clone all of Nim |
17:24:39 | FromGitter | <zacharycarter> I just want to grab the stdlib when someone installs my project |
17:25:23 | FromGitter | <zacharycarter> and I don't want to depend on subversion - I know it's possible with that |
17:25:42 | FromGitter | <kaushalmodi> @zacharycarter You can get the latest release from https://github.com/nim-lang/nightlies/releases |
17:25:46 | FromGitter | <kaushalmodi> and extract out the lib/ dir |
17:26:23 | FromGitter | <zacharycarter> that's not a bad idea - thanks @kaushalmodi |
17:26:34 | FromGitter | <kaushalmodi> that way you can get the tested libs |
17:26:57 | FromGitter | <kaushalmodi> if the devel update breaks any test, the nightlies release does not happen |
17:27:42 | shashlick | There's also sparse checkout but @kaushalmodi idea is better |
17:28:10 | FromGitter | <kaushalmodi> relevant: https://forum.nim-lang.org/t/4533#29113 |
17:28:45 | FromDiscord_ | <Sporgity> oh |
17:29:37 | FromGitter | <zacharycarter> now I just need to find a way to do this on windows :P I guess I could just mandate the user has wget |
17:30:24 | FromGitter | <kaushalmodi> curl is more widely available than wget (not sure about windows though) |
17:30:38 | FromGitter | <kaushalmodi> but for Linux/OSX compatibility, curl wins |
17:31:07 | FromGitter | <kaushalmodi> https://superuser.com/questions/299754/wget-curl-alternative-native-to-windows |
17:31:27 | FromGitter | <ratiotile> yeah nim needs a cross-platform download utility. Choosenim has the same problem with wget which doesn't work with Windows 7 |
17:33:57 | shashlick | That isn't a download issue, it is an extraction issue |
17:35:31 | shashlick | Just httpclient should be enough |
17:36:43 | FromGitter | <zacharycarter> I'll just assume people have powershell these days |
17:36:52 | FromGitter | <zacharycarter> you can download as well as unzip files with it |
17:38:34 | * | elrood joined #nim |
17:40:28 | shashlick | Powershell 2.0 is still around |
17:40:51 | shashlick | That's the issue @ratiotile found |
17:42:47 | FromGitter | <zacharycarter> well - until someone else needs to use my game engine I wont worry about it :P |
17:42:52 | FromGitter | <zacharycarter> and then I'll let them figure it out haha |
17:43:24 | * | actuallybatman quit (Ping timeout: 258 seconds) |
17:47:37 | FromDiscord_ | <Sporgity> brb |
17:52:24 | shashlick | @zacharycarter - https://github.com/nimterop/nimterop/blob/master/nimterop/git.nim#L60 |
17:52:57 | FromGitter | <zacharycarter> nice! thank you! |
17:53:26 | * | clyybber joined #nim |
17:53:48 | shashlick | This also didn't work for @ratiotile, that's what they were referring to |
17:53:58 | * | lf-araujo quit (Ping timeout: 272 seconds) |
18:04:46 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:05:05 | disruptek | what was the result of that dive into async stdin readline. i remember there being some confusion on whether it worked as expected. was that a pebkac or what? |
18:06:02 | * | lombak joined #nim |
18:07:28 | FromGitter | <Obround> Could somebody give me a reference where I can learn to slice arrays? I couldn't find any on the internet... |
18:08:19 | Araq | toOpenArray |
18:08:34 | FromGitter | <Obround> ? |
18:08:46 | Araq | how to slice things |
18:09:09 | FromGitter | <Obround> ok, so I convert an array to an open array? |
18:14:02 | * | lombak quit (Remote host closed the connection) |
18:14:48 | FromGitter | <kaushalmodi> @Obround use the HSlice `..` |
18:15:22 | FromGitter | <kaushalmodi> with an array var `foo`, `foo[1 .. 3]` (assuming these indices are valid for that array) |
18:18:17 | FromGitter | <Obround> @kaushalmodi -- Ok, thanks, I did that, but how do I get suppose the values of "two" and "three" in an array like this: ⏎ ⏎ ```let my_array: my_array_type = ["one", "two", "three"]``` [https://gitter.im/nim-lang/Nim?at=5d28cee9c3740260bb0e04c7] |
18:19:40 | narimiran | `myArray[1..2]`? |
18:20:00 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
18:20:50 | FromGitter | <Obround> <narimiran> Oops, I meant one and three; My mistake. |
18:22:40 | * | laaron joined #nim |
18:26:25 | FromGitter | <ratiotile> does anyone have an example of wrapping a C++ class w/inherited functions? |
18:26:37 | FromGitter | <eptification> has anyone tried teaching nim as a first language to people with no experience at all? |
18:27:36 | narimiran | @eptification i wrote a tutorial for that public, but i have no information if it is okay for that cause (https://narimiran.github.io/nim-basics/) |
18:28:04 | narimiran | most of the feedback i got is from people who are already experienced |
18:33:08 | FromGitter | <eptification> this is excellent. will report back. i dont *REALLY* know how to code. |
18:33:54 | narimiran | please do, feedback would be much appreciated |
18:34:23 | FromGitter | <eptification> i'll look it over the weekend along with nim in action. |
18:34:42 | disruptek | i've thought about teaching nim just so i can learn it. |
18:36:15 | FromGitter | <eptification> i got tired of doing javascript tutorials and i saw nim on orange website |
18:36:50 | FromDiscord_ | <Sporgity> I've seem to be getting this error for some reason, I installed mingw |
18:36:50 | FromDiscord_ | <Sporgity> `Error: execution of an external compiler program 'gcc.exe -c -w -mno-ms-bitfields -IC:\nim-0.20.0\lib -IC:\Users\Rizwan\Desktop\Projects\Nim! -o C:\Users\Rizwan\nimcache\test_d\test.nim.c.o C:\Users\Rizwan\nimcache\test_d\test.nim.c' failed with exit code: 1 |
18:36:50 | FromDiscord_ | <Sporgity> |
18:36:52 | FromDiscord_ | <Sporgity> In file included from C:\Users\Rizwan\nimcache\test_d\test.nim.c:9:0: |
18:36:54 | FromDiscord_ | <Sporgity> C:\nim-0.20.0\lib/nimbase.h:493:13: error: size of array 'Nim_and_C_compiler_disagree_on_target_architecture' is negative |
18:36:57 | FromDiscord_ | <Sporgity> typedef int Nim_and_C_compiler_disagree_on_target_architecture[sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8 ? 1 : -1]; |
18:36:57 | FromDiscord_ | <Sporgity> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
18:36:58 | FromDiscord_ | <Sporgity> ` |
18:37:16 | narimiran | wrong version of mingw? 64-bit vs 32-bit |
18:38:52 | FromDiscord_ | <Sporgity> 64 bit wasn't working for me for some reason |
18:38:56 | * | abm quit (Ping timeout: 272 seconds) |
18:40:05 | FromGitter | <ratiotile> aha, I think the problem is the generics that c2nim generates out of C++ templates. The wrapper seems to work when I remove all the generic typenames. |
18:40:51 | FromDiscord_ | <Sporgity> ? |
18:43:07 | FromGitter | <ratiotile> @Sporgity, I'm referring to my previous problem |
18:43:17 | FromDiscord_ | <Sporgity> oh |
18:45:17 | Araq | Sporgity: Please use a nightly build and finish.exe to setup mingw |
18:46:34 | FromDiscord_ | <Sporgity> Okay. |
19:03:39 | * | alexander92 joined #nim |
19:10:32 | FromDiscord_ | <Sporgity> It always seem to fail https://cdn.discordapp.com/attachments/587622975298207754/599316511940935737/unknown.png |
19:14:40 | * | zacharycarter_ir joined #nim |
19:14:51 | zacharycarter_ir | I'm here |
19:18:00 | Araq | zacharycarter_ir, ok, what's the problem again? |
19:18:32 | zacharycarter_ir | I'm trying to add a custom `getFoo` to vmhooks - here's what I tried: https://gist.github.com/zacharycarter/d91ce643d6b047f8ec802379cf171ebe |
19:19:14 | Araq | terrible :-) |
19:19:25 | Araq | you can't 'cast' it |
19:19:32 | zacharycarter_ir | haha - well I figured as much |
19:19:43 | zacharycarter_ir | it being terrible I mean |
19:19:52 | zacharycarter_ir | do I have to create a new NimNode or something? |
19:20:07 | Araq | in the compiler it's called PNode, but yes |
19:20:30 | zacharycarter_ir | so would I do this using a macro or something? |
19:20:35 | zacharycarter_ir | or a template? |
19:21:21 | Araq | before you can automate it, you need to understand it |
19:21:36 | Araq | the PNode needs to be an nkObjConstr |
19:23:15 | Araq | assert that it's a rkNode |
19:23:40 | Araq | and the slots[i].node then should have an nkObjConstr, you can use |
19:23:54 | Araq | astalgo.debug(slots[i].node) to see what it contains |
19:25:07 | zacharycarter_ir | ah okay awesome - thank you |
19:28:57 | zacharycarter_ir | since TRegisterKind isn't exported from vm.nim - do I just assert on the ordinal or something? |
19:30:10 | Araq | actually there is already |
19:30:18 | Araq | proc getNode*(a: VmArgs; i: Natural): PNode |
19:30:21 | Araq | that you should use |
19:30:29 | zacharycarter_ir | perfect |
19:30:31 | Araq | (it also asserts for you) |
19:32:56 | * | sschwarzer joined #nim |
19:35:42 | FromDiscord_ | <Sporgity> I've installed the nighty build and I got the same error about the gcc thing |
19:36:33 | * | abm joined #nim |
19:38:06 | sschwarzer | I noticed that the documentation links for the standard library don't point to the correct source files or at least the correct line numbers. |
19:38:33 | Araq | sschwarzer, bah, master vs devel problem? |
19:38:36 | Araq | narimiran, ? |
19:39:23 | sschwarzer | Araq: I was about to give an example :) , but yes, that's probably it. :) |
19:40:00 | Araq | zacharycarter_ir, there is also proc setResult*(a: VmArgs; n: PNode) |
19:40:22 | zacharycarter_ir | oh - that makes things much easier |
19:40:30 | sschwarzer | I also wasn't sure if the standard lib documentation is generated from devel or from the last release. |
19:40:42 | Araq | from the 020 branch |
19:40:44 | sschwarzer | last -> latest |
19:41:18 | * | stefanos82 quit (Quit: Quitting for now...) |
19:42:12 | rayman22201 | This is the devel docs, they are better: https://nim-lang.github.io/Nim/lib.html |
19:42:19 | sschwarzer | Araq: So it seems that's a well-known problem? I considered filing an issue on nim-lang's Github repository, but wanted to make sure it doesn't already have a ticket. I wasn't able to find one. |
19:43:01 | FromDiscord_ | <Sporgity> hello? |
19:43:19 | Araq | sschwarzer, I don't know and for some reason narimiran is away. |
19:43:37 | Araq | it's almost like his working day has ended already... strange |
19:44:09 | narimiran | :P |
19:44:12 | clyybber | Araq: This fails to compile on the cpp backend. It's really tricky to fix.. http://ix.io/1OhF |
19:44:12 | rayman22201 | @araq, @sschwarzer 0.20 had broken docs links that have since been fixed in devel. I don't think the fix has been backported / pushed to the main site yet. |
19:44:23 | narimiran | it's the problem with master docs which is already solved in devel |
19:44:40 | sschwarzer | rayman: yes, this seems to work better. But I think this should work for the official docs, too. :-) |
19:44:44 | narimiran | sschwarzer: until 0.20.2 is out, use https://nim-lang.github.io/Nim/lib.html for your documentation needs |
19:45:01 | Araq | clyybber, 'var ref' has no subtype relation |
19:45:13 | Araq | this shouldn't compile :-/ |
19:45:26 | clyybber | But I explicitly convert it |
19:45:34 | sschwarzer | rayman, narimiran: ok, so this will be fixed with the next release when `devel` becomes the next release tag? |
19:45:34 | narimiran | sschwarzer: the link i sent you is also official ;) |
19:45:52 | rayman22201 | anybody have any help for @Sporgity? |
19:45:53 | sschwarzer | narimiran: *lol* I see. :-D |
19:45:55 | Araq | clyybber, ah I missed that |
19:46:33 | dom96 | hello all, how's things? |
19:46:47 | * | absolutejam joined #nim |
19:47:02 | rayman22201 | the main site needs a "version picker" for the docs... That's the feature request to fixe @sschwarzers problem lol |
19:47:03 | sschwarzer | Hi dom96, I'm fine. Writing my first (ok, second) Nim program |
19:47:06 | clyybber | dom96: Hi, great, how bout you? |
19:47:24 | dom96 | sschwarzer, awesome. Welcome :) |
19:47:46 | sschwarzer | dom96: The first was a very simple calculation with two small procs, just to get a feeling. |
19:48:20 | rayman22201 | @sporgity, did you remove the old version of Nim before you installed nightly? |
19:48:45 | sschwarzer | dom96: And now I do some "glueing", calling external programs, reading, modifying and writing XML. |
19:48:52 | * | Senketsu quit (Quit: WeeChat 2.5) |
19:48:54 | FromDiscord_ | <Sporgity> oh hold on |
19:49:00 | FromDiscord_ | <Sporgity> I haven't |
19:49:00 | rayman22201 | my hunch is that your pc is still invoking the wrong version of mingw |
19:50:08 | * | actuallybatman joined #nim |
19:50:42 | sschwarzer | dom96: I'll also get your book; actually I have access to it via Safaribooks Online. But at some point I thought I should start programming instead of only reading. I read the tutorial and half of the manual so far. Very interesting, although the manual is a bit dry. |
19:51:11 | rayman22201 | I highly recommend Dom's book. <3 |
19:51:15 | dom96 | :D <3 |
19:51:57 | FromDiscord_ | <Sporgity> I removed the old version and it still shows the same error. |
19:52:17 | sschwarzer | rayman: I can imagine. I really want to read it. But I'm undecided if I should finish reading the manual and start with the book. Somehow I tend to finish the manual first. |
19:52:31 | dom96 | rayman22201, version picker is an "easy" jester web app away ;) |
19:53:02 | sschwarzer | Another thing: The software behind play.nim-lang.org is https://github.com/zacharycarter/nim-playground ? |
19:53:34 | rayman22201 | idk if it needs jester lol. I think old school javascript and a dropdown might be good enough... |
19:53:39 | sschwarzer | Or is this another Nim playground software? |
19:54:12 | dom96 | rayman22201, do you really want to add a JS snippet to each of our old docs? |
19:54:39 | dom96 | I guess it wouldn't be too hard, but a Jester solution would be cleaner :) |
19:55:31 | lqdev[m] | sschwarzer: afaik the new one is made by PMunch |
19:56:23 | Araq | ah damn, I mess up #11719 |
19:57:08 | sschwarzer | lqdev: The thing is that the compiler and program output don't escape HTML entities and I don't know where to file a bug. :) |
19:57:27 | Araq | ha, classic |
19:57:52 | sschwarzer | So for example, if you do `echo "<b>foo</b>"`, "foo" is displayed in bold. |
19:57:57 | FromDiscord_ | <Sporgity> I don't what I should do know |
19:58:08 | rayman22201 | @dom96, meh, it would also require more machinery on the server end, which is just a static jekyll site iirc... idk if @narimiran wants more complicated deployments :-P |
19:59:17 | sschwarzer | Also, for compiler error messages which involve a <Type>, the type isn't visible. ;-/ |
19:59:20 | lqdev[m] | sschwarzer: ah no, it's the one you linked. I just remember PMunch doing some work related to it |
19:59:39 | rayman22201 | @Sporgity. Start from a clean slate. Delete both versions of nim that you installed, and re-download and install. |
19:59:47 | lqdev[m] | but this one is 10 commits ahead https://github.com/PMunch/nim-playground |
20:00:08 | lqdev[m] | yeah, it's this one |
20:00:17 | dom96 | rayman22201, just need to deploy it once |
20:00:47 | dom96 | (unless you want to change the jester app) |
20:01:26 | Araq | ah no |
20:01:26 | FromDiscord_ | <Sporgity> alright |
20:01:34 | Araq | I didn't mess up, I got it right, good. |
20:01:46 | FromDiscord_ | <Sporgity> I'll be back later or tomorrow |
20:01:52 | rayman22201 | choosenim should work on windows these days, try this: https://github.com/dom96/choosenim |
20:02:03 | rayman22201 | @Sporgity |
20:03:14 | * | brakmic_ joined #nim |
20:03:22 | sschwarzer | Ok, entered ticket #4 |
20:03:26 | * | brakmic quit (Read error: Connection reset by peer) |
20:06:16 | sschwarzer | ( https://github.com/zacharycarter/nim-playground/issues/4 ) |
20:07:33 | * | brakmic_ quit (Ping timeout: 245 seconds) |
20:08:57 | * | ofelas joined #nim |
20:09:47 | sschwarzer | Araq: I got your exec proc to work with one or two small changes. I guess in the long run it would be good to let `waitForExit` also read stdout and stderr to avoid blocking? In that case I wouldn't have to have a custom execution proc. |
20:15:15 | Araq | makes sense |
20:15:59 | sschwarzer | Or even go further and introduce something like Python's `communicate`? https://docs.python.org/3/library/subprocess.html#subprocess.Popen.communicate |
20:16:32 | sschwarzer | Though I'm not sure that's needed. Having a fixed `waitForExit` would be good anyway. |
20:16:45 | Araq | PRs are welcome |
20:17:04 | sschwarzer | Araq: That's what I hoped to hear. :-) |
20:17:07 | Araq | I think I'm the only one who actually likes osproc's API |
20:17:35 | Araq | I mean, ok, I wrote it. But it's the only API that makes sense :P |
20:17:39 | sschwarzer | I saw there are lot PRs, some from last year, and was wondering if/when a PR from me would get in. |
20:18:40 | sschwarzer | Araq: I think the generic API based on `startProcess` is ok. On the other hand all the `*exec*` functions look a bit arbitrary and unsystematic. |
20:18:55 | * | alexander92 quit (Ping timeout: 246 seconds) |
20:19:14 | rayman22201 | why is this not good enough? https://nim-lang.github.io/Nim/osproc.html#inputStream%2CProcess |
20:19:43 | sschwarzer | rayman: I didn't say it's not good enough. I was just asking. :) |
20:20:12 | rayman22201 | you were talking about PR's, so I just wonder what issues you are having. |
20:21:09 | sschwarzer | rayman: I was referring to the limitation of `waitForExit` that it may block. I was thinking it should contain code similar to `execCmdEx` that reads the "remaining" output before trying to close the process. |
20:21:36 | Araq | well yeah, I'm sorry, we need to do something about the PR queue |
20:21:43 | sschwarzer | rayman: Only that it may need to read stdout _and_ stderr. |
20:21:58 | Araq | now if only the PR queue would address our bugs tagged with |
20:22:13 | Araq | crash, regression, high priority |
20:22:24 | Araq | ^ this is our v1 todo btw |
20:23:17 | * | Vladar quit (Remote host closed the connection) |
20:23:47 | sschwarzer | I think there should at least be something like "consume and return stdout and stderr that wasn't consumed yet". This would make it easy to write a two-line(?) `communicate` and it should help in removing the potential blocking from `waitForExit`. |
20:24:23 | Araq | well changing/fixing waitForExit is easier than introducing communicate |
20:25:02 | * | Senketsu joined #nim |
20:25:03 | Araq | 'communicate' would be in v1.1 |
20:25:04 | rayman22201 | you want `waitForExit` to return the stdout, stderr as well as the exitcode? I don't understand. |
20:26:15 | rayman22201 | it looks like the Python `communicate` blocks as well. |
20:26:49 | rayman22201 | Python `communicate` looks like `execCmdEx` with a timeout to me |
20:27:08 | sschwarzer | rayman: The most important thing for me would be to remove the potential blocking. I like it if a function doesn't do too much at once. |
20:27:31 | rayman22201 | Python doesn't do that for you either? |
20:27:40 | rayman22201 | so I don't understand the analogy |
20:27:49 | sschwarzer | rayman: As far as I know, `communicate` doesn't block. (I think on some platforms it even starts a thread to avoid this.) |
20:27:53 | * | alexander92 joined #nim |
20:28:26 | rayman22201 | I read " Wait for process to terminate" as blocking |
20:28:51 | rayman22201 | but idk much about new Python 3 stuff. I know Python 3 has async now, so does it use that? |
20:28:55 | sschwarzer | rayman: `execCmdEx` has the disadvantage that it couples the API (which is limited in comparison to `startProcess`) to start a process with dealing with the output. |
20:29:21 | * | shomodj joined #nim |
20:29:46 | * | narimiran quit (Ping timeout: 246 seconds) |
20:30:11 | dom96 | We should either just adopt asyncproc or tell everyone to use it as a package |
20:30:23 | rayman22201 | ah I see. What you really want is a `asyncPoc` |
20:30:26 | rayman22201 | yeah, exactly |
20:30:27 | dom96 | creating an API that doesn't block but also isn't async is bad |
20:30:52 | sschwarzer | rayman: Ok, maybe that's a misunderstanding. I supose "wait for process to terminate" means that the process may still be running and `communicate` needs to wait for it to finish. To be clear, I don't have a problem with blocking, but I think `waitForExit` shouldn't _deadlock_ if it's avoidable. |
20:32:36 | rayman22201 | I do like that `communicate` does not tie the waiting to the process exiting. It would not be a bad idea to have `waitForExit` just return / error on timeout and not try to kill the process internally. |
20:33:01 | rayman22201 | Might also be a good idea to add an optional timeout parameter to `execCmdEx`... |
20:33:05 | sschwarzer | rayman: When I said `communicate` doesn't block, I actually meant deadlock. |
20:33:07 | sschwarzer | Sorry |
20:33:26 | rayman22201 | lol. That is a very different concept :-P |
20:33:35 | sschwarzer | rayman: True! :-) |
20:34:05 | sschwarzer | rayman: Could be that I'm not 100 % attentive at the moment. :) |
20:35:54 | sschwarzer | rayman: According to the Python docs, `communicate` _does_ wait for the process to exit ("Interact with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached. Wait for process to terminate."). That said, Nim _could_ have an API that doesn't tie waiting for output and terminating together. |
20:36:05 | disruptek | is it a bug that i only get potential object case transition warnings when i'm actually compiling, as opposed to also receiving them when i'm issuing a `nim check`? |
20:36:52 | Araq | disruptek, kinda, yeah |
20:38:22 | zacharycarter_ir | yay - got the custom get vmhook working! |
20:38:46 | zacharycarter_ir | now we just need a lib like ast pattern matching for this :P |
20:38:54 | sschwarzer | What's the policy regarding tests going with PRs? If I enter a PR, what amount of tests does it have to have? |
20:40:09 | Araq | you check for some existing test and patch it to be more extensive |
20:40:28 | sschwarzer | Araq: Thanks! |
20:40:39 | Araq | there is tosproc.nim and tosprocterminate.nim |
20:41:35 | Araq | tosprocterminate.nim is a thing of beauty |
20:41:50 | * | nsf joined #nim |
20:43:04 | sschwarzer | Araq: Where are these files? I looked into https://github.com/nim-lang/Nim/tree/devel/tests/osproc , but you seem to mean another location? |
20:47:50 | sschwarzer | Araq: Nevermind. A local `locate` run answered my question. :-) |
20:48:40 | sschwarzer | I also found https://github.com/nim-lang/Nim/blob/devel/doc/contributing.rst |
20:50:25 | * | absolutejam2 joined #nim |
20:50:50 | Araq | https://www.twitch.tv/araq4k we're about to stream |
20:51:29 | Araq | topic: make FlowVar work with Future |
20:52:00 | * | absolutejam quit (Ping timeout: 244 seconds) |
20:53:09 | Araq | and we're live! |
20:56:11 | dom96 | hah, guess I should watch |
20:58:12 | sschwarzer | Which Nim-related plugins do you use for (Neo)vim? |
20:59:05 | kungtotte | I use https://github.com/alaviss/nim.nvim and the suggested async completion plugin https://github.com/prabirshrestha/asyncomplete.vim |
20:59:23 | disruptek | ditto. |
20:59:25 | Araq | proc foo(): int = 42; proc myAsync() {.async.} = let flowVar = spawn foo() |
20:59:52 | dom96 | Who's actually streaming here? |
21:00:01 | Araq | rayman |
21:00:03 | rayman22201 | Araq is streaming my pc :-P |
21:00:10 | dom96 | cool |
21:00:17 | rayman22201 | terrible lmao. so professional |
21:00:32 | dom96 | At least it's not a webcam pointed at his screen :P |
21:01:34 | sschwarzer | kungtotte: I use these, too. :) So far I don't have/see the function previews in the extra window (as in the ascinema video on the Github page). I guess I need to look more into this. |
21:02:15 | sschwarzer | kungtotte: But it's already great that "goto definition" works. That's very helpful. |
21:03:01 | dom96 | Araq, rayman22201 of course it compiles, it won't wait for the result though |
21:03:18 | dom96 | let res = await flowVar # this is what you want |
21:03:58 | * | natrys quit (Ping timeout: 272 seconds) |
21:04:27 | dom96 | I can hook up my mic and join if you guys like |
21:04:32 | Araq | sure |
21:06:06 | kungtotte | sschwarzer: you need to activate the async completion plugin following the steps on the nim.nvim readme. |
21:06:28 | dom96 | Araq, okay, how do I join? |
21:06:30 | * | absolutejam3 joined #nim |
21:06:37 | dom96 | oh, I see the PM |
21:06:54 | FromGitter | <eptification> @disruptek i would be a prime candidate for instruction |
21:06:59 | kungtotte | sschwarzer: and make sure you've got nimsuggest set up properly (using choosenim this should automatically be the case) |
21:07:33 | sschwarzer | kungtotte: Yes, this seems to work fine. Also very helpful. :) |
21:07:49 | sschwarzer | I installed Nim with choosenim |
21:07:54 | * | nsf quit (Quit: WeeChat 2.4) |
21:08:22 | * | absolutejam2 quit (Ping timeout: 245 seconds) |
21:14:59 | rayman22201 | https://github.com/nim-lang/Nim/issues/11564#issuecomment-504979907 |
21:15:47 | sschwarzer | kungtotte: When you write a proc name and an opening parenthesis, do you get anywhere a display of the signature? For me the signature is in the completion dropdown, - but only _until_ I type the parenthesis (which isn't very helpful ;-) ). |
21:16:20 | * | natrys joined #nim |
21:16:32 | sschwarzer | I mean the signature is of course helpful, but it would be great if it was shown somewhere after I typed the parenthesis. :) |
21:18:18 | * | solitudesf quit (Ping timeout: 268 seconds) |
21:22:04 | Araq | nimFlowVarSignal() |
21:24:05 | sschwarzer | One more thing regarding the osproc API: IMHO there should be a rather flexible API like that introduced by `startProcess`, but it would be nice to have this in a "run program and return an object returning the results", similar to https://docs.python.org/3/library/subprocess.html#subprocess.run . One should be able to use arguments to control what goes into the returned value. For example, if you don't |
21:24:11 | sschwarzer | want/need the output, it wouldn't make sense to store it, also because the output could be large. (I don't want to push anything here, I just want to offer an idea. :-) ) |
21:25:15 | sschwarzer | For the record, if I refer to Python so often, it's not because I think that Nim should do everything like Python. ;-) The background is just that Python has been my main programming language for 20 years and I'm very familiar with it and its APIs. |
21:25:33 | zacharycarter_ir | looks like nimscript + hot reload is going to work very well |
21:27:21 | sschwarzer | kungtotte: I'm leaving now, but feel free to write answers. I'll check the IRC log from the Nim website later. |
21:27:50 | sschwarzer | Bye everyone. Thanks for the interesting conversation! |
21:28:17 | * | sschwarzer left #nim (#nim) |
21:30:47 | Araq | nimFlowVarCreateSemaphore() |
21:31:10 | zacharycarter_ir | is there a way to import one nimscript module into another? |
21:33:10 | Araq | https://github.com/yglukhov/threadpools |
21:33:39 | zacharycarter_ir | figured it out |
21:41:51 | zacharycarter_ir | rayman2201: this might interest you - https://github.com/sheosi/tart |
21:42:52 | zacharycarter_ir | more specifically - https://github.com/sheosi/tart/tree/master/tart/structures |
21:43:10 | * | Trustable quit (Remote host closed the connection) |
21:44:33 | FromGitter | <eptification> @narimiran I'll just put all the on using notes here -->https://eptification.github.io/improved-octo-computing-machine/about. I already started on nim basics and nim in action. |
21:45:43 | * | actuallybatman quit (Ping timeout: 246 seconds) |
21:55:06 | * | zacharycarter_ir quit (Remote host closed the connection) |
22:12:17 | * | actuallybatman joined #nim |
22:13:29 | clyybber | Araq: What happens to a fields of an SubObject, when we downcast the object? Do their destructors get called? |
22:19:40 | clyybber | s/downcast/upcast |
22:21:53 | * | abm quit (Quit: Leaving) |
22:26:37 | * | elrood quit (Remote host closed the connection) |
22:29:50 | Araq | clyybber, well destructors are called for 'var' / 'let' |
22:30:02 | Araq | not for object conversions |
22:33:22 | clyybber | Araq: I mean what happens when we have: |
22:33:24 | clyybber | type |
22:33:31 | clyybber | Obj = object of RootObj |
22:33:41 | clyybber | SubObj = object of Obj |
22:34:13 | clyybber | someMemberWithADestructor: someType |
22:34:26 | clyybber | And we then cast SubObj to Obj |
22:34:39 | clyybber | Since nim supports non ref object inheritance right? |
22:35:05 | clyybber | s/cast/convert |
22:46:38 | Araq | well the destructor is created by calling '=destroy' on every field |
22:46:46 | Araq | just like in C++, I don't see the problem |
22:47:08 | Araq | and there is some logic to use a 'virtual' destructor if required |
22:48:07 | clyybber | ok |
22:51:37 | clyybber | good night |
22:51:38 | * | clyybber quit (Quit: WeeChat 2.5) |
22:51:51 | Araq | as promised, here is a link https://ux.stackexchange.com/questions/30682/are-there-any-recent-studies-of-the-keyboard-vs-mouse-issue |
22:51:58 | Araq | which leads to the study |
22:53:22 | Araq | but admittedly it's not about a programming context |
22:53:47 | Araq | still, using a pointing device to point into the text makes some intuitive sense :P |
22:54:31 | shashlick | what's the TLDR |
22:54:39 | Araq | mouse and keyboard are complementary, so you win when you use both. |
22:54:54 | shashlick | middle ground as always |
22:56:00 | Araq | and no, the "context switch" doesn't make you that much slower that you want to use the keyboard for pointing-like activities. Especially when you don't even type so much anyway, but browse some source code |
22:57:35 | * | rockcavera quit (Ping timeout: 268 seconds) |
22:57:56 | dom96 | that was fun |
22:59:11 | Araq | yeah, it was. And it did require the teamwork. |
22:59:28 | rayman22201 | Was definitely fun :-) Thanks for convincing me to do it @Araq |
22:59:32 | Araq | good night! |
22:59:35 | rayman22201 | gn |
23:00:36 | dom96 | lol, all your streams are called "nim programming live stream" |
23:00:42 | dom96 | You need to update that! |
23:07:17 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:08:44 | * | natrys quit (Quit: natrys) |
23:09:10 | rayman22201 | @dom96 this is the autocompleter for vim that I use btw: http://ycm-core.github.io/YouCompleteMe/ |
23:11:29 | dom96 | best name ever |
23:11:36 | dom96 | bbl |
23:12:14 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
23:20:17 | * | sealmove joined #nim |
23:22:47 | * | Jesin quit (Quit: Leaving) |
23:23:56 | * | absolutejam3 quit (Ping timeout: 272 seconds) |
23:26:03 | * | Jesin joined #nim |
23:57:29 | * | sealmove quit (Quit: WeeChat 2.5) |