00:03:52 | zachcarter | working with a different architecture on the game engine this time |
00:04:17 | zachcarter | going with a dod oriented design - going to allow the engine to run in a server mode where you can register different data compilers with the server |
00:04:50 | zachcarter | or you can just run the engine in standalone mode and it will compile the resources locally |
00:05:44 | zachcarter | game code - for instance - will be a data resource that needs to be compiled |
00:06:26 | zachcarter | but I think this should lead to an architecture where A) potentially people can work on the same project simultaneously |
00:07:34 | zachcarter | B) incremental compilation for the project |
00:07:40 | zachcarter | and C) potential for hot swapping compiled resources |
00:07:56 | zachcarter | also - if there's a more efficient data layout for a compiled resource, there's control over that as well |
00:15:58 | * | dom96_w joined #nim |
00:18:55 | FromGitter | <zetashift> Did you get bgfx working? |
00:24:24 | * | gangstacat quit (Ping timeout: 252 seconds) |
00:24:57 | zachcarter | not yet |
00:25:06 | zachcarter | I'm far away from needing gfx though |
00:25:13 | zachcarter | working on plumbing at ths point |
00:26:07 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:29:48 | dom96 | shashlick: Why don't you just let the build crash for nimzbar on macOS? |
00:30:18 | dom96 | or better yet, raise the error in your .nim file |
00:30:28 | dom96 | it will work much better, Nimble doesn't have output integrated yet |
00:36:44 | zachcarter | shashlick: I plan on trying bullet3 after bgfx |
00:36:51 | zachcarter | I want bullet3 for this engine |
00:37:23 | zachcarter | I already have the perfect repo name for it |
00:37:41 | zachcarter | https://github.com/zacharycarter/casing |
00:37:42 | zachcarter | :P |
00:38:42 | * | gangstacat joined #nim |
00:45:40 | zachcarter | don't understand why bullet3 has to be the most complicated project in existence |
00:45:47 | zachcarter | but either way it will be fun to wrap |
00:51:52 | shashlick | dom96: okay i'll change it into a raise |
00:52:20 | shashlick | zachcarter: sounds cool 🙂 |
01:05:15 | zachcarter | shashlick: hopefully the design of the engine works out better than it has previously |
01:05:58 | * | theelous3_ quit (Ping timeout: 244 seconds) |
01:06:00 | zachcarter | my goal is to end up with something that allows for a more iterative design process - although I have a feeling advancements in the language will help this realization along as well |
01:11:50 | zachcarter | I have a naive question - I understand today, it's possible to write GC-free code |
01:12:11 | zachcarter | but you won't be able to use a LOT of the stdlid |
01:12:53 | zachcarter | there is the new runtime in the works - which is going to provide for the possibility of RAII, ownership semantics and a borrow checking feature |
01:13:38 | zachcarter | where does this put us though - in terms of stdlib usage? can I write custom allocators and if I want to use sockets let's say - is it going to be possible to use the higher level stdlib modules? |
01:14:40 | zachcarter | apologies if alot of ^ doesn't make sense - I'm learning computer science backwards and trying to understand all of these concepts at once |
01:14:59 | zachcarter | but if I'm not mistaken - there are allocators that Nim already has which work with the GC |
01:16:38 | zachcarter | and if someone wants to supply their own custom allocator - if that's even a|going to be a thing - how does that work if the object has a field of a something that is allocated by a stdlib module - like a AsyncSocket for example? |
01:23:01 | * | zachk quit (Quit: Leaving) |
01:25:07 | * | rauss joined #nim |
01:32:00 | * | rauss quit (Quit: WeeChat 2.3) |
01:36:02 | zachcarter | I think - https://github.com/nim-lang/Nim/wiki/Destructors - explains what I was asking |
01:45:25 | FromGitter | <rayman22201> As far as I understand it, destructors are basically done and implemented: https://github.com/nim-lang/Nim/issues/7041 ⏎ but you have three problems that are going to cause a lot of work for you: ⏎ ⏎ 1) ) The stdlib is going to be a crap shoot until it gets fully ported over to the new runtime. ⏎ 2) ) Other than the wiki and Araq's blog on destructors, there isn't much docs on it, so you are really on your |
01:45:25 | FromGitter | ... own figuring out all the sharp edges. ... [https://gitter.im/nim-lang/Nim?at=5bf60a34e25cc2740522f9ba] |
02:46:06 | * | dddddd quit (Remote host closed the connection) |
02:48:57 | zachcarter | thanks rayman22201 |
02:50:13 | zachcarter | this all as me wondering whether or not I'd be better off just using Nim for gameplay code |
02:50:18 | zachcarter | and writing the core of the engine in C++ |
02:51:09 | zachcarter | could also use Nim for any code where a GC wouldn't present problems |
02:51:25 | zachcarter | I'll keep going with Nim though until I find a reason that it's really becoming problematic |
02:56:46 | leorize | anyone got experience with sharing GC-ed memory between threads? |
02:57:06 | zachcarter | leorize: you need to use channels |
02:57:20 | zachcarter | or allocate on the shared heap using createSharedU |
02:57:30 | leorize | that won't work for string :/ |
02:57:33 | leorize | but channel might |
02:58:25 | leorize | new runtime would make this much easier... |
02:58:47 | zachcarter | yes - I have a feeling the majority of the community shares that sentiment right now |
02:59:02 | zachcarter | but I also think it is what it is - going to be ready when it can be |
03:05:43 | * | banc quit (Quit: ZNC - http://znc.in) |
03:21:34 | * | banc joined #nim |
03:24:11 | FromGitter | <rayman22201> lol. Yes. we all want the new runtime. But like a good pie, you can't rush it out of the oven :-P |
03:24:54 | FromGitter | <rayman22201> Holiday season in the U.S. is putting food on my mind lol |
03:32:23 | FromGitter | <rayman22201> Honestly, for your usecase @zachcarter, I still think gc:regions would be perfect. It lacks documentation but I think it's pretty stable??? |
03:45:23 | zachcarter | I don't know |
03:45:28 | zachcarter | I'm actually thinking of just going gc none |
03:45:32 | zachcarter | and starting from scratch |
03:45:43 | zachcarter | I think this actually might be my best option |
03:53:16 | zachcarter | rayman2201:looking into regions now |
03:57:29 | zachcarter | I just read through - https://www.stephanboyer.com/post/60/region-based-memory-management - yes this sounds ideal |
03:57:53 | zachcarter | assuming I can supply custom allocators with gc regions |
04:04:04 | zachcarter | yeah - thanks rayman2201: should have just listened earlier to you haha - this looks perfect |
04:04:13 | zachcarter | https://github.com/nim-lang/Nim/blob/master/lib/system/gc_regions.nim - I mean |
04:05:04 | zachcarter | probably didn't understand a lot of these concepts before either in my defense - but now that I do - this seems very suitable |
04:52:19 | * | nsf joined #nim |
04:54:24 | FromGitter | <rayman22201> Cool! Glad it's working for you. |
04:55:23 | FromGitter | <rayman22201> Also. Neat article on regions. I don't think I've seen that one before! |
05:19:58 | * | kapil____ joined #nim |
05:46:52 | FromGitter | <AchalaSB> Is any package is required to support the Nim code in webassembly? If yes is there any package? |
05:56:44 | leorize | I don't think so |
07:03:12 | * | mech422__ quit (Ping timeout: 268 seconds) |
07:09:30 | * | shashlick_ quit (Ping timeout: 272 seconds) |
07:10:27 | * | mech422 joined #nim |
07:19:45 | * | mech422_ joined #nim |
07:24:11 | * | mech422 quit (Ping timeout: 268 seconds) |
07:43:31 | * | krux02 joined #nim |
08:05:56 | * | leorize quit (Quit: WeeChat 2.3) |
08:16:48 | FromGitter | <m4d3bug> Does smtp.nim support html by setting Content-Type? |
08:17:01 | FromGitter | <m4d3bug> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bf665fd6621313894fcee7c] |
08:17:32 | FromGitter | <m4d3bug> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bf6661ca115c91ef773dffb] |
08:18:14 | FromGitter | <m4d3bug> (https://files.gitter.im/nim-lang/Nim/MhTk/image.png) |
08:18:47 | FromGitter | <m4d3bug> Add this for attachment,doesn't work too |
08:18:54 | FromGitter | <m4d3bug> "Content-Disposition": "attachment; filename=xxxx.xls" |
08:19:08 | FromGitter | <m4d3bug> ```"Content-Disposition": "attachment; filename=xxxx.xls"``` |
08:24:31 | * | jjido joined #nim |
08:28:03 | FromGitter | <gogolxdong> hmac_sha256 of nimSHA2 doesn't generate the same SHA256 digest with the Go's or anyone knows how to? Because nimSHA2's takes string parameters while Go's takes seq[byte] |
08:33:51 | * | jjido quit (Ping timeout: 260 seconds) |
08:43:50 | * | stefanos82 joined #nim |
08:44:54 | * | jacereda joined #nim |
08:46:59 | * | Pisuke joined #nim |
08:47:25 | * | MyMind quit (Ping timeout: 268 seconds) |
08:48:03 | * | jjido joined #nim |
08:56:14 | * | floppydh joined #nim |
08:57:30 | * | leorize joined #nim |
08:58:02 | FromGitter | <mratsim> You can use nimcrypto hmac: https://github.com/cheatfate/nimcrypto/blob/master/nimcrypto/hmac.nim#L222 |
08:58:16 | * | vlad1777d quit (Ping timeout: 246 seconds) |
08:59:04 | * | vlad1777d joined #nim |
08:59:33 | * | jjido quit (Remote host closed the connection) |
09:02:59 | FromGitter | <gogolxdong> oh, thanks, trying. |
09:05:24 | FromGitter | <gogolxdong> It implements HKDF? |
09:09:16 | * | PMunch joined #nim |
09:12:15 | FromGitter | <mratsim> pbkdf2 |
09:12:36 | FromGitter | <mratsim> impl is here: https://github.com/cheatfate/nimcrypto/blob/master/nimcrypto/pbkdf2.nim |
09:13:18 | FromGitter | <gogolxdong> yes, I noticed that, I'm trying to implement HKDF. Don't know what the difference. |
09:14:08 | FromGitter | <mratsim> in the future we might implement scrypt but no plan for hkdf so PR welcome ;) |
09:14:55 | FromGitter | <gogolxdong> result of sha256.hmac also doesn't match the one of nimSHA2 , what should I do. |
09:15:17 | FromGitter | <mratsim> nimSHA2 may have an issue then |
09:16:07 | FromGitter | <mratsim> nimcrypto is tested and I used Ethereum HMAC test vectors from here: https://github.com/ethereum/eth-keyfile |
09:16:40 | FromGitter | <mratsim> the test vectors are here: https://github.com/cheatfate/nimcrypto/blob/master/tests/testhmac.nim#L69 |
09:18:09 | FromGitter | <mratsim> note that you can cast a `seq[byte]` to `string` as they have the same underlying representation (including GC) to avoid potential conversion issue |
09:27:09 | FromGitter | <gogolxdong> how ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bf6766d6621313894fd5242] |
09:27:53 | FromGitter | <gogolxdong> it's the reverse of casting "hello world" to seq[byte]. |
09:29:08 | FromGitter | <gogolxdong> identical conversion. |
09:31:16 | FromGitter | <narimiran> @gogolxdong it prints "llo world" on my end |
09:31:27 | FromGitter | <gogolxdong> me too |
09:31:56 | leorize | `cast` the entire seq |
09:32:01 | leorize | not the first element |
09:32:04 | leorize | and it'll work |
09:32:31 | FromGitter | <gogolxdong> It doesn't. |
09:33:57 | FromGitter | <gogolxdong> It's `l l o w o r l d` exactly. With 7 spaces between each letter. |
09:34:07 | leorize | https://ptpb.pw/0bNK/nim |
09:34:55 | FromGitter | <gogolxdong> 'u8 |
09:35:05 | FromGitter | <gogolxdong> is the key. |
09:36:15 | leorize | also, you'll have to cast the entire seq |
09:36:34 | leorize | got "out of memory" if you just cast the address of the first element |
09:36:51 | FromGitter | <gogolxdong> sure, this is significant. |
09:37:25 | leorize | I'm not sure if this "hack" continues to work with string and seq v2, so I usually avoids it |
09:37:49 | FromGitter | <gogolxdong> also it's the same result with Go's uses 'u8 denotation. |
09:38:13 | FromGitter | <gogolxdong> when will the v2 come out. |
09:38:50 | leorize | once Araq makes it works |
09:39:02 | FromGitter | <gogolxdong> sounds soon |
09:39:21 | leorize | currently `--gc:destructors` (which employ these newer strings and seqs) works for a simple "Hello, world!" |
09:40:18 | leorize | it's a no go when more complex code is involved however |
09:40:20 | FromGitter | <gogolxdong> does gc:destructors mean scope collected? |
09:40:52 | leorize | only Araq knows :P |
09:44:47 | FromGitter | <gogolxdong> We have to refactor our production code when destructors come out. |
09:48:03 | FromGitter | <gogolxdong> but it's also close to release 1.0 and stable before Nim v2 |
09:49:59 | leorize | fyi, here's the roadmap https://github.com/nim-lang/Nim/issues/7041 |
09:51:27 | * | vlad1777d quit (Ping timeout: 250 seconds) |
09:52:18 | * | vlad1777d joined #nim |
09:52:25 | FromGitter | <gogolxdong> Sure. |
09:52:42 | * | jjido joined #nim |
09:53:19 | Araq | leorize, casting between seqs and strings is still possible with the destructor based runtime |
09:55:00 | FromGitter | <gogolxdong> haha, it's of great convenience. |
09:55:17 | leorize | Araq: are we gonna get some kind of "official" support for that? |
09:56:32 | leorize | if `cast`ing between `seq[byte]` and `string` happens a lot, then would it make sense to introduce support for it in the spec? |
09:58:44 | * | Sentreen joined #nim |
10:01:17 | FromGitter | <gogolxdong> > AFAIK, there is no significant difference between HKDF and single-iteration PBKDF2 in practice. Both effectively achieve the goal of expanding the input key to a potentially longer sequence of derived keys, in a way that does not allow the original input key to be efficiently recovered from the derived keys. |
10:01:34 | * | kapil____ quit (Remote host closed the connection) |
10:02:12 | jacereda | Araq: do you have any comment on https://github.com/nim-lang/Nim/issues/3629#issuecomment-440953864 ? I badly want that feature and I'm willing to attempt an implementation of your proposal or mine |
10:03:27 | FromGitter | <gogolxdong> it's * in practice, wonder * in theory . |
10:05:50 | Araq | leorize, well we better have some system.toByteSeq or similar |
10:06:26 | Araq | doesn't seem particularly future-proof to allow the cast for good |
10:06:39 | Araq | (what if we map string to std::string in C++ interop mode?) |
10:07:17 | FromGitter | <tim-st> Araq: then seq[char] would be mapped too to this type |
10:08:50 | * | dom96_w joined #nim |
10:09:11 | Araq | tim-st: huh? std::string is not std::vector<char> |
10:09:59 | Araq | don't ruin the "perfect" C++ interop that in theory we can get/strive for |
10:10:33 | FromGitter | <tim-st> I mean these types are always the same it shouldnt matter if it is matched to string or vector |
10:10:55 | Araq | jacereda, well I like my syntax better, so if you want to implement it, please support mine :-) |
10:11:30 | Araq | however |
10:11:49 | Araq | alternatively you can implement 'if' in objects :-) |
10:12:07 | FromGitter | <tim-st> I think this one is the best: https://github.com/nim-lang/Nim/issues/3629#issue-120833923 |
10:12:25 | FromGitter | <tim-st> it's what i tried at very first when I didnt know it doesnt work |
10:12:38 | Araq | tim-st: It is not clear to me what it means |
10:12:54 | leorize | it just look silly tbh... |
10:13:27 | FromGitter | <tim-st> you mean regarding string? |
10:13:32 | Araq | this feature should not be optimized for "looks good", it needs to be obvious what it means |
10:13:56 | Araq | and it needs to acknowledge that Nim is not Rust/ML/Haskell |
10:14:07 | FromGitter | <tim-st> exactly, and thus I wrote that my first assumption was that it should work |
10:14:11 | jacereda | Araq: any previous issue requesting `if` for objects? |
10:14:23 | Araq | we have the unprotected field accesses and need to live with them for the time being |
10:15:09 | Araq | jacereda, well it would be |
10:15:13 | Araq | object |
10:15:20 | Araq | kind: MyEnum |
10:15:27 | Araq | if kind in {a, b, c}: |
10:15:32 | Araq | fieldA: string |
10:15:41 | Araq | if kind in {a, b}: |
10:15:48 | Araq | fieldB, etc: int |
10:15:59 | FromGitter | <tim-st> I think `when` would make more sense than `if` |
10:16:14 | Araq | no 'when' in object already exist and has a different meaning |
10:16:14 | * | dom96_w quit (Read error: Connection reset by peer) |
10:16:15 | leorize | `when` is strictly compile time in Nim's grammar afaik |
10:16:31 | Araq | and it is a runtime decision so the 'if' is correct |
10:16:45 | FromGitter | <tim-st> well, the definition is compile time but the value is runtime |
10:16:59 | leorize | but that condition is evaluated in runtime |
10:17:24 | Araq | it's all at runtime. |
10:17:25 | jacereda | Araq: `case` compiles down to a `switch`, this `if` would just compile a C `if`, right? |
10:17:51 | Araq | probably but it doesn't matter |
10:18:06 | FromGitter | <tim-st> ok, I thought the compiler calculates at compile time the minimum needed size for the type |
10:18:06 | Araq | the harder problem is how to map it C's unions |
10:18:35 | Araq | tim-st: That is true but it still has plenty of runtime aspects |
10:19:43 | leorize | Araq: how should `system.toByteSeq` be implemented? I doubt anything out there can rival `cast[seq[byte]]` in speed |
10:21:13 | Araq | well it would use the cast in the implementation |
10:21:35 | jacereda | Araq: understood, I'll give it another thought |
10:21:58 | Araq | template toByteSeq(x: string): seq[byte] = cast[seq[byte]](x) |
10:22:11 | FromGitter | <mratsim> I would like people to stop using string for binary blob ... |
10:22:50 | * | kapil____ joined #nim |
10:23:00 | Araq | mratsim, yeah, but that's hard and originally I thougth there shouldn't be a difference |
10:23:36 | FromGitter | <mratsim> the main issue is that when you do {.deprecated.} on an overloaded proc, you get it on all overloads :/ |
10:24:23 | * | pigmej_ quit (Ping timeout: 276 seconds) |
10:24:25 | Araq | that's a bug |
10:24:28 | Araq | easy to fix |
10:24:31 | FromGitter | <mratsim> ah, I’m confusing with this: https://github.com/nim-lang/Nim/issues/6436 |
10:25:35 | FromGitter | <mratsim> but I guess a trnsition start with that and adding seq\[byte\] to the NEP-1 |
10:27:19 | FromGitter | <mratsim> and this might be useful in the stdlib as well: https://github.com/status-im/nim-byteutils/blob/master/byteutils.nim |
10:41:22 | Araq | meh, the new Nim is more about "what we lack cannot be broken" |
10:45:58 | FromGitter | <mratsim> #brainfuck |
10:46:16 | * | dddddd joined #nim |
10:59:12 | FromGitter | <alehander42> https://github.com/nim-lang/Nim/issues/3629#issue-120833923 is absolutely the best syntax imo |
10:59:24 | FromGitter | <alehander42> i totally don't get this "where is this field shared" thing |
10:59:30 | FromGitter | <alehander42> 90% of the time i care about |
10:59:36 | FromGitter | <alehander42> which fields does this kind have |
11:00:37 | Araq | so read it again, I don't understand how you can not understand it |
11:01:20 | FromGitter | <alehander42> i understand it, I just don't get how is this a more common usecase |
11:01:48 | FromGitter | <alehander42> I almost never ask myself "where is this field" shared, because usually I know the current `kind` value |
11:02:08 | Araq | I don't want to repeat myself |
11:03:01 | Araq | yglukhov[m], ping |
11:03:21 | FromGitter | <yglukhov> hey |
11:03:36 | Araq | I'm looking at https://github.com/nim-lang/Nim/issues/9716#issuecomment-440444324 |
11:04:11 | Araq | and I wonder ... since we transform it into a state machine with explicit frames on the heap that are linked |
11:04:35 | FromGitter | <alehander42> Araq, well every other language with adt-s defines the fields together with the discriminator |
11:04:43 | FromGitter | <alehander42> it's not such a unique opinion |
11:04:57 | Araq | could it be that every new loop iteration causes a new frame to be allocated and linked? |
11:05:13 | Araq | then the GC has no chance and it leaks until the loop ends (which is way too late) |
11:05:26 | FromGitter | <alehander42> but nvm, I also agree that the other design would do, one can write a macro around that |
11:06:01 | Araq | alehander42, yes, I know how ML works, thanks. Nim doesn't work like this. |
11:07:37 | FromGitter | <alehander42> ok, if you agree on the other design, let jacereda do it, people like me can use a macro on top of it, everybody is happy |
11:07:44 | FromGitter | <yglukhov> Araq: oh my. there's a lot of text there. what should i focus on? :) |
11:07:56 | FromGitter | <alehander42> (the nim-ish design) |
11:10:02 | Araq | wrong link, try https://github.com/nim-lang/Nim/issues/9716#issuecomment-440399661 |
11:11:19 | * | Vladar joined #nim |
11:12:20 | Araq | the downloaded file is about 1MB |
11:12:41 | Araq | and so the memory should never grow beyond, let's say, 8 MB |
11:14:29 | FromGitter | <yglukhov> Araq: well loops shouldn't be a problem, because env fields are eventually overwritten as iterations go, so the old ones should no longer be referenced. I recall there was a bug in our server that it leaked GBs of mem in 64bit mode, but in 32bits it never exceeded a few hundred mb. That was some time ago, and we switched to 32bit, and never revisited since. |
11:15:30 | FromGitter | <yglukhov> do you agree about "loops shouldnt be a problem" part? |
11:15:53 | FromGitter | <yglukhov> anyway, i'll have a look at this. |
11:18:03 | Araq | I agree that in theory there is no problem |
11:18:17 | Araq | in practice it would explain exactly the behaviour I'm seeing |
11:20:09 | FromGitter | <yglukhov> well currently i can't imagine how that could happen. i mean what kind of codegen could lead to the "loops" problem. |
11:20:34 | FromGitter | <yglukhov> but i can reproduce the issue. thats good already. |
11:22:23 | Araq | this runForever() after the asyncCheck(test(url)) escapes me already |
11:22:35 | Araq | no idea how this works |
11:22:50 | Araq | ah nvm |
11:24:47 | Araq | no, I don't get it |
11:26:12 | FromGitter | <yglukhov> why? that's perfectly normal way of using it :) |
11:26:31 | * | dom96_w joined #nim |
11:26:46 | Araq | well runForever never stops |
11:26:54 | FromGitter | <yglukhov> true |
11:26:56 | Araq | what if I wanna make 5 downloads and then stop? |
11:27:03 | Araq | drain() doesn't work either |
11:27:11 | FromGitter | <yglukhov> then you don't use runForever =) |
11:27:51 | Araq | ok, waitFor it is |
11:28:09 | * | dom96_w quit (Changing host) |
11:28:09 | * | dom96_w joined #nim |
11:28:42 | FromGitter | <yglukhov> actually maybe runForefer will return/raise when there's nothing to poll, i don't remember exactly. |
11:28:58 | dom96_w | At a hackathon today, hopefully will add support for Nim to FB's build system Buck :) |
11:29:35 | Araq | let url = "https://jsonplaceholder.typicode.com/photos" |
11:29:35 | Araq | waitFor(test(url)) |
11:29:35 | Araq | GC_fullcollect() |
11:29:35 | Araq | echo formatSize getOccupiedMem() |
11:29:39 | * | kklas joined #nim |
11:29:52 | Araq | it's like I say, after the loop the GC can free the memory |
11:30:51 | dom96_w | Are you debugging async mem leaks? |
11:30:56 | Araq | yup |
11:31:16 | Araq | finally have something we all can reproduce |
11:31:32 | dom96_w | Awesome |
11:32:45 | dom96_w | If you want to make 5 downloads why don't you add a counter var? |
11:33:13 | dom96_w | It's not like poll() is equivalent to one download |
11:33:25 | Araq | I have a counter var |
11:33:35 | Araq | and I now understand the program, everything is fine |
11:33:53 | Araq | so ... from the GC's perspective it is a logical memory leak |
11:34:06 | dom96_w | link to the code? |
11:34:18 | Araq | https://github.com/nim-lang/Nim/issues/9716#issuecomment-440399661 |
11:35:28 | * | theelous3 joined #nim |
11:35:46 | * | theelous3 quit (Changing host) |
11:35:46 | * | theelous3 joined #nim |
11:39:11 | dom96_w | so where is the leak? |
11:39:43 | Araq | my hypothesis is in the closure iterator transformation |
11:40:28 | dom96_w | I'm curious how you came to the conclusion that from GC's perspective it's a logical leak |
11:40:44 | Araq | because the GC can free the memory after the loop |
11:41:03 | Araq | the loop runs for 10_000 iterations though and so that's way too late |
11:41:27 | Araq | it feels like every loop iteration keeps the data of the previous iterations alive |
11:42:01 | Araq | if it were a GC leak, the GC would never free it. |
11:42:37 | Araq | but it does, as soon as 'start' returns |
11:44:16 | * | theelous3 quit (Remote host closed the connection) |
11:44:17 | Araq | and now I'm getting a nice crash in asyncnet.nim line 221 |
11:44:44 | * | theelous3 joined #nim |
11:45:21 | dom96_w | Yeah. so it seems the GC isn't optimised for long running procedures |
11:45:50 | Araq | "optimised for"? it's not a GC problem, it's a codegen bug |
11:46:06 | Araq | well IMO, I could be wrong of course |
11:46:44 | Araq | but now appeaseSsl crashes, any idea why? |
11:48:49 | dom96_w | what error? |
11:49:10 | Araq | asyncnet.nim(221) appeaseSslIter |
11:49:10 | Araq | SIGSEGV: Illegal storage access. |
11:49:37 | dom96_w | weird, can you reproduce it? |
11:49:45 | dom96_w | Did you change something that could have caused this? |
11:49:59 | Araq | no, but I'm likely misusing the API |
11:50:06 | Araq | writing a real bug report... |
11:52:16 | * | Vladar quit (Remote host closed the connection) |
11:52:43 | * | Vladar joined #nim |
11:53:39 | * | theelous3 quit (Ping timeout: 268 seconds) |
11:53:55 | Araq | https://github.com/nim-lang/Nim/issues/9785 |
12:07:19 | * | NimBot joined #nim |
12:07:39 | FromGitter | <yglukhov> Araq: found the problem |
12:08:06 | FromGitter | <yglukhov> it is codegen indeed. along with mem usage, log body.len :) |
12:09:39 | FromGitter | <yglukhov> however, i'm not sure how it worked before the new transformations... if it worked at all.. |
12:11:25 | FromGitter | <yglukhov> looks like a showstopper to me. |
12:11:51 | Araq | it's fair to assume it never worked properly |
12:11:56 | Araq | :D |
12:14:04 | FromGitter | <yglukhov> i can fix it if you tell me how to convert `let x` or `var x` to `pretendAsItIsDeclarationAndInit(x)` |
12:14:28 | Araq | well it's |
12:14:39 | Araq | var closureEnv.x |
12:15:07 | Araq | the old transformation did use that one |
12:15:41 | FromGitter | <yglukhov> oh really? interesting. ok ill try. |
12:24:29 | * | jjido quit (Remote host closed the connection) |
12:27:41 | * | theelous3_ joined #nim |
12:49:24 | FromGitter | <yglukhov> Araq: I've checked it and that's what the transformation currently does. `var :envP.a3: int`. So is it the backend issue then? |
12:52:43 | dom96_w | is install.sh in the release archives deprecated now? |
12:52:57 | dom96_w | wondering if I should use it or if I need to use `koch install` |
12:55:04 | * | Vladar quit (Read error: Connection reset by peer) |
12:55:31 | * | Vladar joined #nim |
12:59:06 | dom96_w | Araq ^ |
12:59:48 | dom96_w | `koch distrohelper` I guess |
13:00:07 | dom96_w | We should properly deprecate install.sh if it's truly obsolete |
13:00:17 | dom96_w | Which this suggests that it is https://github.com/nim-lang/Nim/issues/5912#issuecomment-305121774 |
13:03:21 | Araq | yglukhov[m], hmmm |
13:03:31 | Araq | probably but what does it mean? |
13:03:44 | Araq | that var env.foo = value is ignored? |
13:04:05 | Araq | dom96_w, yeah, we decided for installation into /usr/bin people should use their package managers |
13:04:31 | FromGitter | <yglukhov> Araq. no assignment is fine. it's just vars with type and no assignment |
13:04:44 | FromGitter | <yglukhov> `var s: string` |
13:05:25 | Araq | ah these need to be reset() ? |
13:05:33 | FromGitter | <yglukhov> yup |
13:06:25 | Araq | but then if the code does var buffer = "" the bug should disappear, right? |
13:06:32 | FromGitter | <yglukhov> yes |
13:07:19 | Araq | indeed |
13:07:23 | Araq | interesting |
13:07:38 | Araq | yeah ok, codegen bug, will add a [backport] |
13:07:53 | Araq | and hopefully we can release 0.19.2 this weekend |
13:08:07 | FromGitter | <yglukhov> cool. you'll take care of it? |
13:08:36 | Araq | yeah |
13:08:44 | FromGitter | <yglukhov> cool |
13:09:09 | Araq | dom96_w, that means only some async code is affected |
13:09:43 | dom96_w | Remind me to recompile NimForum with the fix |
13:09:46 | FromGitter | <yglukhov> Araq: i've added a test for this to tyieldintry. I can push it to a branch if you want. |
13:09:47 | dom96_w | I sorta doubt this was the cause though |
13:09:56 | Araq | yglukhov[m], yes please |
13:10:04 | dom96_w | I'm guessing this was introduced by yglukhov's changes to the iterators? |
13:10:05 | Araq | dom96_w, yeah, my point |
13:10:14 | Araq | no, it is an old codegen bug |
13:10:24 | Araq | 0.18 and prior should also be affected |
13:10:32 | federico3 | Araq: do you plan to generate csources etc for RISC-V as well? (see #7541) |
13:11:01 | federico3 | I can run tests if needed |
13:11:36 | Araq | federico3, I don't know, I run 'koch xz' |
13:11:55 | Araq | and it builds the C sources for what the config says |
13:12:03 | dom96_w | Araq: So I need to install these files into an install directory, what should I use `koch install`? right? |
13:12:30 | Araq | neither 'koch install' nor install.sh is really supported but I would go with install.sh |
13:13:06 | Araq | because you can easily skim over what it does |
13:14:14 | FromGitter | <yglukhov> Araq: done. branch yglukhov-test-9716 |
13:14:15 | zachcarter | rayman22201: one reason I think regions may not be what I need, and a gc-less approach is a better one to take, is the fragmentation that article mentions |
13:14:26 | zachcarter | or maybe it does |
13:15:01 | zachcarter | this wikipedia article states - programs that contain many sparse regions will exhibit internal fragmentation - https://en.wikipedia.org/wiki/Region-based_memory_management |
13:15:05 | zachcarter | that scares me a bit |
13:15:29 | Araq | IME Nim's allocator got really good at fighting fragmentation problems and it's usually something on top of alloc/dealloc that introduces problems |
13:15:39 | FromGitter | <mratsim> why don’t you allocate an big arena and slice chunks from it? |
13:15:48 | FromGitter | <mratsim> a* |
13:16:02 | zachcarter | I could try it |
13:16:38 | FromGitter | <yglukhov> maybe i should do it in a pr though... |
13:16:51 | zachcarter | I'm studying the foundation library from bitsquid - https://bitbucket.org/bitsquid/foundation |
13:17:28 | zachcarter | it features a number of different allocators |
13:18:31 | zachcarter | which I'm not sure I'd even need if I went with regions |
13:18:41 | zachcarter | but I'm also not sure whether or not these allocators do anything special |
13:18:52 | FromGitter | <mratsim> doesn’t seem like it |
13:19:03 | FromGitter | <mratsim> default_allocator is a simple one |
13:19:17 | FromGitter | <mratsim> scratchspace allocator is just an arena |
13:19:24 | zachcarter | okay |
13:19:37 | FromGitter | <mratsim> and temp allocator is using array[64, byte] as scratch space |
13:19:47 | FromGitter | <mratsim> 64 being an arbitrary number. |
13:20:32 | Araq | 64 bytes are good enough for everybody |
13:20:35 | * | nsf quit (Quit: WeeChat 2.3) |
13:20:46 | FromGitter | <mratsim> not me :P |
13:21:14 | zachcarter | https://github.com/dbartolini/crown/tree/master/src/core/memory - is another library I'm referencing, and he has another slew of allocators |
13:21:24 | FromGitter | <mratsim> my temp alloc are in the 5~30MB range :D |
13:21:39 | zachcarter | linear, pool, proxy, and stack |
13:21:46 | zachcarter | temp allocator I believe is the same as the one from the foundation lib |
13:22:44 | FromGitter | <mratsim> temp_allocator seems like stack allocator with destructors |
13:22:57 | FromGitter | <mratsim> pool_alloc is similar to the scratch allocator |
13:23:38 | zachcarter | need to learn all this stuff |
13:24:33 | zachcarter | and determine whether it's going to cause me any issues - but it doesn't sound like it |
13:24:44 | FromGitter | <mratsim> it’s not hard. Basically you can have automatic memory management = stack allocation, or going through the OS = heap allocation |
13:24:47 | zachcarter | I was worried that there was a certain magic to how his allocators were laying out things in memory |
13:25:07 | zachcarter | but it doesn't seem that's the case - sounds like they're just standard implementations of allocators that are commonly used |
13:25:15 | FromGitter | <mratsim> for heap allocation, either it’s GC-managed, or manually managed, or destructor managed |
13:25:20 | zachcarter | right |
13:25:44 | zachcarter | oh I get most of that stuff (I think anyway) - I meant more in terms of how different allocators are implemented / what use cases are for different implementations |
13:25:52 | FromGitter | <mratsim> also often, instead of returning chunks to the OS because you know that you will re-use them a lot, you keep them in a “pool" |
13:26:08 | zachcarter | like object pooling - or connection pooling |
13:26:48 | FromGitter | <mratsim> Use-case: stack allocation - very fast, no exceptions, no dealloc needed, limited stack space, max size must be known at compile-time |
13:26:58 | FromGitter | <mratsim> heap alloc: everything else |
13:27:32 | FromGitter | <mratsim> pool alloc: when you need heap alloc often due to size, but you know that you will alloc/dealloc often in a tight loop |
13:28:01 | zachcarter | thank you - that makes sense |
13:28:20 | FromGitter | <mratsim> I don’t really see the point of scratch/temp alloc, for me it’s served by pool allocation |
13:28:29 | Araq | zachcarter, relax, it doesn't really matter that much, there is only "bump pointer allocator" vs "traditional size classes" |
13:28:45 | zachcarter | gotcha |
13:29:03 | Araq | and size classes can work with bitmasks or linked lists |
13:29:47 | Araq | and nobody uses bitmasks because they are not as fast as a bump pointer allocator and not as general as linked lists |
13:30:29 | zachcarter | gotcha - okay I'm going to try to play with regions this morning |
13:30:42 | zachcarter | thank you both for the explanations and reassurance |
13:38:37 | * | theelous3_ quit (Ping timeout: 246 seconds) |
13:49:54 | FromGitter | <arnetheduck> @Araq tested `storage` vs `getStorageLoc` - by echoing whenever `storage` is read and they don't match - there's indeed a large number of cases where there's a discrepancy, and I'm not confident enough with the logic to go fix them.. pushed https://github.com/nim-lang/Nim/pull/9777 without the storageloc removal however |
13:50:27 | Araq | ah ok, thanks for looking into this |
13:56:17 | * | theelous3 joined #nim |
14:00:34 | * | jacereda quit (Ping timeout: 250 seconds) |
14:06:37 | dom96_w | For some reason I needed to add -lpthread to Nim's config |
14:07:01 | dom96_w | This is the sort of error I got https://github.com/linux-test-project/ltp/issues/255 |
14:07:05 | dom96_w | centos-specific issue? |
14:14:42 | leorize | there's a `{.link: "-lpthread".}` in threads.nim for Linux |
14:14:49 | leorize | so I'm not sure why you'd need it |
14:16:06 | dom96_w | yeah, it's odd. This was during the compilation of `koch` as well |
14:16:12 | dom96_w | which AFAIK doesn't need threads |
14:16:54 | * | theelous3 quit (Changing host) |
14:16:54 | * | theelous3 joined #nim |
14:24:02 | Araq | indeed, it doesn't |
14:25:08 | dom96_w | huh, install.sh doesn't install nimble etc.? |
14:27:32 | Araq | told you it's unsupported |
14:27:46 | dom96_w | so what do I use instead? |
14:28:04 | Araq | well 'koch tools' builds Nimble |
14:28:21 | dom96_w | I wonder if I can get away with simply copying everything |
14:28:45 | Araq | you unzip Nim into your ~ and either adapt PATH or you create symlinks in /usr/bin |
14:29:28 | dom96_w | That doesn't scale |
14:29:50 | Araq | that phrase lost its meaning long ago |
14:30:45 | dom96_w | No, I mean literally |
14:30:56 | dom96_w | I'm trying to get Nim into the hands of thousands of people |
14:31:08 | dom96_w | It needs to scale |
14:31:36 | Araq | as I said, for /usr/bin use your package manager |
14:32:00 | dom96_w | I'm effectively the packager in this situation |
14:32:10 | euantor | Create a deb package or an RPM then |
14:32:35 | dom96_w | euantor: That doesn't help me. |
14:32:46 | dom96_w | I am creating a package, sort of. |
14:32:57 | Araq | well 'koch distrohelper' is to help you create a package |
14:32:59 | dom96_w | I'm wondering how to ensure I get everything that's needed into the package |
14:33:24 | euantor | And that's not too useful either ;) Knowing what kind of environment it's meant to run in and who it's targeted at might help |
14:33:32 | dom96_w | `distrohelper` takes a "bin dir" |
14:33:39 | dom96_w | but I can see that the code doesn't use it... |
14:34:23 | dom96_w | euantor: Custom environment used at my company |
14:35:19 | euantor | Couldn't you just provide a zip or something with the built binaries in it then and drop it into somewhere in the `PATH`? |
14:38:00 | dom96_w | Not really |
14:39:11 | euantor | Ok, and why can't you use choosenim which you created for this task? |
14:42:39 | dom96_w | Because that would require everyone to install Nim manually |
14:42:45 | dom96_w | That's not how things are done here. |
14:43:19 | euantor | If you were using Windows you could do it via the domain server |
14:44:36 | * | vlad1777d quit (Ping timeout: 252 seconds) |
14:44:37 | Araq | well I'm not saying that it will work well |
14:45:02 | Araq | but the solution you're supposed to use is 'koch distrohelper', build a .dep or similar and install it this way |
14:46:14 | dom96_w | well, federico is manually copying nimble etc. |
14:46:16 | dom96_w | Which IMO sucks |
14:46:24 | dom96_w | But no better solution |
14:46:33 | dom96_w | So I'll do the same |
14:46:45 | federico3 | heh, and that's what makes Nim difficult to package |
14:47:14 | Araq | PRs for 'koch distrohelper' are welcome |
14:47:28 | Araq | ideally we will also patch travis to test this feature |
14:47:29 | * | narimiran joined #nim |
14:48:05 | dom96_w | Yeah. It's a painful process. But I think there is a certain level of pain when packaging anything |
14:51:01 | zachcarter | when compiling with `-d:gcRegions` I'm getting: `Error: system module needs: nimGCvisit` |
14:51:22 | Araq | zachcarter, the switch is --gc:regions |
14:51:58 | zachcarter | ah thank you my bad |
14:52:24 | zachcarter | I guess it was working then previously - I wasn't sure haha but I believe that's how I had my nims file before `switch("gc", "regions")` |
14:52:56 | zachcarter | I expected it to crash or do something different - which is what made me start fiddling with the switch |
14:59:21 | * | seni joined #nim |
14:59:38 | leorize | Nim is surprisingly easy to package actually |
15:00:09 | * | nsf joined #nim |
15:01:08 | leorize | everything fits in a folder and you can just symlink what you need to the correct places |
15:14:22 | FromGitter | <yyyc514> `method `message:add`*` how do i then call this? |
15:15:58 | zachcarter | I'm not understanding something here - https://gist.github.com/zacharycarter/cd9e94026c582d99cbd1e85577515520 |
15:16:48 | zachcarter | I'm using a MemRegion, and the withRegion template - and I expected the region's memory usage to change at some point during the program's execution - but it's always 0 |
15:17:06 | zachcarter | so I'm assuming I'm either doing something incorrectly or misunderstanding something completely :P |
15:28:28 | Zevv | should hasKey() on a Table to throw IndexError? |
15:28:37 | Zevv | s/be able to/ |
15:29:28 | narimiran | Zevv: `hasKey()` is bool |
15:29:58 | narimiran | in what situations would you like to see that error? |
15:30:12 | Zevv | I would not, but I get it |
15:30:15 | Zevv | unexpectedly |
15:30:27 | narimiran | post a short example please |
15:30:53 | FromGitter | <Varriount> @zachcarter Is this a memory map? |
15:32:07 | zachcarter | @Varriount: I'm just playing with --gc:regions |
15:32:14 | zachcarter | https://github.com/nim-lang/Nim/blob/devel/lib/system/gc_regions.nim |
15:32:16 | Zevv | narimiran: http://paste.debian.net/1052817/ |
15:32:48 | narimiran | Zevv: just by looking at it, without running — your table is not initialized |
15:32:55 | Zevv | Aw dang |
15:32:56 | narimiran | use `initTable` |
15:33:00 | Zevv | yessss |
15:33:05 | Zevv | that bit me before |
15:35:44 | * | shashlick_ joined #nim |
15:52:09 | FromGitter | <alehander42> @yyyc514 why would you do this |
15:52:11 | FromGitter | <alehander42> :D |
15:55:28 | * | leorize quit (Quit: WeeChat 2.2) |
15:56:03 | * | PMunch quit (Quit: Leaving) |
15:59:56 | * | leorize joined #nim |
16:03:29 | dom96_w | nimsuggest still gives the same output for -v as the nim compiler :D |
16:33:32 | * | arnetheduck joined #nim |
16:33:43 | * | arnetheduck left #nim (#nim) |
16:35:35 | * | shpx joined #nim |
16:37:31 | * | ng0 joined #nim |
16:43:27 | Araq | I fixed the async leak but now tasyncdiscard fails |
16:46:13 | * | narimiran quit (Remote host closed the connection) |
16:49:43 | * | narimiran joined #nim |
17:07:57 | narimiran | Araq: your fix for #9716 is in your branch — what is stopping the merge into devel? |
17:08:20 | narimiran | aha, "but now tasyncdiscard fails" |
17:10:17 | * | seni quit (Quit: Leaving) |
17:28:19 | Araq | yeah yglukhov[m], please take a look |
17:31:03 | * | Trustable joined #nim |
17:42:07 | * | shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:43:19 | narimiran | i don't know if he checks his matrix account (i know that i don't do very often), so here goes gitter ping: @yglukhov |
17:43:37 | FromGitter | <yglukhov> hey guys |
17:43:59 | FromGitter | <yglukhov> should i look at your fix, Araq? where is it? |
17:44:30 | Araq | araq-fixes-9716 branch |
17:44:34 | FromGitter | <alehander42> those pings are really effective |
17:44:34 | narimiran | https://github.com/nim-lang/Nim/tree/araq-fixes-9716 |
17:45:13 | Araq | I should probably code it differently and have looked at the C code diffs though |
17:49:41 | serialdev[m] | Hey guys first of all been trying out nim today and it is significantly nicer to work with than current alternatives |
17:50:30 | * | serialdev[m] sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/jgIIluRxzbjQyhSXAdRPPzTf > |
17:50:39 | serialdev[m] | dont know if any of you could give me a hand |
17:51:12 | FromGitter | <Varriount> Sounds like a problem with the nake file for nimx |
17:51:53 | narimiran | serialdev[m]: we (on IRC) don't see your message. i guess it is some long code-paste. better to use some 3rd party service for that, and give us a link |
17:52:27 | narimiran | (ok, clicking the link opens up the whole message, no need to resend it) |
17:52:37 | serialdev[m] | no further info on the nake files on nimx docs so I just have it with pretty much naketools imported |
17:52:38 | serialdev[m] | import nimx/naketools |
17:52:44 | serialdev[m] | Good to know narimiran |
17:53:23 | narimiran | unfortunately i have no experience with JS so cannot help you there |
17:56:02 | serialdev[m] | I will post it if I figure it out :) thanks |
18:01:19 | FromGitter | <yglukhov> Araq: i see the problem. :state got inited in the beginning of the state loop, inside it. that's likely my bug. |
18:03:06 | FromGitter | <yglukhov> serialdev: oh I haven't yet seen this. but js is broken now anyway, sorry. |
18:04:51 | * | nsf quit (Quit: WeeChat 2.3) |
18:05:24 | Araq | is that my fault? |
18:06:36 | FromGitter | <yglukhov> Araq: err.. not sure yet... |
18:07:15 | Araq | I mean the JS breakage |
18:08:34 | FromGitter | <yglukhov> oh, sure. https://github.com/nim-lang/Nim/issues/9644 and https://github.com/nim-lang/Nim/issues/9643 to name a few :) |
18:11:01 | Araq | https://www.zdnet.com/article/intel-cpus-impacted-by-new-portsmash-side-channel-vulnerability/ |
18:11:38 | Araq | Oh ok, but that's just some 0.19.0 pain |
18:13:25 | FromGitter | <yglukhov> what puzzles me is how tyieldintry managed to succeed with that kind of issue. |
18:14:03 | Araq | for me it's why only *one* async test fails due to it |
18:14:20 | FromGitter | <yglukhov> yeah, exactly. |
18:14:44 | * | Trustable quit (Remote host closed the connection) |
18:14:50 | FromGitter | <yglukhov> well the c code is clearly wrong. so wrong that it should fail everything async |
18:15:52 | FromGitter | <yglukhov> oooh i think i get it |
18:16:53 | FromGitter | <yglukhov> its because of the lambdalifting subtlety. lamdalifting+closureitertransform can sometimes be reordered. |
18:16:59 | FromGitter | <yglukhov> and that's the case. |
18:17:33 | FromGitter | <yglukhov> i'm not sure 100%, but that's my best guess. |
18:37:18 | FromGitter | <yglukhov> Araq: ok, found the bug in the transformation. |
18:39:38 | * | theelous3 quit (Ping timeout: 245 seconds) |
18:50:43 | FromGitter | <yglukhov> Araq: however i'm not sure how to fix this. Here's the problem. If lamdalifting was not done, we add stup local vars in nkVarSection at the beginning of the loop, so they are lifted later. Now the place where we add them was pretty arbitrary (and i didn't notice the possibility of such outcome), however now that makes a difference. I could add those to state0, that would be the "logical" fix, but we really don't want |
18:50:43 | FromGitter | ... resets for them... |
18:51:08 | * | MightyJoe joined #nim |
18:51:39 | * | cyraxjoe quit (Ping timeout: 264 seconds) |
18:57:45 | Araq | well we can special case ':state' and not reset it in the backend |
19:00:09 | * | theelous3 joined #nim |
19:01:52 | * | theelous3 quit (Remote host closed the connection) |
19:07:37 | * | floppydh quit (Quit: WeeChat 2.3) |
19:09:41 | * | krux02 quit (Remote host closed the connection) |
19:10:03 | FromGitter | <yglukhov> Araq: there are temps as well, not only state |
19:11:09 | FromGitter | <yglukhov> and :curExc, :tmpResult, :unrollFinally |
19:13:18 | FromGitter | <yglukhov> ok, I will add them to state0 anyway, we can revisit this "optimization" part later. |
19:20:28 | FromGitter | <alehander42> ahhh elif is my enemy |
19:31:55 | FromGitter | <alehander42> dynamic languages are a nightmare, let me tell you that |
19:31:57 | FromGitter | <alehander42> </rant> |
19:32:07 | narimiran | tell us more :) |
19:32:21 | narimiran | and what's the problem with elif |
19:38:09 | * | narimiran quit (Remote host closed the connection) |
19:39:37 | * | narimiran joined #nim |
19:40:24 | * | miran joined #nim |
19:42:27 | * | miran quit (Remote host closed the connection) |
20:01:14 | * | nsf joined #nim |
20:06:58 | * | shashlick_ quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
20:10:22 | serialdev[m] | quick question is there an equivalent to type() from python? or anything resembling the introspection module ? |
20:10:44 | serialdev[m] | I feel like improving the emacs integration, so having access to that would be awesome |
20:15:42 | FromGitter | <yglukhov> Araq: done |
20:17:51 | dom96_w | Araq: please make sure to backport the fix for Nimble not being compiled in release mode |
20:20:34 | Araq | serialdev[m], for introspection you use nimsuggest |
20:20:44 | Araq | dom96_w, oh hmmm |
20:21:08 | Araq | that should have been backported already |
20:30:52 | FromGitter | <yglukhov> Araq: btw, i ended up adding those not to state0, but in the limbo between state jump and state0, so that code gets never executed, and likely will be dead-eliminated by the C compiler. That's good for now, but will have to be moved elsewhere when we change state jump to switch-case. |
20:32:00 | serialdev[m] | thanks! |
20:32:26 | Araq | yglukhov, can't follow you |
20:33:46 | FromGitter | <yglukhov> not a big deal. seen my commit? |
20:36:33 | FromGitter | <yglukhov> what i mean is, the codegen is now like this: |
20:38:22 | FromGitter | <yglukhov> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bf713be97a8982b9a4b1953] |
20:38:39 | narimiran | serialdev[m]: until https://github.com/nim-lang/Nim/pull/7100 is merged, if you want to just print some types, use `typetraits` module |
20:40:39 | Araq | can't be bothered, I'm trying to make this terrible IC work. what an annoying piece of junk |
20:43:47 | Araq | ah... |
20:44:02 | Araq | why did this ever work then... |
20:44:18 | FromGitter | <yglukhov> ic - integrated circuit? :) |
20:44:31 | Araq | incremental compilation |
20:45:33 | FromGitter | <yglukhov> Araq: ok, now i can't follow. let me try that again. the gist above is the codegen after my fix. |
20:45:43 | FromGitter | <yglukhov> the one that was before my fix is like this |
20:46:32 | FromGitter | <yglukhov> ```while true: ⏎ :env.state = 0 ⏎ jumpToState :env.state ⏎ STATE0: ...``` [https://gitter.im/nim-lang/Nim?at=5bf715a8baf43f2b9b5a5856] |
20:58:41 | FromGitter | <Araq> ok |
20:58:51 | Araq | that makes sense |
21:07:38 | * | nsf quit (Quit: WeeChat 2.3) |
21:14:43 | * | theelous3_ joined #nim |
21:14:48 | FromGitter | <yglukhov> the one that was before *your* fix is this ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5bf71c48c6cf4524d15f993a] |
21:24:07 | zachcarter | am I doing anything correct here haha? - https://gist.github.com/zacharycarter/e186bde161ed76eeaa5359e45a039ad8 |
21:31:13 | * | kungtotte joined #nim |
21:31:50 | * | kungtotte quit (Client Quit) |
21:34:41 | * | kungtotte joined #nim |
21:42:18 | * | narimiran quit (Ping timeout: 252 seconds) |
21:44:31 | * | kungtotte quit (Quit: leaving) |
21:45:19 | * | kungtotte joined #nim |
21:58:24 | * | stefanos82 quit (Quit: Quitting for now...) |
22:13:11 | * | Vladar quit (Remote host closed the connection) |
22:37:06 | * | blarghz[m] joined #nim |
22:39:12 | zachcarter | okay - I made a very simple example with a heap allocation - https://gist.github.com/zacharycarter/30f81e39a3da4267cf86da3b65771ac1 |
22:40:16 | zachcarter | and I can definitely see the gc_region calls being made - https://imgur.com/a/1o2X0aF |
22:40:52 | zachcarter | curious though about how to visualize what's going on memory wize |
22:43:08 | zachcarter | okay I see the problem - I was running massif without stack profiling on |
22:43:36 | zachcarter | once I turn it on - I see the stack allocations |
22:44:59 | zachcarter | now I need to figure out how to make this work across threads - my first stab at it didn't work, going to eat and then try again |
22:47:06 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:47:13 | * | kklas quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:05:53 | * | kungtotte quit (Ping timeout: 245 seconds) |
23:21:58 | * | kapil____ quit (Quit: Connection closed for inactivity) |
23:24:59 | * | vlad1777d joined #nim |
23:28:41 | * | kungtotte joined #nim |
23:42:59 | * | shpx joined #nim |
23:51:18 | * | Ven`` joined #nim |