00:08:29 | * | sz0 joined #nim |
00:18:27 | FromGitter | <yyyc514> what is the proper way to write out multiple simple pragmas? |
00:20:46 | * | fthe quit (Ping timeout: 250 seconds) |
00:33:21 | FromGitter | <Varriount> @yyyc514 Are the pragmas in the function signature? |
01:03:55 | cavariux | @zacharycarter I googled image/file to hex and use the first result :p. And to read it I used stb_image read from memory |
01:06:00 | FromGitter | <yyyc514> {.blah,.blah2} |
01:06:12 | FromGitter | <yyyc514> i didn't understand {. was the bracket :) |
01:06:36 | * | jakob0094 quit (Remote host closed the connection) |
01:07:56 | FromGitter | <zacharycarter> gotcha - thanks cavariux :) - I'll have to ask the bgfx author what DOS program he was using again |
01:14:21 | * | lritter quit (Ping timeout: 246 seconds) |
01:15:10 | * | lritter joined #nim |
01:22:39 | * | matti joined #nim |
01:42:00 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c0489e8500e8e37284ea486] |
01:43:43 | FromGitter | <gogolxdong> Have no idea why the result differs. |
01:43:58 | * | smitop quit (Quit: Connection closed for inactivity) |
01:44:48 | FromGitter | <gogolxdong> with other implementation |
01:50:03 | * | ftsf joined #nim |
01:52:39 | * | vlad1777d quit (Ping timeout: 252 seconds) |
02:13:18 | * | sz0 quit (Quit: Connection closed for inactivity) |
02:21:47 | * | ng0_ joined #nim |
02:24:51 | * | ng0 quit (Ping timeout: 256 seconds) |
02:52:30 | FromGitter | <yyyc514> so are there any details docs on where the type is stored for dynamic dispatch? i could probably just flip the type and it'd just work as long as the memory allocatiosn were the same |
03:07:42 | * | banc quit (Quit: ZNC - http://znc.in) |
03:21:53 | FromGitter | <yyyc514> ok are refs just dumb pointers? |
03:22:02 | FromGitter | <yyyc514> they seem to be stacked back to back and i can't find any type information hidden there |
03:25:53 | * | banc joined #nim |
03:46:24 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
04:00:49 | * | lritter quit (Ping timeout: 252 seconds) |
04:54:46 | * | narimiran joined #nim |
04:57:55 | * | endragor joined #nim |
04:59:13 | narimiran | 1 minute to go, who's here? :) |
04:59:24 | FromGitter | <Vindaar> yup |
04:59:36 | narimiran | of course :) |
04:59:49 | FromGitter | <Vindaar> :D |
05:10:14 | * | nsf joined #nim |
05:17:52 | FromGitter | <kdheepak> This one was fun. |
05:18:21 | FromGitter | <kdheepak> I think the pressure of getting the result quickly has me making mistakes that I would have otherwise not have made. |
05:21:35 | FromGitter | <yyyc514> i thought refs were supposed to be kind of automatic? i need to dereference all the time? |
05:25:00 | FromGitter | <kdheepak> @yyyc514 you probably don't need to. Are you using `ptr`? |
05:25:10 | FromGitter | <yyyc514> nope, ref |
05:25:25 | FromGitter | <kdheepak> If you use `ref` I don't think you need to deference. |
05:25:54 | FromGitter | <kdheepak> You do need to use `new`, but the garbage collector will take care of deallocation. |
05:27:34 | FromDiscord_ | <technicallyagd> Damn. I was going to write some utility procs for working with grids yesterday |
05:28:23 | FromGitter | <kdheepak> Haha. |
05:28:24 | FromDiscord_ | <technicallyagd> but decided to put it off for later |
05:28:38 | narimiran | :) |
05:28:48 | FromDiscord_ | <technicallyagd> damn Murphy's law |
05:29:15 | FromDiscord_ | <technicallyagd> I ended up with a really inefficient solution |
05:29:28 | narimiran | @technicallyagd what are you planning to do today, but you will put it off? asking for a friend |
05:29:30 | FromDiscord_ | <technicallyagd> took about 1 second to run |
05:30:00 | FromDiscord_ | <technicallyagd> @narimiran sorry, I don't quite understand the question |
05:30:25 | narimiran | ah, i wanted to know what will be tomorrow's task ;) |
05:30:31 | FromDiscord_ | <technicallyagd> LOL |
05:32:04 | FromDiscord_ | <technicallyagd> Will, it's actually kind of a confirmation bias. I think I decided to put off writing a lot of things yesterday. |
05:33:08 | FromDiscord_ | <technicallyagd> But I think parsing today's instruction took me a lot of time also. |
05:33:50 | FromDiscord_ | <technicallyagd> the # and : and NUMxNUM are quite atypical for all the tasks I have seen so far |
05:33:56 | narimiran | parsing was the easy part for me (just one mistake :P), but later on i've made some typos which have cost me two failed attempts |
05:34:44 | narimiran | i don't want to spoil/help for the guys who are still solving, but there's an easy way to parse inputs like this one |
05:34:46 | FromDiscord_ | <technicallyagd> lol I was tripped up by mgetOrPut |
05:35:53 | FromDiscord_ | <technicallyagd> I definitely wish I knew, have you used it in your solutions in earlier years? |
05:36:11 | FromDiscord_ | <technicallyagd> maybe I could find them myself |
05:38:52 | narimiran | i've used it in AoC 2015, days 6 and 15 |
05:39:27 | FromDiscord_ | <technicallyagd> I thought mgetOrPut returns a mutable reference to the entry |
05:39:37 | FromDiscord_ | <technicallyagd> @narimiran Thank you! |
05:40:37 | FromDiscord_ | <technicallyagd> but assigning the returned value to a new variable seems to copy the content though |
05:40:56 | FromGitter | <Vindaar> oh damn, I wasted more than 10 minutes at the end, because I forgot to skip the part I was looking at when comparing it to others, duh |
05:40:57 | narimiran | yeah, i never used `mget`, not my cup of tea |
05:42:38 | FromDiscord_ | <technicallyagd> it's actually quite convenient while working with a table of seq's |
05:43:35 | FromDiscord_ | <technicallyagd> @Vindaar lol I think we've all been there |
05:44:53 | FromDiscord_ | <technicallyagd> @narimiran THANK YOU! this is exactly what I was looking for. |
05:46:38 | narimiran | :) |
06:02:00 | FromGitter | <yyyc514> can you forward-declare types across multiple files? i have a recursive dependency |
06:08:40 | leorize | no, unfortunately |
06:09:00 | leorize | there's package-level declaration for that, but personally I rarely find it useful |
06:10:35 | FromGitter | <yyyc514> package level declaration? |
06:12:19 | leorize | http://nim-lang.github.io/Nim/manual.html#types-package-level-objects |
06:29:47 | * | fredrik92 quit (Read error: Connection reset by peer) |
06:30:14 | * | fredrik92 joined #nim |
06:54:44 | * | kapil____ quit (Quit: Connection closed for inactivity) |
06:59:00 | * | narimiran quit (Ping timeout: 250 seconds) |
07:08:57 | * | krux02 joined #nim |
07:42:06 | FromGitter | <AchalaSB> What this error represent with `gc:stack or gc:region` ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c04de4dbc1a693e3a4a1b0a] |
07:42:16 | Tanger | Hey folks, anybody know of any references for migrating macros over from v0.18 to v0.19? |
07:53:18 | * | navin joined #nim |
07:56:28 | * | kapil____ joined #nim |
08:02:41 | * | tribly quit (Quit: WeeChat 2.3) |
08:03:50 | * | ftsf quit (Quit: Leaving) |
08:08:12 | leorize | Tanger: https://nim-lang.org/blog/2018/09/26/version-0190-released.html |
08:08:18 | leorize | ^ the changelog would be a good start |
08:08:48 | leorize | but looks like there weren't any breaking changes related to macros |
08:09:15 | Tanger | leorize, Thanks. I had a look at that and the macros module as well. I wasn't a fan of the "Deprecated since version 0.18.1; All functionality is defined on NimNode." deprecation message |
08:09:31 | Tanger | But now it makes sense (ie, replace all ident nodes with NimNodes and voila!) |
08:14:08 | FromGitter | <alehander42> Araq: do you use strformat inside the compiler |
08:20:30 | Araq | no and I don't like it |
08:20:45 | Araq | I was against strformat before we added it |
08:31:20 | FromGitter | <alehander42> eh, ok `shrugs` |
08:38:29 | * | navin quit () |
08:39:06 | * | PMunch joined #nim |
08:39:24 | * | PMunch quit (Remote host closed the connection) |
08:39:29 | * | PMunch_ joined #nim |
08:42:48 | * | PMunch_ quit (Read error: Connection reset by peer) |
08:48:49 | * | PMunch joined #nim |
08:52:52 | FromGitter | <alehander42> Araq: this is my (mostly) last week's prototype for nil ref |
08:52:52 | FromGitter | <alehander42> https://github.com/alehander42/Nim/commit/60bf30d374fe9214ff7530f11f2e482d8baa328f |
08:53:27 | FromGitter | <alehander42> on the top are the rough rules of what I was planning (some or implemented) |
08:54:16 | * | Gertm left #nim ("Leaving") |
08:56:11 | FromGitter | <narimiran> could `ns = line[0 ..< i] & '_' & line[i+1 ..< line.len]` be optimized, or should i just manually do `ns[0 ..< i] = line[0 ..< i]` etc.? |
09:03:24 | FromGitter | <narimiran> nvm, next time i should figure out that my second version had an error, and that's why it was 4x faster than the first (working) version :) |
09:05:15 | * | floppydh joined #nim |
09:24:36 | * | dom96_w joined #nim |
09:24:38 | Araq | alehander42: seems useful but I would make every ref parametet not-nil implicitly |
09:28:09 | Araq | then to be able to call f(myvar) myvar must be provably not-nil |
09:28:46 | Araq | and for this in 'var myvar = g()' g must also return a not-nil ref |
09:29:57 | Araq | then you have to prove that all paths lead to a 'result = ...' assignment |
09:32:39 | FromGitter | <narimiran> Araq: is there a reason why we have `break <label>` but not `continue <label>`? |
09:33:07 | Araq | yes. labels only exists for 'block' not for loops |
09:33:28 | Araq | and continue only works with loops |
09:34:10 | FromGitter | <narimiran> ok, i thought so. i'll use break |
09:47:27 | PMunch | Hmm, interesting: gcc: error: /home/peter/.cache/nim/nimlsp_d/linenoise.c.o: No such file or directory |
09:47:46 | PMunch | Something seems to have missed a file.. |
09:57:43 | PMunch | Hmm, switching to devel seemed to fix it |
10:18:18 | * | tribly joined #nim |
10:48:37 | * | ng0_ quit (Ping timeout: 256 seconds) |
10:50:12 | FromGitter | <alehander42> Araq: but what if your `g` can return nil? |
10:50:22 | * | ng0_ joined #nim |
10:51:16 | FromGitter | <alehander42> yeah, that's correct about result, I forgot about that: I wanted that especially because i already had such a nil bug in my prototype itself, haha |
10:52:44 | FromGitter | <alehander42> i'd love to have non-nil ref by default |
10:53:19 | FromGitter | <alehander42> but I can't see how this can work with the other more unsafe code around (e.g. stdlib/other existing libs) |
10:56:26 | FromGitter | <alehander42> otherwise you have ref being `not nil` by default in checked procedures and `maybe nil` by default in unchecked procedures |
10:56:54 | Araq | well 'g' would then say returns 'ref T or nil' |
10:57:02 | Araq | or 'nil ref T' |
10:57:11 | Araq | I think that syntax already exists |
10:57:27 | FromGitter | <alehander42> huh, I didn't know of `nil ref` |
10:59:38 | FromGitter | <alehander42> but my point is, checked procedures have to assume that they might call unchecked procedures |
10:59:57 | FromGitter | <alehander42> and e.g. the stdlib is unchecked, it's not an edge case |
11:00:45 | FromGitter | <alehander42> and the stdlib `g` currently says `ref T`, not `nil ref T` |
11:02:22 | FromGitter | <alehander42> tl;dr the existing unchecked code(e.g. stdlib) uses the opposite default, how do i deal with that |
11:19:29 | FromGitter | <alehander42> also, notice that `not nil` args infect the caller: we have to check(& change) all unchecked callers of functions with `not nil` too, so if this is the default, we have to change a lot of the stdlib, we can't just say "dont check this" |
11:43:24 | * | dom96_w quit (Ping timeout: 268 seconds) |
11:57:07 | * | jakob0094 joined #nim |
12:06:48 | * | btbytes_ joined #nim |
12:14:59 | FromGitter | <zacharycarter> everyone finish their ld entries? |
12:15:07 | FromGitter | <zacharycarter> I guess there's an extra day or something for the 72 hour jam |
12:15:45 | FromGitter | <zacharycarter> looking forward to playing some |
12:26:06 | * | Vladar joined #nim |
12:34:36 | * | stefanos82 joined #nim |
12:44:29 | * | dddddd joined #nim |
12:44:31 | Araq | alehander42: Think about how this feature should work ideally, we can always patch the stdlib |
12:48:45 | FromGitter | <alehander42> Araq: well, ideally I agree it should be the default, I am just saying it breaks a lot of existing code (3rd party libs too): ⏎ I think we can for now we can have a global flag that changes the default everywhere , but make it off by default: fix existing code to use correctly `nil ref` / `ref` and when it's mature enough, the global flag can be turned on by default |
12:48:52 | * | fthe joined #nim |
12:50:59 | * | fthe quit (Remote host closed the connection) |
12:53:18 | * | ng0_ quit (Quit: Alexa, when is the end of world?) |
12:55:23 | * | ng0 joined #nim |
13:07:21 | * | vlad1777d joined #nim |
13:09:23 | * | dom96_w joined #nim |
13:19:19 | * | btbytes_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:21:17 | * | Snircle joined #nim |
13:26:52 | Araq | alehander42, yeah sure, we will find a migration path |
13:34:26 | FromGitter | <arnetheduck> +1 not nil default.. also, +1 on having it check that a function that should return a value returns a value / assigns a result.. akin to how you have an expression if, and all branches must return something |
13:36:38 | FromGitter | <alehander42> @arnetheduck I absolutely agree with Araq here, I was only pointing out that a lot of code should be fixed (even the current check doesn't accept many third party libs/modules in my codebase) |
13:38:04 | FromGitter | <alehander42> ok, I'll continue with the other cases later today or tomorrow |
13:38:42 | FromGitter | <mratsim> How does that work with partial object initialisation? |
13:39:18 | FromGitter | <arnetheduck> just voicing general support for the idea @alehander42 :) happy to see it |
13:40:30 | FromGitter | <arnetheduck> also, because I spent quite some time on a bug yesterday in nlvm where an early return failed to set the result correctly in one of the branches |
13:42:19 | FromGitter | <arnetheduck> it's specially useful with the last-expression-is-the-return-of-the-block idea and would provide nice closure to the feature - right now, if you write an expression without using it, there's an error, and if you write a let without an expression, there's also an error, but it would be really nice to have these errors extend to function definitions as well so that you can rely on that pattern |
13:43:33 | * | btbytes joined #nim |
13:45:50 | FromGitter | <arnetheduck> @mratsim not sure what the question is, but the idea is that you always have to say something, even if it's an empty init.. (`result = MyType()` or actually just `MyType()` at the end and you save some noise) |
13:46:39 | FromGitter | <alehander42> I don't think this is required |
13:46:49 | FromGitter | <alehander42> ```if a: ⏎ result = .. ⏎ else: ⏎ result = ..``` [https://gitter.im/nim-lang/Nim?at=5c0533c93f503110361b8633] |
13:46:53 | FromGitter | <alehander42> should be ok |
13:47:08 | FromGitter | <alehander42> (maybe I misunderstood you too) |
13:48:55 | FromGitter | <mratsim> it’s the error `cannot prove that foo has been initialized` that prevents some optimisations as well |
13:49:44 | FromGitter | <mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c053477464b6c0fd6847014] |
13:50:19 | FromGitter | <mratsim> ^ i.e. Nim would now be able to rely on all objects being fully constructed. |
13:52:34 | FromGitter | <alehander42> ah, initialization |
13:53:10 | FromGitter | <alehander42> I think your ideally example should still produce an error? |
13:53:16 | FromGitter | <alehander42> ideally your* |
13:56:21 | FromGitter | <alehander42> absent-minded, you actually want |
13:56:47 | FromGitter | <zacharycarter> OSX is annoying... By default gcc maps to clang so that means to debug memory leaks, I should be able to use address sanitizer |
13:56:49 | FromGitter | <mratsim> I don’t know, I don’t care either way ;) |
13:57:05 | FromGitter | <alehander42> let a = Foo(baz: true) ⏎ .. ⏎ (a.bald not used ) # bald ... really ... we are people too ⏎ .. ⏎ a.bald = .. ... [https://gitter.im/nim-lang/Nim?at=5c053630500e8e372852afde] |
13:57:05 | FromGitter | <zacharycarter> but XCode / the clang osx ships with, has a bunk asan distributed with it |
13:57:22 | FromGitter | <zacharycarter> so now I'm resorting to building llvm and clang on my machine |
13:57:26 | Araq | I wrote an RFC about the initialization problem |
13:57:38 | FromGitter | <zacharycarter> I wonder - if I just compiled with gcc instead of clang - if valgrind might work |
13:57:46 | FromGitter | <mratsim> @zacharycarter yeah I know, put that in your nim.cfg: https://github.com/numforge/laser/blob/master/nim.cfg#L10-L15 |
13:59:04 | FromGitter | <zacharycarter> thanks @mratsim |
14:29:50 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
14:36:44 | * | gangstacat quit (Remote host closed the connection) |
14:37:06 | * | gangstacat joined #nim |
14:43:57 | * | nsf quit (Quit: WeeChat 2.3) |
14:50:54 | * | btbytes quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:51:33 | * | btbytes joined #nim |
14:51:33 | * | btbytes quit (Client Quit) |
14:52:41 | * | ng0 joined #nim |
14:59:09 | * | lritter joined #nim |
15:00:40 | FromGitter | <Varriount> Araq: Where's the RFC? |
15:01:21 | * | endragor quit (Remote host closed the connection) |
15:03:08 | * | shadowbane joined #nim |
15:07:19 | Araq | https://github.com/nim-lang/Nim/issues/7917 |
15:09:45 | Araq | it can be made to work if passToVarT(uninitVar) is transformed into uninitVar = default(T); passToVarT(uninitVar) |
15:10:36 | Araq | well then it starts to work for objects/inheritance and arrays but 'case' objects remain problematic |
15:11:34 | FromGitter | <Clyybber> Araq Is anybody currently working on default values for object fields? |
15:12:51 | FromGitter | <mratsim> I think the question is: do we agree that we should do it and this is the proper way. |
15:14:28 | Araq | Clyybber: No but the feature is rather "easy". Initializers have to be values |
15:14:41 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
15:14:59 | Araq | don't allow function calls for it and then it breaks none of Nim's invariants |
15:15:13 | Araq | (construction cannot fail in Nim) |
15:15:31 | * | kapil____ quit (Quit: Connection closed for inactivity) |
15:15:37 | * | endragor joined #nim |
15:15:58 | * | PMunch quit (Remote host closed the connection) |
15:16:11 | FromGitter | <Clyybber> Nice, so that means no real performance impact either? |
15:16:45 | Araq | it has a bit of an impact as we cannot use memset() for these |
15:17:33 | Araq | but then currently we would do memset(x, 0); x.field = 1 instead so that cannot be better |
15:18:36 | Araq | we also cannot allow it for fields in a 'case' section as that would be hard to support |
15:19:47 | * | endragor quit (Ping timeout: 240 seconds) |
15:20:49 | * | floppydh quit (Quit: WeeChat 2.3) |
15:21:59 | FromGitter | <alehander42> btw @jacereda , did you take a look at case objects with if? |
15:31:21 | * | masquino quit (Ping timeout: 244 seconds) |
15:40:00 | * | nsf joined #nim |
15:41:29 | * | endragor joined #nim |
15:41:31 | * | kapil____ joined #nim |
15:42:40 | * | vlad1777d quit (Ping timeout: 268 seconds) |
15:48:10 | * | endragor quit (Remote host closed the connection) |
15:48:27 | * | endragor joined #nim |
15:51:09 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:55:54 | * | xet7 quit (Ping timeout: 250 seconds) |
15:58:26 | * | xet7 joined #nim |
15:58:30 | * | Amun_Ra quit (Ping timeout: 250 seconds) |
15:58:46 | * | vlad1777d joined #nim |
15:59:22 | * | dom96_w joined #nim |
15:59:24 | * | Amun_Ra joined #nim |
16:11:11 | * | narimiran joined #nim |
16:17:39 | * | Trustable joined #nim |
16:20:10 | FromGitter | <Clyybber> Is there a way to get the identifier of a function without importing the macros module? |
16:21:19 | Araq | no |
16:22:04 | FromGitter | <alehander42> get or quote |
16:23:19 | FromGitter | <alehander42> Araq, is there a reason `substrEq` isn't exposed |
16:23:34 | * | masquino joined #nim |
16:23:55 | * | btbytes joined #nim |
16:24:11 | * | ajibade joined #nim |
16:24:32 | Araq | alehander42: wanted to use a TR macro for it |
16:24:34 | FromGitter | <alehander42> i want to compare a substring without `[]`'s allocation |
16:26:42 | * | Trustable_2 joined #nim |
16:26:42 | * | Trustable quit (Read error: Connection reset by peer) |
16:26:46 | FromGitter | <alehander42> for substrEq ? |
16:31:52 | * | btbytes quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:34:40 | * | endragor quit (Remote host closed the connection) |
16:34:54 | * | endragor joined #nim |
16:35:00 | * | btbytes joined #nim |
16:36:15 | * | vlad1777d quit (Ping timeout: 246 seconds) |
16:39:20 | Araq | sure |
16:40:21 | * | theelous3_ joined #nim |
16:40:23 | FromGitter | <arnetheduck> oh, btw @Awaq, another self-assignment bug, just for you :) https://github.com/nim-lang/Nim/issues/9844 |
16:41:24 | Araq | if only we could construct stuff and then move it to where it belongs |
16:41:50 | FromGitter | <arnetheduck> actually, that makes me wonder if the cgen wouldn't be better served by sticking to SSA form completely - that's what it essentially ends up in anyone, in most modern compiler pipelines |
16:42:01 | FromGitter | <arnetheduck> *anyway |
16:42:04 | Araq | but oh no, move semantics are just for crappy destructors :P |
16:43:43 | Araq | SSA is one solution, the other is aliasing checking |
16:44:41 | * | endragor quit (Remote host closed the connection) |
16:45:02 | * | endragor joined #nim |
16:47:29 | FromGitter | <arnetheduck> latter sounds complicated, specially to do at the nim level - too many moving pieces |
16:47:37 | * | endragor quit (Remote host closed the connection) |
16:48:42 | FromGitter | <arnetheduck> ie even though it's gone through several simplifying transformations already, the ast that arrives to the cgen (or the other backends) is still fairly high-level and complicated |
16:54:29 | Araq | we have alias analysis though and that's what we use already in the other cases |
16:55:45 | FromGitter | <iffy> @yglukhov Now I'm getting `JNI DETECTED ERROR IN APPLICATION: thread Thread[24 ... ] using JNIEnv* from thread` errors (using jnim). Does jnim require `--threads:on`? I get a different failure with threads on. |
16:57:45 | Araq | that the AST remains fairly high-level is a feature to allow the generation of high-level C(++) code |
17:03:30 | * | ajibade quit (Ping timeout: 250 seconds) |
17:04:06 | * | kumul joined #nim |
17:08:11 | * | btbytes quit (Quit: Textual IRC Client: www.textualapp.com) |
17:12:39 | * | kumul left #nim ("Leaving") |
17:13:45 | FromGitter | <arnetheduck> yeah, that's a good point - not sure what a good solution here is, but for `nlvm` it kind of means a lot of duplicate work - ie some analysis could be carried out in a shared step between them (ie the cgen modifies the ast in some significant ways, adding flags and TLoc's and other stuff that it finds - this looks a bit out of place) |
17:17:52 | FromGitter | <xmonader> I can't find the part 3 of the official tutorial? it's merged here https://github.com/nim-lang/Nim/pull/9588 |
17:18:04 | FromGitter | <xmonader> but can't see it in the site, maybe i'm missing something? |
17:18:18 | FromGitter | <SolitudeSF> https://nim-lang.github.io/Nim/tut3.html |
17:18:39 | FromGitter | <xmonader> thank @SolitudeSF |
17:19:20 | * | endragor joined #nim |
17:20:08 | * | endragor quit (Remote host closed the connection) |
17:24:41 | FromGitter | <alehander42> Araq, is there a reason `undefined` is not nil in the JS backend |
17:42:04 | * | dom96_w quit (Changing host) |
17:42:04 | * | dom96_w joined #nim |
17:42:09 | dom96_w | possibly because it's literally not nil? :) |
17:43:28 | * | nsf quit (Quit: WeeChat 2.3) |
17:43:33 | FromGitter | <alehander42> hehe, that's what I thought for a long time |
17:44:07 | FromGitter | <alehander42> but it's for Nim, it's exactly as invalid as nil |
17:45:27 | FromGitter | <alehander42> but `if a.isNil` doesn't check if `a` is undefined |
17:45:52 | FromGitter | <alehander42> => either `isNil` should do this too .. then undefined becomes kinda `==` nil |
17:46:12 | FromGitter | <alehander42> => or we need a isUndefined magic too |
17:46:40 | Araq | well 'nil' is 'null' in JS |
17:47:06 | Araq | but I never thought about it much, 'undefined' for me was just a design bug of JS |
17:47:10 | FromGitter | <alehander42> ok, let me rephrase it, should nil == JSUndefined be true |
17:48:34 | FromGitter | <alehander42> (we should still have isUndefined, but it can be just a simple importcpp proc) |
17:52:20 | FromGitter | <alehander42> it will be actually exactly what JS itself does: `null == undefined // true` |
17:52:50 | FromGitter | <alehander42> (`===` is false iirc, in our case we can just have isJSNull / isJSUndefined for those rare cases) |
17:59:22 | Araq | bootstrapping works with incremental compilation, yay |
18:00:25 | FromGitter | <rayman22201> woot |
18:01:14 | Araq | well it's still super-slow |
18:01:31 | Araq | need to profile it |
18:01:45 | Araq | then the backend also needs to implement caching |
18:02:13 | Araq | and then we can make the dependency analysis more precise and do lazy loading |
18:05:58 | FromGitter | <rayman22201> still, good progress. :-D |
18:07:02 | * | elrood joined #nim |
18:14:43 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
18:28:41 | FromGitter | <zacharycarter> woot! congrats! |
18:31:30 | * | Snircle joined #nim |
18:33:05 | * | rockcavera quit (Remote host closed the connection) |
18:33:16 | * | Perkol joined #nim |
18:35:32 | * | kapil____ quit (Quit: Connection closed for inactivity) |
18:36:35 | Perkol | I'm trying to make a function which overwrites everything in file with zeroes and then deletes it. https://bpaste.net/show/e617a4f3044e |
18:37:07 | Perkol | But instead it truncates the file to empty and then deletes it |
18:38:53 | Perkol | How do i properly overwrite it? |
18:40:19 | * | rockcavera joined #nim |
18:42:11 | oprypin | Perkol, usually there's an "append" mode as opposed to "write". i'd guess in nim that would be fmAppend ? |
18:42:32 | oprypin | also you have to reset to the beginning after that |
18:43:14 | oprypin | also there's an r+ file mode which wouldnt require you to reset but probably easier to just reset. https://www.google.com/search?q=r%2B+python |
18:47:12 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:01:54 | * | endragor joined #nim |
19:02:31 | * | endragor quit (Remote host closed the connection) |
19:02:49 | xace | hmm, i find myself using nim c --debugger:native frequently for small programs, is there a quick way i can create a alias for this? e.g. nim d <my other parameters> |
19:04:31 | * | julien joined #nim |
19:04:54 | * | julien is now known as Guest37486 |
19:04:56 | * | Guest37486 quit (Client Quit) |
19:06:14 | * | PMunch joined #nim |
19:06:54 | * | Guest4874 joined #nim |
19:09:51 | xace | oh, also, sometimes stepping through code in GDB with `step` and `next` can result in the debugger staying on the same line. is there a way I can reconfigure GDB to deal with this better for nim? |
19:11:58 | xace | or if there is a more appropriate debugger for nim, i'd be interested. main appeal for me atm is CLI tool as I only have access to a simple terminal 99% of the time |
19:16:51 | leorize | well, gdb is the best one atm |
19:17:05 | leorize | xace: create a `.nims` file |
19:17:09 | FromGitter | <arnetheduck> it's not really ready for prime time, but you can give `nlvm` a spin if you're running linux - lets you step through nim code and see nim variables etc |
19:17:13 | leorize | xace: look up for nimscript documentation |
19:17:18 | xace | reading https://forum.nim-lang.org/t/3076 krux mentions that you can edit nim.cfg, how do i make --debuger:native default? |
19:17:49 | xace | leorize: yeah, thing is i'd rather have it on the machine config, as i create small programs in the spur of the moment... |
19:18:14 | xace | i use .nims for better planned projects |
19:18:32 | leorize | a global `config.nims` is possible with the latest release now |
19:19:03 | FromGitter | <timotheecour> u can use when `defined(with_debug): switch(“debuger”, “native”)` in ur ~/.config/nim/config.nims |
19:19:41 | leorize | or... `task d: switch("debugger", "native"); selfExec("c")` |
19:19:47 | FromGitter | <timotheecour> also, u can try lldb, works fine too (neither gdb nor lldb are perfect) |
19:20:40 | xace | leorize, timotheecour: this is perfect for my needs now :) thank you |
19:22:49 | elrood | why not use a simple alias for your shell though? alias nimd='nim c -debugger:native' and you're all set |
19:23:36 | xace | elrood: hmm, figured i might aswell start getting familiar with the nim.config stuff |
19:24:04 | xace | as I feel like there are more things i need in the future. e.g. --threads:on and --ssl:on. some aliases for them would be cool too |
19:29:19 | * | endragor joined #nim |
19:29:50 | * | endragor quit (Remote host closed the connection) |
19:32:53 | xace | timotheecour i cant get the defined(with_debug): working, it complains about illformed AST |
19:38:06 | * | Vladar quit (Remote host closed the connection) |
19:38:25 | Araq | timotheecour: I never saw "encodeType: tyForward", what small program triggers it? |
19:38:35 | * | Vladar joined #nim |
19:43:49 | xace | fixed it, it was missing `when defined...` |
19:47:58 | * | NimBot joined #nim |
19:57:02 | * | shpx joined #nim |
20:03:20 | * | endragor joined #nim |
20:08:53 | PMunch | Hmm, does nimble handle submodules? |
20:09:42 | * | endragor quit (Remote host closed the connection) |
20:12:27 | FromGitter | <mratsim> one module_name.nim and module_name/ folder at the project/src root |
20:12:32 | FromGitter | <mratsim> per submodule |
20:12:46 | PMunch | Oh no, I meant git submodules |
20:13:19 | FromGitter | <mratsim> normally it pulls them automatically on nimble install but we had some issues with that in the CI like 3 months ago |
20:13:44 | FromGitter | <mratsim> example: https://github.com/status-im/nim-secp256k1/tree/master/secp256k1_wrapper |
20:14:21 | Perkol | http://rgho.st/8Ty7b8kC8 |
20:14:29 | * | Perkol quit (Quit: Leaving) |
20:14:41 | * | endragor joined #nim |
20:14:42 | PMunch | Ah, so it should work without anything extra? |
20:14:49 | dom96 | it does, it should init the submodules |
20:15:56 | Araq | wow of all the files in the compiler guess what module has the most symbols |
20:15:57 | * | endragor quit (Remote host closed the connection) |
20:16:05 | dom96 | ast |
20:16:24 | Araq | that's on position 5 |
20:16:28 | Araq | but good guess |
20:16:41 | Araq | 2nd place is sem.nim |
20:16:46 | dom96 | why are you measuring this btw? |
20:16:54 | Araq | but the first goes to system.nim |
20:17:16 | * | Trustable_2 quit (Remote host closed the connection) |
20:17:18 | Araq | the very file every Nim program uses is also the biggest. yay :-( |
20:17:32 | PMunch | Kinda makes sense though |
20:17:50 | FromGitter | <timotheecour> @araq is there a way to mark a PR as “good to merge” pending CI passes? (And, to automatically merge as soon as it passes) |
20:17:57 | dom96 | oh, I was considering the compiler modules only |
20:18:05 | Araq | dom96, looking for how to optimize IC |
20:18:12 | dom96 | timotheecour: not on GitHub without some sort of bot |
20:18:22 | dom96 | (GitLab does support this) |
20:18:36 | FromGitter | <timotheecour> that’d be very useful right? would streamline things quite a bit |
20:19:00 | dom96 | yeah |
20:19:05 | Araq | narimiran starts in January as our community manager |
20:19:30 | Araq | and will also be responsible for pushing PRs through |
20:19:59 | * | endragor joined #nim |
20:20:13 | dom96 | great |
20:20:44 | dom96 | hrm, should I do AoC or not |
20:20:51 | dom96 | I gave up on Ludum Dare |
20:21:06 | dom96 | sooo tired after work though :/ |
20:21:06 | Araq | you could fix stdlib bugs... |
20:21:22 | dom96 | That's significantly more difficult |
20:21:28 | Araq | lol |
20:21:30 | dom96 | and likely less fun |
20:21:54 | Araq | I wish I could fix stdlib bugs instead :P |
20:24:36 | * | Tyresc joined #nim |
20:25:27 | * | endragor quit (Remote host closed the connection) |
20:26:38 | * | nsf joined #nim |
20:27:07 | * | endragor joined #nim |
20:28:28 | * | Amun_Ra quit (Ping timeout: 250 seconds) |
20:28:38 | * | endragor quit (Remote host closed the connection) |
20:34:02 | Tyresc | Hi, I am trying to send a http post request but the site I want to interact with doesn't seem to work with multipart data as shown in the tutorial |
20:34:42 | Tyresc | I think I need to replace the multipartData part in the postContent call but I am not really sure how I am supposed to replace it |
20:34:44 | Tyresc | or rather what |
20:34:59 | Tyresc | would appreciate if someone could point me in the right direction |
20:42:47 | Tyresc | well, nevermind already got it working |
20:43:38 | * | ng0 joined #nim |
20:44:52 | FromGitter | <arnetheduck> @Araq, sometimes it's efficient to clear the table before starting a new project on it :) |
20:45:52 | FromGitter | <arnetheduck> for system.nim, https://github.com/nim-lang/Nim/issues/9208 is a good way to constructively start making it smaller |
20:49:48 | PMunch | Just updated nimlsp to use the nimsuggest as a library which should make it more stable. I'd say it's now ready for use, so let the bug-reports flow! |
20:50:00 | * | narimiran quit (Remote host closed the connection) |
20:50:26 | PMunch | I also updated the readme |
20:54:43 | * | krux02 quit (Remote host closed the connection) |
20:55:15 | * | nsf quit (Quit: WeeChat 2.3) |
20:57:20 | FromGitter | <zacharycarter> whoa - physx is OS now |
20:57:21 | FromGitter | <zacharycarter> https://news.developer.nvidia.com/announcing-physx-sdk-4-0-an-open-source-physics-engine/ |
21:09:49 | * | kungtotte quit (Quit: leaving) |
21:20:22 | * | zachk joined #nim |
21:20:53 | * | eduarch joined #nim |
21:21:04 | * | zachk quit (Changing host) |
21:21:04 | * | zachk joined #nim |
21:23:49 | Araq | hmmm full recompile: 12s, cached recompile: 18s |
21:26:22 | dom96 | eduarch: all non-registered users are muted in this channel |
21:27:06 | dom96 | I'm undoing this setting (I think the spam has stopped) |
21:27:17 | Araq | dom96, we will regret this decision |
21:27:27 | * | dom_t joined #nim |
21:27:30 | dom96 | Araq: https://github.com/nim-lang/Nim/wiki/IRC-guidelines#quiet-every-unregistered-user |
21:27:35 | dom96 | Save this somewhere you'll remember it |
21:27:42 | dom96 | and you can enable the mute again |
21:27:47 | dom_t | test |
21:27:55 | * | dom_t quit (Client Quit) |
21:27:55 | Araq | I know about our wiki |
21:28:31 | dom96 | eduarch: as far as your question goes, I don't know if the arch wiki owners would like an article about Nim in there, but if they are then go for it |
21:31:01 | shashlick | is nimprof still broken? https://github.com/nim-lang/Nim/issues/8991 |
21:31:31 | * | Guest4874 quit (Remote host closed the connection) |
21:31:58 | Araq | dunno |
21:33:08 | * | Vladar quit (Remote host closed the connection) |
21:34:10 | shashlick | ugh, so no easy way to identify slow procs |
21:34:22 | shashlick | are closures slower than regular procs |
21:34:37 | dom96 | You can still profile with Valgrind: https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html#profiling-with-valgrind |
21:39:05 | shashlick | hmm, well I'll wait since I am bothered by performance in debug mode - release is still reasonable |
21:39:20 | Araq | closures are slow |
21:39:28 | shashlick | but having nimprof work is crucial |
21:39:32 | xace | PMunch: i use vim as my main editor and i'm not ready to edit my config for nimlsp yet. I dont mind trying it out in vscode everynow and then, do you know how to add it to vscode? |
21:39:48 | shashlick | Araq: any ballpark on how much slower? |
21:42:50 | PMunch | xace, I think LSP is built into VSCode |
21:42:52 | Araq | factor of 2 for the calling overhead but when they capture stuff then can trigger GC collections |
21:43:06 | PMunch | But I'm not entirely sure how to configure it |
21:43:12 | xace | https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html#listing_1_5 how are you suppose to interpret these results? |
21:43:24 | PMunch | It's really not that intrusive in Vim though |
21:43:27 | xace | PMunch: yeah, thats the part im trying to figre out, googling didnt hlep yet |
21:43:53 | xace | PMunch: yeah, i agree, thing is im using YCM and meddling with that would destroy my current working autocompletion for other languages |
21:44:01 | xace | YCM doesnt play nice with other tools |
21:44:09 | PMunch | Ah right |
21:44:25 | * | Amun_Ra joined #nim |
21:45:12 | shashlick | Araq: okay thanks I can avoid them, no good reason to use it in my case |
21:45:58 | * | eduarch quit (Ping timeout: 268 seconds) |
21:54:03 | FromGitter | <arnetheduck> @shashlick you can just use `gprof` or `perf` instead |
21:55:08 | shashlick | @arnetheduck: can you use them on Windows? |
21:55:42 | FromGitter | <arnetheduck> I'd assume so, yes.. `gprof` at least, assuming you're compiling with `gcc` |
21:57:31 | FromGitter | <arnetheduck> or just go with any c profiler from the list: https://stackoverflow.com/questions/67554/whats-the-best-free-c-profiler-for-windows |
21:59:24 | * | eduarch joined #nim |
22:00:35 | * | eduarch quit (Remote host closed the connection) |
22:01:32 | * | Jesin quit (Quit: Leaving) |
22:03:24 | FromDiscord_ | <j$> |
22:03:24 | FromDiscord_ | <j$> https://cdn.discordapp.com/attachments/371759389889003532/519272466921816064/unknown.png |
22:03:38 | FromDiscord_ | <j$> has any one encountered this before? |
22:04:35 | xace | yes, I forgot what I did about it though |
22:05:48 | FromDiscord_ | <j$> darn |
22:05:55 | xace | iirc in my case it had to do with a old version of nim running |
22:06:26 | xace | that nimble was running on newer tech than the nim that was installed in $PATH |
22:07:06 | FromDiscord_ | <j$> well I installed nim today |
22:08:15 | xace | see if: nimble --version && nim --version |
22:08:55 | xace | should be v0.9.0 and v.0.19.0 respectively |
22:08:56 | FromDiscord_ | <j$> nimble v0.9 and nim v0.19 |
22:09:02 | * | stefanos82 quit (Remote host closed the connection) |
22:10:48 | FromDiscord_ | <j$> do I need python2 installed? |
22:13:09 | xace | python isn't required by nim... https://forum.nim-lang.org/t/1011 # not sure if this is relevant in your case |
22:14:06 | xace | does `nimble --refresh --debug` show anything more that could be relevant? |
22:14:25 | FromGitter | <zacharycarter> valgrind's memcheck just doesn't seem to work at all well on osx |
22:14:36 | FromGitter | <zacharycarter> even when using gcc as the compiler |
22:15:00 | * | Jesin joined #nim |
22:15:06 | shashlick | what is a double in nim, and what about uchar |
22:17:11 | FromGitter | <zacharycarter> `float64` = `double` in C |
22:17:21 | xace | shashlick: im guessing it depends on which architecthure you compile for, but it's going to be bigger or equal to a float... |
22:17:32 | FromGitter | <zacharycarter> https://nim-lang.org/docs/system.html#cuchar |
22:19:07 | FromGitter | <zacharycarter> which = `char` in Nim |
22:19:26 | FromGitter | <zacharycarter> https://github.com/nim-lang/Nim/blob/ab38c075f8864a8ddc129e3a4490f11f48d79d38/lib/system.nim#L1765 & https://github.com/nim-lang/Nim/blob/ab38c075f8864a8ddc129e3a4490f11f48d79d38/lib/system.nim#L1771 |
22:21:11 | shashlick | N I F T |
22:21:26 | FromGitter | <timotheecour> @Araq ⏎ ⏎ > I never saw "encodeType: tyForward", what small program triggers it? ⏎ ⏎ sorry what’s the context where I would’ve mentioned that? [https://gitter.im/nim-lang/Nim?at=5c05ac6643c68b3727f5c0f9] |
22:22:05 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
22:32:14 | * | craigger_ joined #nim |
22:33:43 | * | craigger quit (Ping timeout: 246 seconds) |
22:38:04 | * | PMunch quit (Remote host closed the connection) |
22:41:25 | * | shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:44:21 | * | shpx joined #nim |
22:53:45 | Araq | timotheecour --incremental:on |
22:57:24 | FromGitter | <timotheecour> oh i see, it was in gitter (https://gitter.im/nim-lang/Nim?at=5bf5bb03c6cf4524d156c276) ; IIRC that might’ve happened when I had a dirty nimcache; if it ever happens again I’ll file a github issue; for now good to ignore |
22:57:54 | Araq | well that bug can't be caused by nimcache |
22:58:11 | Araq | but since then I fixed plenty of bugs with --incremental:on, so ok |
22:58:16 | FromGitter | <timotheecour> ok |
22:58:29 | FromGitter | <timotheecour> 1 question though, right now there’s no efficiency gains right? last I checked, —incremental:on gave slowdowns |
22:58:55 | Araq | that's what I'm trying to figure out |
22:59:09 | Araq | well, yes, you right. currently it makes things worse |
22:59:50 | Araq | which is "almost" impossible, how can reading from a db be slower than building the AST via semcheck and overload resolution... |
23:01:10 | FromGitter | <timotheecour> ok; what about caching? seems to me nim could be smart about figuring out avoiding to re-process (either codegen or parsing) a nim file (or generated c file), assuming compiler options are identical (part of the hash) and file is same (using a 2 step strategy: 1st, lastModificationTime, then, use md5hash to be robust to `git checkout branch`) |
23:01:39 | Araq | that is what I implemented |
23:02:10 | Araq | except that I skip the lastModificationTime step, never found it reliable on Posix's time resolution |
23:02:48 | Araq | and I'll compute 2 checksums eventually. once for the interface part of a module, one for the full file contents |
23:03:20 | Araq | clients of a module don't have to be recompiled if the interface hasn't changed |
23:04:27 | FromGitter | <timotheecour> r u also hashing compiler options (including implicit ones from config files) so any change in these will pickup the right cached data or recompute |
23:04:29 | FromGitter | <timotheecour> ? |
23:04:52 | * | shpx quit (Quit: Textual IRC Client: www.textualapp.com) |
23:05:34 | Araq | yeah, I do |
23:07:01 | Araq | but I'm a bit lost. plenty of stuff is unimplemented but loading the freaking ASTs from DB should be faster than lexing+parsing+sem'check |
23:07:21 | FromGitter | <timotheecour> cool; regarding performance, could a memcached frontend help ? eg: https://stackoverflow.com/questions/3084789/memcached-vs-sql-server-cache |
23:07:43 | Araq | have to profile it properly |
23:08:04 | * | endragor joined #nim |
23:08:14 | FromGitter | <timotheecour> ya obviously having a good idea of where time is spent is needed before any optimization… |
23:08:18 | Araq | but since --incremental:writeOnly (fill the DB) is faster than --incremental:readonly (read from the cache) |
23:08:38 | Araq | it implies to me that sqlite is not the bottleneck. unless writing in sqlite is faster than lookups |
23:09:12 | FromGitter | <timotheecour> U mean slower ? |
23:09:29 | Araq | no, as I wrote it |
23:10:46 | Araq | but we also perform millions of BTree lookups |
23:11:07 | FromGitter | <timotheecour> how about for debugging adding —incremental:off_but_still_write_to_sqlite |
23:11:21 | Araq | that is --incremental:writeOnly |
23:11:56 | FromGitter | <timotheecour> likewise with —incremental:off_but_still_read_from_sqlite_and_discard_result |
23:12:06 | Araq | that is --incremental:readOnly |
23:12:13 | FromGitter | <timotheecour> Lol ok... |
23:12:16 | Araq | well no |
23:12:22 | Araq | readOnly means "read and use it" |
23:12:27 | * | endragor quit (Ping timeout: 246 seconds) |
23:12:44 | Araq | anyhow, writing costs us rougly 4s. reading 8s. |
23:13:20 | Araq | the DB is 33MB in size |
23:13:44 | Araq | and yeah, mongo or arangodb will probably be faster |
23:13:55 | Araq | or memcache. |
23:14:20 | Araq | but as long as reading is more expensive than writing there are other problems IMO |
23:14:21 | FromGitter | <timotheecour> > it implies to me that sqlite is not the bottleneck. unless writing in sqlite is faster than lookups ⏎ ⏎ wait, is that conclusion correct? eg what if u have many more lookups than writes? maybe sqlite access still is a bottleneck after all? |
23:14:47 | Araq | I only have a lookup if my own memory caching fails |
23:14:57 | Araq | which I do with BTrees |
23:15:13 | Araq | which might not be as good as I like |
23:15:44 | FromGitter | <timotheecour> Get we add a perfromance counter (for each read, and each write) using getTicks (highest precision counter; shd be enough resolution) |
23:17:27 | FromGitter | <timotheecour> (and each Btree lookup too; generating for eg 3 counters) |
23:19:45 | Araq | sure, will do that tomorrow |
23:21:40 | FromGitter | <timotheecour> another application of —incremental would be a real repl (unlike inim which recompiles all code), based on compile+dlopen the added line |
23:22:53 | FromGitter | <timotheecour> meanwhile https://github.com/nim-lang/Nim/pull/9846 is green. :) |
23:27:18 | FromGitter | <zacharycarter> @timotheecour - not sure if you've seen this or not, but - https://github.com/nim-lang/Nim/issues/8927 |
23:27:30 | FromGitter | <zacharycarter> RE: Nim having a proper REPL |
23:28:06 | FromGitter | <timotheecour> i have, but I have no idea what would be ETA for something usable |
23:28:13 | * | elrood quit (Remote host closed the connection) |
23:28:21 | FromGitter | <zacharycarter> well |
23:28:35 | FromGitter | <zacharycarter> from my understanding, the grant needs to be completed by a certain date |
23:28:39 | FromGitter | <zacharycarter> and I think that's sometime in Feb or March? |
23:29:04 | FromGitter | <zacharycarter> `Oct 2018 - Feb 2019` is what the issue says |
23:29:36 | FromGitter | <timotheecour> I’ve tried the dlopen approach (in D) and it worked quite well, so dlopen-based approach could be used in meantime (and parts of it could be replaced once that grant proposal approach is completed) |
23:29:39 | FromGitter | <zacharycarter> so I imagine - sometime b/w now and Feb of 2019 we'll have hot code reloading available to us |
23:30:13 | FromGitter | <zacharycarter> well - there have already been experiments with dlopen / hot reloading Nim code |
23:30:13 | FromGitter | <timotheecour> hot code reloading being only a part of what a REPL has to do |
23:30:21 | FromGitter | <zacharycarter> sure - but it's the first step |
23:30:38 | FromGitter | <zacharycarter> I don't think dlopen alone - is going to get you to where you need to be to make a repl work |
23:30:42 | FromGitter | <timotheecour> (thinking Matlab-like interface, with access to variables in top-level scope etc) |
23:30:50 | FromGitter | <zacharycarter> you have to deal with state |
23:31:13 | FromGitter | <zacharycarter> and you have to also deal with https://nim-lang.org/docs/nimc.html#dll-generation |
23:32:15 | FromGitter | <zacharycarter> and there are a ton of other complexities I don't have enough understanding about - to fully explain why it's more difficult than just slapping dlopen onto your existing solution |
23:32:41 | FromGitter | <zacharycarter> sorry if you already know all of this already - I think you probably do more C/C++ programming than I do |
23:34:06 | FromGitter | <timotheecour> at least in D I was able to work out something quite usable; in Nim a difference is thread-local GC but I don’t see it as a blocker; eager to try |
23:34:27 | FromGitter | <zacharycarter> I'd love to play around with whatever you come up with |
23:34:54 | FromGitter | <zacharycarter> this is where I started with the whole thing - https://16bpp.net/page/hot-loading-code-in-nim - but that falls apart as soon as you need to handle state |
23:35:16 | FromGitter | <zacharycarter> and I spoke with Araq about going further - and he brought up the nimrtl thing |
23:35:32 | FromGitter | <zacharycarter> and that's when I was like - well I'm out of my wheelhouse now and someone else can probably figure this out faster than I could potentially |
23:36:03 | FromGitter | <zacharycarter> tbh - i'm more excited about hot code reloading than a repl |
23:36:20 | FromGitter | <zacharycarter> being able to use Nim as a scripting language inside another Nim process - sounds very appealing |
23:36:43 | FromGitter | <timotheecour> Well ya, hot code reloading can be used in lots of places indeed |
23:52:51 | FromGitter | <yyyc514> with about 20 lines of code i was able to create a dynamic newInstance() that allows you to make any instances previously registered with it |
23:53:10 | FromGitter | <yyyc514> to make working with dynamic object dispatch easier |
23:56:01 | FromGitter | <yyyc514> works for my use case at least |