00:00:36 | * | Hideki_ quit (Ping timeout: 268 seconds) |
00:04:18 | * | a_b_m quit (Ping timeout: 268 seconds) |
00:04:42 | FromDiscord | <krab4t> i feel bad interrupting this conversation, but its not possible to use ` untyped ` in ` templates ` and use ` import ` that file, only ` include ` works? |
00:05:19 | FromDiscord | <krab4t> why spiting project to multiple files is so hard in Nim |
00:09:39 | rayman22201 | krab4t can you show some example? |
00:10:52 | * | krux02_ joined #nim |
00:13:12 | * | couven92 quit (Quit: Client Disconnecting) |
00:13:24 | FromGitter | <mratsim> @brentp open an issue with it in Laser I'll check it out, normally 3 accumulators should be enough because the latency is 3 cycles or 4 cycles for addition (but you can launch 1 every cycle as long as there is no data dependency) |
00:13:52 | * | krux02 quit (Ping timeout: 264 seconds) |
00:16:26 | FromGitter | <mratsim> I hate when just before sleep I find a super strange compiler bug. I have a variable telling me "cannot instantiate =destroy" for one of its field with a destructor and the way to solve that is to instantiate another dummy variable :/ |
00:17:32 | FromDiscord | <krab4t> rayman22201 https://pastebin.com/raw/T4BdrsAb |
00:23:21 | * | uvegbot joined #nim |
00:25:12 | rayman22201 | Krab4t did you remember to add the star to export the template? |
00:29:32 | FromDiscord | <krab4t> yes, ` Error: undeclared field: 'isNone' ` |
00:33:22 | rayman22201 | From the options module? |
00:33:39 | rayman22201 | You need to import the options module |
00:34:26 | FromDiscord | <krab4t> ` import strutils, parseutils, re, options, typetraits ` :> |
00:35:16 | rayman22201 | You need to import it in the module you are using the template, (or in the template itself) |
00:35:21 | FromDiscord | <krab4t> include works so whatever, should i use ` import ` for splitting files over include in one project? |
00:35:36 | rayman22201 | You don't understand how templates work |
00:36:18 | FromDiscord | <krab4t> agree, vscode extension doesn't help with that either 🙂 |
00:36:33 | rayman22201 | Generally you don't use import, and you don't use import to split a project |
00:36:43 | rayman22201 | Include |
00:37:03 | rayman22201 | Bah. Lol 😆 |
00:37:10 | disruptek | lol |
00:37:22 | FromDiscord | <krab4t> what |
00:37:24 | rayman22201 | Do use import, don't use include lol |
00:37:48 | rayman22201 | I typed the wrong thing. My fingers were faster than my brain |
00:38:05 | FromDiscord | <krab4t> back to typing 100 stars |
00:40:06 | rayman22201 | It's one character. Would you prefer to type "export" a 100 times? I don't see a problem here. |
00:41:33 | rayman22201 | And don't tell me "default to public" because that works great for small scripts, but is terrible for maintainable software of any decent size... |
00:44:21 | * | xace joined #nim |
01:12:32 | * | krux02_ quit (Remote host closed the connection) |
01:16:47 | rayman22201 | krab4t: sorry for being snarky. Here is a more clear explanation (hopefully): https://gist.github.com/rayman22201/1cfb980293a0a55091a4885f9d39aa5e |
01:18:26 | * | uvegbot quit (Ping timeout: 240 seconds) |
01:26:07 | * | uvegbot joined #nim |
01:27:29 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
01:33:04 | * | uvegbot quit (Ping timeout: 264 seconds) |
01:36:51 | * | uvegbot joined #nim |
01:38:49 | * | druonysus joined #nim |
01:38:49 | * | druonysus quit (Changing host) |
01:38:49 | * | druonysus joined #nim |
01:42:31 | * | druonysus quit (Client Quit) |
01:45:46 | * | druonysus joined #nim |
01:45:46 | * | druonysus quit (Changing host) |
01:45:46 | * | druonysus joined #nim |
01:47:20 | FromGitter | <kaushalmodi> Araq: Here's the log from running valgrind: http://ix.io/212I/text |
01:48:01 | FromGitter | <kaushalmodi> This error keeps on repeating: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc377d1a9f0dc24852bce0e] |
01:51:32 | * | druonysus quit (Quit: druonysus) |
01:51:39 | FromDiscord | <krab4t> @rayman22201 i got this already thanks |
01:51:54 | rayman22201 | 👍 |
01:52:23 | * | druonysus joined #nim |
01:52:23 | * | druonysus quit (Changing host) |
01:52:23 | * | druonysus joined #nim |
01:54:40 | * | druonysus quit (Client Quit) |
01:55:14 | * | druonysus joined #nim |
01:55:14 | * | druonysus quit (Changing host) |
01:55:14 | * | druonysus joined #nim |
01:58:28 | * | kevin joined #nim |
01:58:40 | * | kevin is now known as Guest40599 |
01:58:58 | * | Guest40599 is now known as kevin- |
02:21:38 | * | dddddd quit (Remote host closed the connection) |
02:40:18 | FromGitter | <kaushalmodi> I'm going a bit crazy with this GC crash debug .. |
02:40:46 | FromGitter | <kaushalmodi> this is the minimal entire Nim code I need to reproduce the crash: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc3842da9f0dc24852bce10] |
02:41:30 | FromGitter | <kaushalmodi> this proc is exported to a .so and that is then run in a host C application, and that appl crashes if this .so is compiled with default GC |
02:41:43 | FromGitter | <kaushalmodi> If I compile with --gc:none, the host application does not crash |
02:42:15 | FromGitter | <kaushalmodi> Is that something special needed to be done in pragmas or something for procs that get exported to .so? |
02:43:07 | FromGitter | <kaushalmodi> Crash in host C appl: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc384bb8fbe1d5faba20045] |
02:51:46 | FromGitter | <rayman22201> are you also linking in nimtrl.so? |
02:53:24 | * | Hideki_ joined #nim |
02:56:41 | FromDiscord | <++x;> `hey guys` |
02:56:59 | FromDiscord | <++x;> `last night i had sex and a bubble popped between my leggies` |
02:57:01 | FromGitter | <kaushalmodi> @rayman22201 no |
02:57:18 | rayman22201 | you need to do that |
02:57:25 | * | rockcavera quit (Remote host closed the connection) |
02:57:28 | rayman22201 | nimrtl.so has all the GC procs |
02:57:29 | FromGitter | <kaushalmodi> where is nimtrl.so? |
02:57:34 | rayman22201 | you have to build it |
02:57:47 | FromGitter | <kaushalmodi> somebody should have told me all these years! |
02:58:00 | FromGitter | <kaushalmodi> instructions please |
02:58:05 | * | Hideki_ quit (Ping timeout: 276 seconds) |
02:58:07 | FromDiscord | <++x;> `pop my leggies and make me do the splits` |
02:58:13 | rayman22201 | https://nim-lang.org/docs/nimc.html#dll-generation |
02:58:34 | rayman22201 | replace `.dll` with `.so` |
02:58:36 | * | kevin- quit (Quit: Using Circe, the loveliest of all IRC clients) |
02:59:02 | rayman22201 | I'm actually surprised you didn't know this @kaushalmodi! |
02:59:43 | FromGitter | <kaushalmodi> and all my .so works just fine (except only with --gc:none.. no wonder) |
02:59:55 | * | kevin5 joined #nim |
03:00:07 | FromGitter | <kaushalmodi> today I sat down to get to the root cause.. and the minimal example reduce to that tiny bit |
03:01:23 | FromGitter | <kaushalmodi> so a dummy question.. |
03:02:03 | * | lritter quit (Ping timeout: 240 seconds) |
03:02:20 | FromGitter | <kaushalmodi> 1) I first create nimrtl.so ⏎ 2) Then I ship both nimrtl.so and mylib.so to my team separately? |
03:02:31 | FromGitter | <kaushalmodi> can the nimrtl.so not be a part of mylib.so? |
03:03:09 | * | lritter joined #nim |
03:03:35 | rayman22201 | correct. This is because if you were to have mylib1.so and mylib2.so, they both must use the same common nimrtl.so |
03:05:03 | FromGitter | <kaushalmodi> what I do is that I have a wrapper libdpi.nim |
03:05:13 | FromGitter | <kaushalmodi> in that I import all my Nim libs and pack a single .so |
03:05:27 | FromGitter | <kaushalmodi> so theoretically I can just import in the nimrtl too? |
03:08:06 | rayman22201 | it's fundamentally possible, but the compiler won't let you :/ |
03:08:19 | rayman22201 | nimrtl is condsidered "magic" |
03:09:52 | FromGitter | <kaushalmodi> hmm, I am somehow unable to link to libnimrtl.so |
03:10:10 | * | oculux quit (Ping timeout: 265 seconds) |
03:10:15 | * | oculuxe joined #nim |
03:10:44 | FromGitter | <kaushalmodi> I am running `nim c -d:useNimRtl --out:libdpi_64.so --app:lib -d:release libdpi.nim` |
03:10:58 | FromGitter | <kaushalmodi> and I have `libnimrtl.so` and `libdpi.nim` in the same directory |
03:11:26 | FromGitter | <kaushalmodi> libdpi.so generates fine, but when I do `ldd ./libdpi.so`, I do not see it linked to libnimrlt.so |
03:11:37 | FromGitter | <kaushalmodi> (also the same GC based crash still happens) |
03:14:20 | rayman22201 | warning: I haven't actually used this feature before. We are reaching the limits of my knowledge |
03:14:57 | rayman22201 | I think @shashlick is probably most familiar with it |
03:15:01 | rayman22201 | but he is probably sleeping |
03:15:41 | rayman22201 | I think you may need to call a proc to init the GC at the start of your program |
03:16:09 | FromGitter | <kaushalmodi> my Nim lib is not standalone |
03:16:17 | FromGitter | <kaushalmodi> I mean, it doesn't run by itself |
03:16:34 | FromGitter | <kaushalmodi> it's just a pack of exporc'd procs that are called from the host C appl |
03:17:33 | FromGitter | <kaushalmodi> the snippet in https://gitter.im/nim-lang/Nim?at=5dc384110725f61e9c80cd9a is literally the whole Nim code |
03:18:16 | FromGitter | <kaushalmodi> but when that proc is called from the host C app (where I link the Nim compiled .so), it crashes |
03:20:12 | rayman22201 | I understand |
03:20:27 | rayman22201 | The problem is, all those string operations trigger a GC pass |
03:20:30 | rayman22201 | but there is no GC |
03:21:00 | rayman22201 | specifically it attempts to call the GC "mark" proc |
03:21:11 | FromGitter | <kaushalmodi> yeah.. |
03:21:14 | rayman22201 | but you haven't included the GC |
03:21:23 | FromGitter | <kaushalmodi> now to figure out how to link it |
03:21:29 | rayman22201 | you have to both include the GC functions, and initialize the GC runtime |
03:21:43 | rayman22201 | even if you just linked it, that would not be sufficient |
03:22:00 | FromGitter | <kaushalmodi> I cannot link both libnimrtl.so and mylib.so (libdpi.so that I referenced above) with the host C app because they both have `NimMain` |
03:22:45 | rayman22201 | hrmmm... some missing flag I think. |
03:23:13 | rayman22201 | weird, I thought --app:lib causes the NimMain to not be generated |
03:23:17 | FromGitter | <kaushalmodi> I faced this issue before and so I started just importing all my Nim libs and creating just one .so |
03:23:28 | FromGitter | <kaushalmodi> no, it does.. |
03:24:29 | rayman22201 | there is some forum post or blog post about this... and I can't remember where it is :-( |
03:26:40 | * | uu91 quit (Read error: Connection reset by peer) |
03:27:02 | * | uu91 joined #nim |
03:27:17 | FromGitter | <kaushalmodi> I couldn't be a first one compiling .so from .nim |
03:28:11 | FromGitter | <kaushalmodi> Seems like I am missing out something big, or there's something else special with the way the host C application (systemverilog compiler) uses the .so |
03:30:49 | rayman22201 | so, the closest thing I can find is to look at what nimpy from yglukhov is doing |
03:30:51 | rayman22201 | https://github.com/yglukhov/nimpy/blob/master/nimpy.nim#L213 |
03:31:05 | FromGitter | <kaushalmodi> hmm, actually libnimrtl.so is being used.. |
03:31:09 | FromGitter | <kaushalmodi> but the crash is the exact same |
03:31:14 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc39002bbdf5f17b420b97f] |
03:31:46 | rayman22201 | you need to do something similar to nimpy |
03:32:11 | rayman22201 | specifically check if the GC is initialized and call `setupForeignThreadGC`when needed |
03:32:20 | rayman22201 | and make sure the `stackBottom` is kept correct |
03:32:34 | FromGitter | <kaushalmodi> too much jargon! |
03:32:51 | FromGitter | <kaushalmodi> need to read up, starting with your nimpy reference |
03:33:07 | FromGitter | <kaushalmodi> without libnimrtl, I get: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc390733f4ea333f2c531ca] |
03:33:11 | rayman22201 | lol. you asked for the Dragon, and the dragon is Nim's GC :-P |
03:33:33 | FromGitter | <kaushalmodi> so as you see, it's the same crash, so I did not need nimrtlib.so |
03:33:56 | FromGitter | <kaushalmodi> may be the issue is about me not doing the fancy GC stuff :) |
03:34:19 | rayman22201 | Yeah. nimrtllib.so was a red herring. I apologize |
03:34:28 | rayman22201 | it's the fancy GC stuff that you need :-) |
03:34:54 | rayman22201 | I was hoping that --nimrtl would do the fancy GC stuff for you, but I guess not :-( |
03:35:18 | * | actuallybatman quit (Ping timeout: 265 seconds) |
03:36:29 | rayman22201 | while I have you, @kaushalmodi. I have a question of my own. I'm trying to use nim-gdb. I would like to set a breakpoint at a specific line in a nim proc, but I can't seem to do that. |
03:36:46 | FromGitter | <kaushalmodi> the nimpy example is going into threads stuff (another unknown area for me) |
03:36:49 | rayman22201 | you have some experience with nim in gdb if IIRC? |
03:36:56 | FromGitter | <kaushalmodi> do I really need --threads:on for GC? |
03:36:59 | rayman22201 | no |
03:37:20 | rayman22201 | you are going to have extrapolate the GC stuff from the thread stuff |
03:37:47 | FromGitter | <kaushalmodi> no, I started learning gdb and used valgrind for the first time just to debug this GC crash |
03:37:53 | rayman22201 | if you have threads, the GC gets more complicated, but even with a single thread the GC stuff is the same. |
03:38:22 | FromGitter | <kaushalmodi> have you looked at the nim-gdb video and the blog post? |
03:38:44 | rayman22201 | ahh. I forgot about that |
03:39:01 | FromGitter | <kaushalmodi> https://internet-of-tomohiro.netlify.com/nim/gdb.en.html |
03:39:18 | FromGitter | <kaushalmodi> I have bookmarked that.. still too read |
03:39:29 | rayman22201 | thank you :D |
03:39:37 | FromGitter | <kaushalmodi> I bookmarked it when I had never run gdb ever |
03:39:48 | FromGitter | <kaushalmodi> may be if I read it now, I won't be that scared |
03:39:49 | FromGitter | <kaushalmodi> :) |
03:40:01 | rayman22201 | gdb isn't so scary :-) |
03:42:42 | rayman22201 | looking at your stack trace, I am willing to bet that the first two lines of this function are exactly what you need: https://github.com/yglukhov/nimpy/blob/master/nimpy.nim#L214 |
03:42:50 | FromGitter | <kaushalmodi> I have a lot of questions about setting up GC init: I will leave the questions here, but I will need to sign off for today |
03:43:29 | rayman22201 | o/ bye |
03:43:31 | FromGitter | <kaushalmodi> 1) how to decide when and where to call that updateStackBottom? |
03:43:49 | FromGitter | <kaushalmodi> 1) You said that check that the stackBottom is correct.. I have no idea what it should be |
03:44:02 | FromGitter | <kaushalmodi> .. and how do I "init" GC? |
03:44:05 | FromGitter | <kaushalmodi> where? |
03:44:40 | FromGitter | <kaushalmodi> the host C appl will be simply calling that exportc'd proc.. do I init that GC in there (how?) |
03:50:31 | * | druonysus quit (Quit: druonysus) |
03:55:45 | * | druonysus joined #nim |
03:55:46 | * | druonysus quit (Changing host) |
03:55:46 | * | druonysus joined #nim |
04:01:14 | * | druonysus quit (Remote host closed the connection) |
04:02:28 | FromDiscord | <Bub_Lite_63_Jr> I've been trying to install Nim for a few days, with no luck. Any Zim Gurus awake that might be able to understand why I'm having an installation error? |
04:14:14 | * | cyraxjoe joined #nim |
04:15:54 | * | MightyJoe quit (Ping timeout: 265 seconds) |
04:19:45 | shashlick | please share some details |
04:31:19 | * | kevin5 quit (Ping timeout: 268 seconds) |
04:34:12 | * | druonysus joined #nim |
04:34:12 | * | druonysus quit (Changing host) |
04:34:12 | * | druonysus joined #nim |
04:34:54 | * | druonysus quit (Remote host closed the connection) |
04:36:51 | FromDiscord | <treeform> Nim is not hard to install? |
04:40:08 | * | druonysus joined #nim |
04:40:08 | * | druonysus quit (Changing host) |
04:40:08 | * | druonysus joined #nim |
04:43:57 | * | druonysus quit (Remote host closed the connection) |
04:51:46 | * | uu91 quit (Read error: Connection reset by peer) |
04:52:10 | * | uu91 joined #nim |
04:52:23 | * | chemist69 quit (Ping timeout: 245 seconds) |
04:52:36 | * | nsf joined #nim |
04:53:06 | * | uu91 quit (Client Quit) |
04:54:21 | * | chemist69 joined #nim |
05:01:59 | * | GordonBGood joined #nim |
05:05:46 | * | druonysus joined #nim |
05:05:46 | * | druonysus quit (Changing host) |
05:05:46 | * | druonysus joined #nim |
05:06:29 | * | druonysus quit (Remote host closed the connection) |
05:07:02 | * | uu91 joined #nim |
05:07:31 | * | druonysus joined #nim |
05:07:31 | * | druonysus quit (Changing host) |
05:07:31 | * | druonysus joined #nim |
05:08:59 | FromGitter | <zacharycarter> wrote a compile time proc to turn a byte array into a uint32: https://play.nim-lang.org/#ix=213e |
05:09:07 | FromGitter | <zacharycarter> endians wouldn't work at compiletime because it cimports some builtin |
05:09:23 | * | jwm2241 quit (Ping timeout: 250 seconds) |
05:10:37 | * | jwm2241 joined #nim |
05:14:53 | FromGitter | <kayabaNerve> @zacharycarter ... why? :P |
05:15:03 | FromGitter | <kayabaNerve> Couldn't you just use hex notation |
05:18:33 | * | lritter quit (Quit: Leaving) |
05:30:01 | * | druonysus quit (Remote host closed the connection) |
05:36:36 | * | nif quit (Quit: ...) |
05:36:47 | * | nif_ joined #nim |
05:39:19 | * | thomasross is now known as Guest3578 |
05:39:19 | * | thomasross_ joined #nim |
05:39:19 | * | Guest3578 quit (Killed (adams.freenode.net (Nickname regained by services))) |
05:39:19 | * | thomasross_ is now known as thomasross |
05:40:47 | FromGitter | <zacharycarter> I suppose so |
05:41:06 | FromGitter | <zacharycarter> C++ lets you do something like - `static const uint32_t kHelloCC = 'HELO';` |
05:41:14 | FromGitter | <zacharycarter> but yeah, hex would probably be easier |
06:04:06 | Araq | does C++ use little or big endian for this? seems to be a crappy feature tbh |
06:07:23 | * | kevin joined #nim |
06:07:44 | * | kevin is now known as Guest48957 |
06:20:47 | FromGitter | <zacharycarter> good question - i'll try to dig and figure it out - I know it's supported by gcc but not sure about other compilers - it's definitely not cross platform |
06:21:04 | FromGitter | <zacharycarter> I'll just use hex and `fromHex` as that seems much better |
06:26:15 | * | narimiran joined #nim |
06:26:19 | * | theelous3_ joined #nim |
06:26:27 | * | theelous3 quit (Ping timeout: 240 seconds) |
06:29:02 | FromGitter | <kayabaNerve> I do everything in big endian simply because bit shifts are big endian no matter the CPU. |
06:29:27 | FromGitter | <kayabaNerve> That said, it's amazing to just do a raw pointer cast/memcpy (to make it safe). |
06:35:45 | * | solitudesf joined #nim |
06:52:05 | * | thomasross quit (Ping timeout: 276 seconds) |
06:52:18 | * | thomasross joined #nim |
06:55:05 | * | Hideki_ joined #nim |
06:59:56 | * | Hideki_ quit (Ping timeout: 268 seconds) |
07:07:07 | * | Guest48957 quit (Remote host closed the connection) |
07:07:17 | * | uu91 quit (Read error: Connection reset by peer) |
07:07:37 | * | uu91 joined #nim |
07:07:49 | * | kevin joined #nim |
07:08:03 | * | kevin is now known as Guest24903 |
07:11:12 | * | Guest24903 is now known as Kevin |
07:11:55 | * | Kevin is now known as Guest3139 |
07:20:10 | * | Guest3139 is now known as Kevin- |
07:20:41 | Kevin- | isn't Nim compile to wasm possible ? |
07:21:06 | FromGitter | <kayabaNerve> Yes, via emscripten. |
07:22:44 | Araq | nlvm can also do it |
07:23:57 | Kevin- | thanks |
07:24:14 | FromGitter | <kayabaNerve> https://github.com/Jipok/Nim-SDL2-and-Emscripten |
07:24:18 | FromGitter | <kayabaNerve> https://github.com/Feneric/nim-wasm-helpers |
07:25:57 | FromGitter | <kayabaNerve> There's two links about it (there's also some Git issues around). First is a dated repo compiling Nim SDL2 code to ASM.js/WASM and the second is a more recent repo which sets up a VM for the work. I'm not suggesting setting up a VM, but it should contain the relevant scripts. |
07:28:27 | FromGitter | <zacharycarter> I had some zengine examples running with webassembly |
07:28:42 | FromGitter | <zacharycarter> it's pretty easy via emscripten |
07:30:03 | Kevin- | I think wasm will popular in near future |
07:30:42 | FromGitter | <zacharycarter> I heard that somewhere a few years ago :P |
07:30:51 | Kevin- | and Nim compile wasm was cool 👑 |
07:31:09 | FromGitter | <zacharycarter> but in all seriousness, I hope JavaScript dies a slow painful death, sooner rather than later |
07:31:56 | Kevin- | I don't like Javascript totally |
07:32:22 | * | snwmzr joined #nim |
07:32:28 | Kevin- | still working on it but don't like :P |
07:33:03 | FromGitter | <zacharycarter> well yeah, same here, in fact I'm writing JS right now at work adding functionality to some react app Supercell wrote that we use |
07:33:25 | FromGitter | <zacharycarter> but that doesn't mean I like it! :P |
07:34:31 | Kevin- | someday I deleted node_modules and feel better :D |
07:37:37 | * | PMunch joined #nim |
07:39:22 | FromGitter | <zacharycarter> :D |
07:41:44 | FromGitter | <funcmike_twitter> Hello, where can I find progress report on new runtime (destructors)? |
07:43:01 | * | letto quit (Quit: Konversation terminated!) |
07:44:27 | * | letto joined #nim |
07:46:02 | GordonBGood | funcmike_twitter: unless Araq chips in, it seems it's too early for a progress report on "--newruntime"/"--gc:destructors" (two separate things) as they are still in fairly rough development form... |
07:46:37 | GordonBGood | But "--gc:destructors" is likely to hit the big time before "--newruntime" |
07:46:49 | GordonBGood | Anything specific you would like to know? |
07:47:26 | FromGitter | <zetashift> What is the difference between destructors and newruntime? |
07:47:56 | Araq | destructors: C++ with shared_ptr done right |
07:48:04 | Araq | newruntime: C++ with unique_ptr done right. |
07:50:51 | GordonBGood | zetasguft: --newruntime is pretty complex: in short ``owned`` ref's that get destroyed when they go out of scope as per a paper by Bacon/Dingle - started from about here https://github.com/nim-lang/RFCs/issues/144 |
07:51:34 | GordonBGood | ^ the beginning of the long answer on --newruntime |
07:53:48 | Araq | GordonBGood: it's not as bas as you claim IMO, simple programs I try with --gc:destructors do work |
07:54:03 | * | theelous3_ quit (Ping timeout: 240 seconds) |
07:54:11 | GordonBGood | Yes, me, too, for simple programs |
07:54:59 | GordonBGood | But we aren't ready for "big time" until it works for everything we can throw at the common GC's like --gc:boehm |
07:55:26 | livcd | This channel is much more active during the EU time. Unbelievable how everything is so quiet when one is in Asia |
07:56:24 | GordonBGood | Yeah, I'm in Asia, too, need to wait to after 2 pm or get up in the middle of the night to chat with most ppl |
07:56:55 | livcd | GordonBGood can i Q ? |
07:57:08 | GordonBGood | Q awqy |
07:57:32 | GordonBGood | Thailand |
07:59:04 | Kevin- | I'm in Asia too |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:02:52 | FromGitter | <kayabaNerve> I actually don't mind JS. I used to use Node all the time. |
08:03:07 | FromGitter | <kayabaNerve> I also don't see WASM as the superior alternative. |
08:04:42 | * | gmpreussner joined #nim |
08:06:56 | FromGitter | <zacharycarter> JS is pretty terrible |
08:07:18 | FromGitter | <alehander92> maybe its kinda fine with a type checker and some overlay |
08:07:26 | FromGitter | <alehander92> like nim / elm / typescript |
08:08:21 | FromGitter | <alehander92> but wasm is better for many things |
08:08:39 | FromGitter | <kayabaNerve> I never learned Typescript, ngl. |
08:08:51 | * | jjido joined #nim |
08:09:08 | FromGitter | <alehander92> well, its good |
08:09:09 | FromGitter | <kayabaNerve> I've been forced to move to Python which I absolutely hate. It's such a horrible language. |
08:09:15 | FromGitter | <alehander92> hm, have you used mypy |
08:09:18 | FromGitter | <kayabaNerve> I use it with two type checkers. |
08:09:21 | FromGitter | <alehander92> otherwise i loved python |
08:09:28 | FromGitter | <kayabaNerve> Yeah, PyRight, MyPy, and PyLint. |
08:09:30 | FromGitter | <alehander92> it was one of my first fav languages |
08:09:51 | FromGitter | <alehander92> i was so happy that my first "official" it job was python |
08:09:54 | FromGitter | <kayabaNerve> All of them pass too. I write amazingly clean Python code. |
08:10:02 | FromGitter | <alehander92> hm, which of them is best |
08:10:07 | FromGitter | <kayabaNerve> But it's also a horrible language I despise. |
08:10:11 | FromGitter | <alehander92> what do you dislike? |
08:10:18 | FromGitter | <kayabaNerve> Eh. PyLint is code cleanliness, not type checking. |
08:10:29 | GordonBGood | alehandler92: Fable/F3 -> JS? |
08:10:35 | GordonBGood | ^F# |
08:10:48 | FromGitter | <kayabaNerve> I prefer PyRight over MyPy. It generally covers more bugs although it does have a few false positives :/ I probably encounter one every 3 weeks. |
08:10:57 | FromGitter | <kayabaNerve> They do quickly respond to issues though. |
08:11:10 | FromGitter | <kayabaNerve> One of things I hate is import |
08:11:31 | FromGitter | <kayabaNerve> Without path manip, you can only import files (in the same project) which are next to you or below you. |
08:11:43 | FromDiscord | <minierolls> does anyone here have experience with winlean |
08:11:56 | FromGitter | <kayabaNerve> You have to set your code up as a package, run it with the namespace package flag, or use path manipulation to enable importing from anywhere in the project. |
08:11:59 | FromDiscord | <minierolls> wondering specifically about one function, readConsoleInput |
08:12:07 | FromGitter | <alehander92> GordonBGood maybe, i just never used it |
08:12:35 | FromGitter | <zacharycarter> `But it's also a horrible language I despise` - how do you like / not mind JS but despise Python? |
08:12:39 | FromGitter | <alehander92> @kayabaNerve well, its a bit annoying |
08:12:46 | FromGitter | <alehander92> but its not a dealbreaker imo |
08:13:05 | FromGitter | <kayabaNerve> I can look past the lack of type safety. |
08:13:19 | FromGitter | <alehander92> it pushes you to some module hierarchy |
08:13:31 | FromGitter | <zacharycarter> so what makes Python worse than JavaScript then? |
08:13:32 | FromGitter | <alehander92> which is not so bad: even when i do import ../../stuff |
08:13:38 | FromGitter | <alehander92> i feel a bit strange here |
08:13:44 | FromGitter | <alehander92> but i do it a lot i admit |
08:13:47 | FromGitter | <kayabaNerve> ... uhhhh you can't do that in Python without path manip |
08:13:52 | FromGitter | <alehander92> i know |
08:13:54 | FromGitter | <kayabaNerve> Yeah |
08:14:07 | FromGitter | <kayabaNerve> There's a reason I run my code as a namespace package. |
08:14:17 | FromGitter | <alehander92> well, you can easily write a function or something |
08:14:21 | FromGitter | <alehander92> which wraps import |
08:14:40 | FromGitter | <alehander92> but no idea how well it works with type checkers |
08:14:49 | FromGitter | <kayabaNerve> @zacharycarter Import system, *init* files, 2.7/3.0 split, type unsafety, snake casing, inconsistent naming/casing... |
08:15:08 | GordonBGood | alehandler92: Fable/F# is something like a more complex Elm but without the restrictions, mutability/OOP are options if you need/want them |
08:15:18 | FromGitter | <kayabaNerve> The only one of those issues with JS has is type unsafety, which I can look past. |
08:15:26 | FromGitter | <zacharycarter> yeah well - all of those things you'll see in JS as well |
08:15:45 | FromGitter | <kayabaNerve> My favorite example of inconsistency in Python are hex(int) and bytes.hex() |
08:15:48 | FromGitter | <alehander92> i like this_case , i admit that the lib might have some older naming issues but are passable , type unsafety is better than javascript: it uses strong typing at least |
08:15:52 | FromGitter | <zacharycarter> JS has weak typing which is arguably worse than no typing |
08:16:00 | FromGitter | <alehander92> and mypy etc should be kinda similar to typescript |
08:16:13 | FromGitter | <alehander92> but i admit i can see your point |
08:16:19 | FromGitter | <alehander92> i think you'll like ruby |
08:16:23 | FromGitter | <kayabaNerve> Python doesn't have typing at runtime without manual isinstance/of checks. |
08:16:30 | FromGitter | <kayabaNerve> Even type hints are discarded. |
08:16:47 | FromGitter | <zacharycarter> and as far as import systems / init files go - those are all third party in the JS world which is terrible because you end up with solutions like npm |
08:16:50 | FromGitter | <zacharycarter> which is absolute garbage |
08:16:58 | FromGitter | <zacharycarter> and babel / webpack |
08:17:03 | FromGitter | <kayabaNerve> JS doesn't have an import system I mind, never had init files, doesn't have a 2.7/3.0 split, does have type unsafety, generally isn't snake cased, and has far less inconsistency IMO |
08:17:15 | FromGitter | <kayabaNerve> I hate JS's package ecosystem. |
08:17:17 | FromGitter | <zacharycarter> it does have init files - RC files |
08:17:31 | FromGitter | <alehander92> @kayabaNerve well .. dynamic languages dont have runtime typing, not sure about your point |
08:17:34 | FromGitter | <zacharycarter> err wait config files, not in it files |
08:17:36 | FromGitter | <zacharycarter> init files |
08:17:40 | FromGitter | <alehander92> usually there exist third party libs for that too |
08:17:43 | FromGitter | <kayabaNerve> The only comparable thing I've seen to an init file is a package.json file |
08:17:45 | FromGitter | <zacharycarter> trust me - python may be a mess but JS is too |
08:17:57 | FromGitter | <zacharycarter> yes and in package.json files you can find horrors |
08:17:59 | FromGitter | <kayabaNerve> My issue with Python isn't that the root has an init file; it's that every single folder does. |
08:18:09 | FromGitter | <zacharycarter> well, that is dumb / annoying yes |
08:18:10 | FromGitter | <kayabaNerve> Yeah but there isn't a package.json in every single folder. |
08:18:15 | FromGitter | <zacharycarter> it can be if you want it to be |
08:18:22 | FromGitter | <kayabaNerve> They wouldn't do anything |
08:18:36 | FromGitter | <kayabaNerve> Namespace Packages should've been packages. |
08:19:06 | FromGitter | <alehander92> GordonBGood yeah i imagine it as ocaml |
08:19:41 | FromGitter | <alehander92> i think python is passable |
08:19:53 | FromGitter | <alehander92> those issues are easy to get a workaround for |
08:20:02 | FromGitter | <alehander92> and it has some consistency + ok metaprogramming |
08:20:03 | FromGitter | <kayabaNerve> I understand JS's detractions. I'm just saying I like writing servers in NodeJS. I won't comment on frontend JS though as I've never been a frontend dev and I consider most frontend tech to be f*ed. |
08:20:29 | FromGitter | <kayabaNerve> I believe Python is horrible all around for several reasons, and only one of those reasons exists in JS IMO (the typing). |
08:20:57 | FromGitter | <kayabaNerve> @alehander92 Yeah, I use three separate checkers and run in a non-default setup (namespace packages via -m) |
08:21:27 | FromGitter | <kayabaNerve> Those are my workarounds :P |
08:21:32 | FromGitter | <kayabaNerve> Nim is great though |
08:21:50 | FromGitter | <alehander92> but i'd say some things are missing in javascript |
08:22:01 | FromGitter | <kayabaNerve> I'm only using Python because I need to test my protocol with a second system. I don't trust Nim to test Nim. |
08:22:03 | FromGitter | <alehander92> weaker metaprogramming, almost no stdlib |
08:22:10 | FromGitter | <kayabaNerve> I wouldn't trust C to test C either. |
08:22:17 | FromGitter | <alehander92> worse syntax |
08:22:35 | FromGitter | <alehander92> i use python to script gdb mostly |
08:22:36 | FromGitter | <alehander92> these days |
08:22:39 | FromGitter | <kayabaNerve> The NodeJS stdlib is good enough. Again, I'm a backend dev :P |
08:22:51 | FromGitter | <alehander92> and it's fine, i like the fact its kinda similar to nim at least syntactically |
08:22:56 | FromGitter | <kayabaNerve> I'm not referring at all to frontend JS. I consider all frontend tech horrible. |
08:23:06 | FromGitter | <alehander92> but i admit i need to start using mypy again |
08:23:07 | FromGitter | <kayabaNerve> Yeah, I don't mind Python's structure. |
08:23:25 | FromGitter | <kayabaNerve> *and PyRight and PyLint? |
08:23:32 | FromGitter | <alehander92> well, i dont see so much need |
08:23:38 | FromGitter | <alehander92> for three type checkers :P |
08:23:44 | FromGitter | <kayabaNerve> *2 and a linter |
08:23:47 | FromGitter | <alehander92> i mean, i am currently doing ok with 0 |
08:23:54 | FromGitter | <alehander92> "kinda" ok |
08:23:58 | FromGitter | <kayabaNerve> Again. PyLint is cleanliness. PyRight and MyPy and type checkers. |
08:24:12 | FromGitter | <alehander92> yes * |
08:24:20 | FromGitter | <alehander92> i planned doing a python backend similar to the javascript one for nim |
08:24:22 | GordonBGood | alehandler92: Fable/F# is much better than OCaml as in easier to use once you adapt to Functional Programming |
08:24:26 | FromGitter | <alehander92> but i realized this is too much |
08:24:26 | FromGitter | <kayabaNerve> I do prefer PyRight to MyPy though. Much better output, covers more things, occasionally has a false positive. |
08:24:34 | GordonBGood | which is also needed for OCaml |
08:24:57 | FromGitter | <kayabaNerve> I wonder if you could do Nim to Python without an AST. |
08:25:00 | GordonBGood | Fable/F# is much more consistent syntax |
08:25:12 | FromGitter | <kayabaNerve> Eh. You need one for variable syntax/macros. |
08:25:14 | GordonBGood | Better type handling |
08:25:19 | FromGitter | <alehander92> alehander92: interesting, i am fine with nim for frontend for now, i am interested in functional for systems tuff mostly |
08:25:28 | FromGitter | <alehander92> @kayabaNerve well it doesnt make sense imo |
08:25:34 | FromGitter | <alehander92> we already have the compiler frontend |
08:25:37 | FromGitter | <alehander92> its easier |
08:25:43 | FromGitter | <alehander92> to reuse it |
08:25:50 | FromGitter | <kayabaNerve> It was a random thought, not a suggestion :P |
08:26:12 | FromGitter | <alehander92> but its better to improve nim so it can be used instead of python |
08:26:17 | FromGitter | <alehander92> yeah :P |
08:26:31 | FromGitter | <alehander92> i also plan on patching gdb directly with some c/nim based code |
08:26:44 | FromGitter | <alehander92> and seeing if that's somehow efficient |
08:26:46 | FromGitter | <kayabaNerve> Though I do support more Nim compilers. I at least a 100% nlvm which works on all three major kernels. |
08:26:58 | FromGitter | <kayabaNerve> *at least want |
08:27:44 | FromGitter | <kayabaNerve> `~95% of all upstream tests - most failures can be traced to the standard library and compiler relying on C implementation details - see skipped-tests.txt for an updated list of issues` |
08:27:51 | FromGitter | <kayabaNerve> `platforms: linux/x86_64, wasm32 (pre-alpha!)` |
08:28:03 | * | solitudesf quit (Ping timeout: 240 seconds) |
08:29:25 | FromGitter | <kayabaNerve> I question why they added wasm before Mac tbh. Maybe lack of dev hardware? |
08:30:59 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:31:05 | GordonBGood | I've converted to Nim because one can output JS for frontends, asm.js or WASM for "better" web pages, hative for just about every platform including iOS and Android |
08:31:11 | FromGitter | <alehander92> GordonBGood: interesting, i am fine with nim for frontend for now, i am interested in functional for systems tuff mostly (i somehow replied to myself) |
08:31:24 | FromGitter | <alehander92> @kayabaNerve wasm /llvm is good yes |
08:31:31 | FromGitter | <alehander92> which project is this |
08:31:39 | FromGitter | <zetashift> I found that @alehander92 at yourself weird lool |
08:31:45 | * | lbart quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
08:32:12 | * | lbartoletti joined #nim |
08:35:34 | * | lbartoletti is now known as lbart |
08:38:08 | FromGitter | <alehander92> you gotta keep that convo going |
08:41:04 | FromDiscord | <++x;> He |
08:41:06 | FromDiscord | <++x;> He |
08:41:06 | FromDiscord | <++x;> He |
08:41:07 | FromDiscord | <++x;> He |
08:41:23 | GordonBGood | alehandler92: I use FP forms of code when I can, even in Nim if it doesn't impact performance (depending where it is in the code) |
08:41:45 | FromDiscord | <++x;> You guys need to go to sleep |
08:42:44 | FromDiscord | <++x;> I always like to tickle my feet |
08:42:46 | FromGitter | <alehander92> its 10 40 am |
08:43:09 | FromGitter | <kayabaNerve> LLVM is great. I really don't have an opinion on WASM. |
08:43:15 | FromDiscord | <++x;> Sometimes i even tickle my hands |
08:43:16 | FromGitter | <alehander92> GordonBGood i also like to do that: thats why i hope we get inline iterator chaining sooner |
08:43:23 | FromDiscord | <++x;> Just to get the nerves rushing |
08:43:28 | FromDiscord | <++x;> Pumping the blood |
08:43:42 | FromGitter | <kayabaNerve> The project I quoted is NLVM. It's not 100% compatible or usable on Windows, Mac, and Linux. |
08:44:04 | FromGitter | <alehander92> ah yeah we can always ask @arnetheduck |
08:44:25 | FromGitter | <alehander92> i guess they have priority for wasm currently |
08:44:41 | FromGitter | <alehander92> so probably thats why its linux, wasm before mac |
08:45:08 | GordonBGood | alehandler92: In some ways, F# would be my favorite language if it output efficient native code, but it likely never will, being tied to DotNet including Core |
08:45:20 | * | thomasross quit (Remote host closed the connection) |
08:45:21 | FromGitter | <alehander92> narimiran also likes f# a lot |
08:45:24 | narimiran | yep |
08:45:27 | FromGitter | <alehander92> i also preferred going with ocaml |
08:45:31 | FromGitter | <alehander92> because of the .net thing |
08:45:36 | GordonBGood | But Alphonsa has done an incredible job adapting it to output JS through Babel |
08:45:45 | * | thomasross joined #nim |
08:45:46 | narimiran | yeah, i'm now giving ocaml a try |
08:45:56 | GordonBGood | Oh, Net's not so bad - open source now |
08:46:16 | * | floppydh joined #nim |
08:46:59 | GordonBGood | F#/Fable is like a grown up OCcaml, but don't output native code, unfortunately |
08:47:23 | narimiran | ocaml and F# are very similar, but i still like F# more (it feels/looks more elegant), and i might give it another try when .net core matures a bit more and i can use it more easily on linux |
08:47:40 | Kevin- | I refer to Kotlin also except Nim |
08:48:04 | Kevin- | dotnet core on linux look good ? |
08:48:15 | Kevin- | I never try it before |
08:48:34 | narimiran | Kevin-: people keep saying that for .net core 3, but my experience was with 2.x |
08:48:38 | FromGitter | <alehander92> yeah .net isnt so bad, but i started getting used to native compilers |
08:48:52 | GordonBGood | Kotlin is definitely an immense improvement over Java, but which somebody made a "F# for the JVM" instead |
08:49:05 | narimiran | ocaml's utop is an excellet REPL, btw |
08:49:16 | FromGitter | <alehander92> many people really like clojure btw, but i admit its pretty different kind of lang |
08:49:17 | PMunch | GordonBGood, have you tried Clojure? |
08:49:42 | GordonBGood | Now we're up to stable DotNet 3.0, with continuing support guarantees |
08:49:49 | GordonBGood | API guarantees |
08:49:56 | PMunch | Clojure is really nice, but the JVM is just too big of a limitation for some things |
08:50:12 | Araq | did Ocaml get this new improved syntax skin? |
08:50:20 | FromGitter | <alehander92> reason? |
08:50:38 | PMunch | There was this little language: https://github.com/pixie-lang/pixie which looked really promising, but ultimately it just fizzled out |
08:50:46 | FromGitter | <alehander92> ah yeah thats another javascript replacement i forgot |
08:50:49 | FromGitter | <alehander92> https://reasonml.github.io/ |
08:51:10 | GordonBGood | Yes, I did most "kind-of" FP languages, including a bit of List, a lot of Scheme, some Racket, and finally Clojure a few years ago. Clojure is dynamic typing... |
08:51:50 | FromGitter | <alehander92> yes it is but it has core.typing iirc |
08:52:00 | FromGitter | <alehander92> core.typed * |
08:52:17 | GordonBGood | One can get used to nesting round brackets everywhere with the help of a good editor, but still... |
08:52:42 | PMunch | Yeah, I looked at some of my old Clojure code and had to scroll horizontally.. |
08:53:03 | PMunch | Ugh, wrapping this C code is so horrible.. Why couldn't nimterop just work.. |
08:53:06 | FromGitter | <alehander92> i remember i did some clojure in uni as well, it seemed ok |
08:53:15 | FromGitter | <alehander92> but i also dont like lisps so much now |
08:53:25 | FromGitter | <alehander92> when i found out you can have good metaprogramming with other syntaxes |
08:53:45 | PMunch | So easy to mess up a type and have alignment issues when I do this manually.. |
08:54:14 | GordonBGood | alehandler92: yeah, dynamic typing, and the whole concept of "everything is a list" somehow seems totally wrong to me now |
08:54:39 | FromGitter | <alehander92> well, you can have typed lisps |
08:54:55 | GordonBGood | Yeah Typed Racket, for instance |
08:55:10 | FromGitter | <alehander92> the list idea is cool , but i'd see it in two ways: homoiconity and lists everywhere |
08:55:23 | FromGitter | <alehander92> and homoiconity can be almost done with other syntax iirc |
08:55:48 | GordonBGood | But that's JIT'ed/interpreted and slower than something like Gambit Scheme, which is "kind of" native code |
08:56:01 | FromGitter | <alehander92> well, i remember some very optimized schemes |
08:56:15 | FromGitter | <alehander92> which i think only did full inference |
08:56:18 | GordonBGood | Gambit Scheme is a tad slow due to handling daynaic typing |
08:56:26 | FromGitter | <alehander92> so it should be possible in principle |
08:56:48 | FromGitter | <alehander92> you can always write lisp like you write c with similar "types" and produce fast code |
08:57:10 | GordonBGood | possible in principle doesn't mean done in practice; most lispers love their dynamic typing |
08:57:27 | FromGitter | <alehander92> yeah |
08:58:28 | GordonBGood | alehandler92: faster, but almost never quite as fast as something like Nim; under the covers they are almost always dealing with the "any" supertype |
08:59:28 | Araq | the Lisps I studied were mostly like C's restrict keyword |
08:59:53 | Araq | "optimizer you can assume an array of ints here" but it's not a type system, no checking was done |
09:00:58 | PMunch | I can't shake the feeling that a type functional language would be very possible to optimise really wel |
09:01:22 | PMunch | The promises of a functional language means you can assume a lot more than you can in a procedural one |
09:01:48 | * | GordonBGood quit (Read error: Connection reset by peer) |
09:01:59 | FromGitter | <alehander92> well, many of them are |
09:02:04 | FromGitter | <alehander92> i wouldnt even say lisp is functional |
09:02:18 | FromGitter | <alehander92> because afaik many of the lisps use imperative stuff |
09:02:28 | FromGitter | <alehander92> compared to haskell/ocaml/etc |
09:03:42 | FromGitter | <alehander92> but i guess coding very close to the hardware might be still harder with such style |
09:05:06 | * | GordonBGood joined #nim |
09:05:28 | FromGitter | <funcmike_twitter> How is refc gc different from Swifts arc gc? |
09:05:48 | Araq | PMunch: yes and no, look at Haskell's deforestation optimization |
09:06:31 | Araq | but optimizing complex immutable data structures into mutable ones turned out to be very difficult |
09:08:00 | Araq | I personally don't see the benefits but that's just me. for example, I don't need to keep the history around of the bytecode that my peephole optimizer worked on |
09:08:28 | GordonBGood | alehandler92: yes, List's are said to be functional, and one can write mostly pure FP with discipline, but most List programmers don't worry too much about it when it suits them |
09:09:01 | Araq | or take the "count words in a file" example, there is no reason to use an "immutable" count table for this, it's masochism. |
09:10:17 | Araq | funcmike_twitter: it's "deferred" meaning that the stack refs are not counted for more speed. it's also thread local |
09:10:32 | GordonBGood | F# encourages "pure" by not making mutability so accessible generally, but when doing things like working with contents of arrays, it's mutabilitity all the way |
09:10:37 | Araq | so the remaining refcount operations are not atomic. |
09:10:52 | Araq | GordonBGood: yes, I noticed ;-) |
09:12:04 | Araq | mutability is fine when you restrict it a little, ideally via a unique path to the data |
09:12:33 | GordonBGood | Haskell (and it's cousins) might be said to be the only "pure" FP language, but one can still mutate by manipulating type classes through monads |
09:12:40 | Kevin- | where can we use Lisp for ? |
09:13:15 | FromGitter | <mratsim> Status is recruiting a Clojure dev at the moment and CLojure is very Lispy |
09:13:24 | FromGitter | <mratsim> we also hire Nim devs ;) |
09:14:27 | FromGitter | <mratsim> AFAIK games often used Lisp or Lua as an embedded scriptinglanguage |
09:14:36 | FromGitter | <funcmike_twitter> @Araq: what about cycle detection and mutlicore with refc? |
09:14:43 | GordonBGood | Kevin: "We" as in "Nim ppl" probably won't use List very much, but Clojure is likely the most practical "Lispy" out there as long as your product can run on the JVM |
09:15:45 | Araq | for cycle detection we use a backup mark&sweep GC. Multicore with refc is in the works, see my RFC about it, funcmike_twitter |
09:17:39 | GordonBGood | funcmike_twitter: just to fill you in: Araq is talking what --gc:destructors will give us, and the RFC is: https://github.com/nim-lang/RFCs/issues/177 |
09:17:55 | PMunch | Well the benefit of immutability is more because it's easier to reason about. I get a result from you, and I know that it won't change. I can keep that copy for as long or as short as I like, and I know that it won't change. There's just something nice about that |
09:18:05 | PMunch | That was to Araq by the way :P |
09:19:00 | FromGitter | <mratsim> atomic refcounting is a clutch though, if you need to share a whole data structure between threads your scalability will be *severely* limited |
09:19:01 | Araq | that's very hand-wavy, who knows if you just described the lack of aliasing |
09:19:16 | FromGitter | <mratsim> persistent data structure included |
09:19:25 | GordonBGood | When that becomes default, life with Nim will be beautiful, only improved further when --newruntime (whatever that will become) comes into its own |
09:19:35 | FromGitter | <funcmike_twitter> Ok thx |
09:19:56 | Araq | mratsim: I'm aware of the performance problems but I'm out of ideas |
09:20:10 | FromGitter | <mratsim> it's fine to provide it |
09:20:24 | Araq | tasks rely on closures and refs and inheritance and we must be able to share them |
09:20:45 | Araq | inside the task you can do the crazy custom seqs stuff avoiding 'ref' altogether |
09:21:00 | FromGitter | <mratsim> then the community will write some shared hash table for example. But others will write article on how to approach a parallel problem |
09:21:20 | Araq | here is how I see it: |
09:22:18 | * | GordonBGood_ joined #nim |
09:22:20 | Araq | refcounting is a pretty bad algorithm when you have many shortlived, pointer heavy things. but the hardware hates pointer heavy things and they are already slow. |
09:23:01 | * | GordonBGood_ quit (Client Quit) |
09:23:04 | Araq | at least refcounting is independent of the involved heap sizes, so as you make your object bigger in attempt to please your caches |
09:23:24 | * | GordonBGood_ joined #nim |
09:23:31 | Araq | refcounting fewer, bigger objects starts to be a good strategy |
09:23:46 | * | GordonBGood_ quit (Client Quit) |
09:23:57 | FromGitter | <funcmike_twitter> So my last question for now is :) which gc (stable) should i use for starting with Nim, with async and multicore support - possibly better then Gos gc - with manual memory mgmt capabilities? |
09:24:20 | * | GordonBGood_ joined #nim |
09:24:21 | FromGitter | <mratsim> boehm |
09:24:30 | Araq | start with the default GC and async, use something like httpbeast for multicore |
09:24:31 | * | GordonBGood_ quit (Client Quit) |
09:24:48 | * | GordonBGood quit (Read error: Connection reset by peer) |
09:24:51 | FromGitter | <mratsim> manual memory management is always possible with any GC |
09:24:55 | Araq | if you need a shared heap use boehm until --gc:destructors is ready |
09:24:58 | FromGitter | <mratsim> just don't use ref |
09:25:30 | Araq | mratsim: ref is a building block, you can use fewer refs but avoiding it altogether is neither wise nor required |
09:25:31 | FromGitter | <mratsim> (and seq and strings until destructors land but well it's hard to avoid them) |
09:25:33 | * | a_b_m joined #nim |
09:25:55 | FromGitter | <mratsim> I meant don't use a ref types where you don't want GC operations |
09:26:06 | * | GordonBGood joined #nim |
09:26:29 | FromGitter | <mratsim> I mix and match ref and raw pointers freely in my high performance libraries depending on my use-case. |
09:26:54 | Araq | mratsim: yeah but you don't *start* with this ;-) |
09:27:17 | Araq | you do this once you understand all the details and *if* you need it |
09:27:18 | FromGitter | <mratsim> of course |
09:28:02 | * | a_b_m quit (Client Quit) |
09:28:29 | GordonBGood | mratsim, it's really hard to eliminate ref's if your code uses closures - you can emulate closures using pointers but it's not easy |
09:29:19 | Araq | it's actually easier then you would think with the undocumented .liftLocals transformation, but yeah, better not go there |
09:30:03 | GordonBGood | Araq, wow, that sounds tempting (but I better not go there) ;) |
09:32:04 | FromGitter | <mratsim> OK, so by the way, when you have your threading API RFC I have some topics I want covered: ⏎ ⏎ 1) waiting on a local barrier object ⏎ 2) exportc name: I want JIT-ed code to be able to hook into the Nim multithreading capability ⏎ 3) being able to switch scheduler: real-time system will want a latency optimised runtime with early tasks first instead of a throughput optimized runtime ... |
09:32:04 | FromGitter | ... [https://gitter.im/nim-lang/Nim?at=5dc3e4942f8a0343574f4efd] |
09:33:01 | FromGitter | <mratsim> @GordonBGood, yeah I know, I need to emulate closures for my runtime :/ for now I ask the dev to pass all arguments to the spawn call and they are deep-copied |
09:33:21 | FromGitter | <mratsim> but I can't replicate the "parallel" block or OpenMP syntax for for-loop that way |
09:34:04 | FromGitter | <mratsim> and ideally I don't introduce a closure for tasks, just {.nimcall.} + a serialized closure environment |
09:34:47 | FromGitter | <mratsim> see: https://github.com/mratsim/weave/blob/master/picasso/workstealing_types/sync_types.nim#L59-L60 |
09:35:56 | * | uu91 quit (Ping timeout: 240 seconds) |
09:37:03 | * | uu91 joined #nim |
09:37:15 | * | fredrik92 is now known as couven92 |
09:37:39 | * | Vladar joined #nim |
09:42:42 | GordonBGood | with --gc:destructors, there is no deepCopy :) |
09:42:57 | GordonBGood | Yes, I've done something the same when I've needed to do so |
09:43:22 | FromGitter | <mratsim> now with liftLocals you have my attention :P |
09:44:18 | GordonBGood | mratsim, we aren't supposed to go there :) but there is a whole compiler file dedicated to that macro ;) |
09:44:34 | GordonBGood | ^that pragma |
09:45:17 | * | Hideki_ joined #nim |
09:45:40 | GordonBGood | but it's only 72 lLOC |
09:47:47 | FromGitter | <alehander92> what does it do |
09:48:57 | FromGitter | <mratsim> It would be nice to be able to replace this OpenMP syntax: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ and now the runtime can transform the for loop into a proc that takes x, y, len as parameter and the x, y, len are serialized. [https://gitter.im/nim-lang/Nim?at=5dc3e889e1c5e915084b88ae] |
09:49:52 | GordonBGood | and a file ../tests/fields/tfields.nim that shows how its used |
09:51:04 | GordonBGood | alehandler92: it appears to lift the pragmas arguments, including and/or limited to the proc arguments to which it is applied as a proc pragma |
09:51:40 | Araq | mratsim: I guess I'm only good at giving you the building blocks aka --gc:destructors/newruntime |
09:51:59 | Araq | the rest is better done by you |
09:52:43 | Araq | but I might give you a rawthreads.nim file, a tiny wrapper over what the OS provides |
09:56:04 | GordonBGood | Araq: isn't that what what the current threads.nim already provides - a fairly think wrapper over the OS thread implementation? |
09:56:17 | GordonBGood | ^fairly thin |
09:58:50 | * | tklohna joined #nim |
10:00:20 | * | thomasross quit (Remote host closed the connection) |
10:00:44 | * | thomasross joined #nim |
10:01:41 | FromGitter | <mratsim> the current threads.nim is enough |
10:01:56 | * | MarderIII joined #nim |
10:02:34 | GordonBGood | I would worry to go "thinner" than threads.nim would be platform dependent |
10:02:34 | FromGitter | <mratsim> Ideally that's what the compiler/standard library should be about. There is only one you (well only one me as well). |
10:03:25 | FromGitter | <mratsim> provides building blocks, a standard API. I build my runtime, later someone else builds a latency optimized runtime for audio and embedded |
10:03:39 | FromGitter | <mratsim> anyone can choose between both seemlessly, and everyone is API |
10:04:02 | FromGitter | <mratsim> bonus, we have a stable C API for those and those can be used as a library. |
10:04:19 | FromGitter | <mratsim> (even though my main use case would be JITTed parallel code) |
10:04:46 | FromGitter | <mratsim> s/happy/API |
10:05:01 | FromGitter | <mratsim> well the other way around, but you catch my drift |
10:06:16 | * | azed joined #nim |
10:18:13 | * | snowolf quit (Ping timeout: 245 seconds) |
10:19:29 | GordonBGood | Araq: the other day you said that we are moving toward no RTTI "except where we must use it"; I've been thinking about that and wonder what cases "we must use it"? |
10:20:09 | GordonBGood | ref UncheckedArray[T], which has no size? |
10:20:43 | GordonBGood | ^no implicit size |
10:23:55 | FromGitter | <alehander92> interesting, i have to try it |
10:27:37 | Araq | GordonBGood: everywhere where C++ has to use a virtual destructor |
10:29:25 | GordonBGood | Araq, which for us is: not seq, not string, ref/ptr to certain types? |
10:29:49 | Araq | inheritable objects. that's it |
10:31:55 | GordonBGood | Ah, so any object that is of RootObj or is of such |
10:33:03 | Araq | yup |
10:33:19 | Araq | which is usually the foundation for a Task[T] type ;-) |
10:34:11 | FromGitter | <alehander92> started reading a |
10:34:15 | Araq | you want a single interface to an object that contains a variable number of captured variables, you need something like inheritance and virtual destruction |
10:34:18 | FromGitter | <alehander92> ffast-math comment about unrolling on hacker news |
10:34:23 | FromGitter | <alehander92> started sounding a bit familiar |
10:34:34 | FromGitter | <alehander92> saw "Nim" , looked at the name: mratsim |
10:34:35 | FromGitter | <alehander92> of course |
10:35:06 | GordonBGood | RootObj start with some minimum base RTTI and each inheritited object type must be "nested" to refer back to levels of RTTI above |
10:35:13 | GordonBGood | Araq: Okay, got it |
10:35:34 | Araq | will they ever fix HN's site not to suck for everything? |
10:35:50 | FromGitter | <alehander92> they have many clients |
10:35:56 | narimiran | Araq: they did, and it is called lobste.rs :P |
10:36:18 | FromGitter | <alehander92> its almost like a hello world in "write a custom simple website client " |
10:36:20 | GordonBGood | and see its use for unknkown numbers of coptures/interface fields |
10:36:55 | Araq | most real forum software doesn't derail into an indentation mess |
10:38:19 | Araq | it's fine I guess, it's for hackers, hackers don't understand good UIs or why you can control a server via a mouse even though the machine itself has no mouse attached to it. |
10:39:05 | FromGitter | <alehander92> i am trying to do ui this week araq its really hard dont laugh at me |
10:48:51 | * | Hideki_ quit (Ping timeout: 265 seconds) |
10:49:02 | * | Kevin- quit (Remote host closed the connection) |
10:56:54 | * | uu91 quit (Read error: Connection reset by peer) |
10:57:13 | * | uu91 joined #nim |
10:59:28 | * | uu91 quit (Read error: Connection reset by peer) |
11:00:20 | * | uu91 joined #nim |
11:03:37 | Araq | https://github.com/nim-lang/Nim/pull/12619 the future is here |
11:04:33 | * | Vladar quit (Quit: Leaving) |
11:05:24 | narimiran | `when version <= (NimMajor, NimMinor): body` |
11:05:28 | FromGitter | <kayabaNerve> `since` |
11:05:29 | narimiran | ummm, `>=`? |
11:05:34 | FromGitter | <kayabaNerve> Yeah, that seems backwards to me too lol |
11:09:15 | Araq | think about it |
11:11:57 | FromGitter | <alehander92> we can have a removed: (after, after) |
11:12:01 | FromGitter | <alehander92> or something like that |
11:12:52 | narimiran | Araq: i am thinking about it and to me `<=` is wrong. e.g. something will be available for 1.1, 1.0, 0.20, but not for 1.2, 1.3? |
11:13:01 | Araq | well I tested it |
11:13:02 | FromDiscord | <Chiqqum_Ngbata> Is since supposed to be removedSince or availableSince ? |
11:13:02 | narimiran | aaaaaaaaa |
11:13:06 | narimiran | i seee |
11:13:29 | narimiran | who writes conditionals like that? pfffft |
11:14:18 | FromGitter | <alehander92> i still dont get it |
11:14:34 | narimiran | `when (NimMajor, NimMinor) >= version` is the way i would do it, as it is more clear to me |
11:14:54 | FromGitter | <alehander92> but i still dont get it |
11:14:56 | narimiran | so: `since` is available since, @Chiqqum_Ngbata |
11:15:04 | FromGitter | <alehander92> isn't (1, 0) <= (1, 1) |
11:15:15 | FromGitter | <alehander92> so this means that the new procedure would be available in 1.0 |
11:15:17 | FromGitter | <alehander92> but not in 1.1 |
11:15:21 | narimiran | nope |
11:15:31 | FromGitter | <alehander92> huh |
11:15:40 | narimiran | e.g. you have some proc annotated with `{.since 1.5}` |
11:15:45 | FromGitter | <alehander92> is (1, 0) <= (1, 1) false |
11:15:49 | narimiran | this is `version` |
11:16:00 | narimiran | your Nim at this point is 1.0 |
11:16:19 | narimiran | so `version` is not less than (NimMajor, NimMinor). it is not available to you |
11:16:36 | FromGitter | <alehander92> but no |
11:16:41 | FromGitter | <alehander92> version *is* 1.5 |
11:16:50 | FromGitter | <alehander92> its a variable based on the pragma |
11:16:53 | narimiran | yeah |
11:17:05 | * | MarderIII quit (Ping timeout: 268 seconds) |
11:17:48 | FromGitter | <alehander92> ah i see |
11:18:00 | narimiran | (Araq is probably reading this discussion and laughing at us :)) |
11:18:24 | FromGitter | <alehander92> ok, i need to eat |
11:18:28 | FromGitter | <alehander92> sorry |
11:18:41 | narimiran | is that why? then i'm off to lunch too :) |
11:19:08 | FromGitter | <alehander92> i guess you can still have until: (1, 5) for deprecation |
11:19:13 | FromGitter | <alehander92> iirc somebody had that idea before |
11:19:24 | narimiran | we have "deprecated since" |
11:20:36 | FromGitter | <alehander92> after my thorough mathematical jounery with `since` i am not so sure anymore |
11:20:50 | FromGitter | <alehander92> i am going to just let math people deal with this stuff |
11:23:08 | FromDiscord | <arnetheduck> nlvm/wasm/llvm: I don't have a mac and even if I did, I don't have any interest to maintain it - will take patches - we experiment with wasm at status so I use nlvm as a playground to try things out sometimes (works pretty well) - I believe it would generally serve nim to drop the JS backend and go full wasm instead, in terms of focusing effort and reducing complexity @kayabaNerve @alehander92 |
11:24:59 | FromGitter | <alehander92> its ridicilously early in costa rica man |
11:25:43 | FromGitter | <alehander92> how much of the stdlib is supported in wasm btw |
11:36:33 | FromGitter | <mratsim> what are you doing in costa rica Alexander? |
11:39:03 | * | MarderIII joined #nim |
11:41:07 | * | MarderIII quit (Remote host closed the connection) |
11:41:48 | * | MarderIII joined #nim |
11:45:32 | * | Vladar joined #nim |
11:49:19 | FromGitter | <alehander92> sorry, i was making an uneducated guess about arne's location |
11:50:10 | * | ng0 joined #nim |
11:50:34 | * | rockcavera joined #nim |
11:50:45 | * | solitudesf joined #nim |
11:59:44 | * | azed quit (Quit: WeeChat 2.6) |
12:02:47 | * | MarderIII quit (Ping timeout: 276 seconds) |
12:05:13 | * | azed joined #nim |
12:09:50 | * | Hideki_ joined #nim |
12:13:06 | * | azed quit (Quit: WeeChat 2.6) |
12:14:29 | * | Hideki_ quit (Ping timeout: 276 seconds) |
12:17:05 | * | MarderIII joined #nim |
12:17:23 | * | MarderIII quit (Max SendQ exceeded) |
12:18:17 | * | MarderIII joined #nim |
12:18:27 | FromGitter | <zetashift> So what exactly is the difference between `method` and `proc`. I don't know much about dispatch and stuff, but a difference is that method is binded at runtime and proc at compile time? |
12:25:04 | FromDiscord | <Rika> yes |
12:26:56 | * | MarderIII quit (Quit: Leaving) |
12:44:48 | * | thomasross_ joined #nim |
12:44:48 | * | thomasross is now known as Guest90065 |
12:44:48 | * | Guest90065 quit (Killed (orwell.freenode.net (Nickname regained by services))) |
12:44:48 | * | thomasross_ is now known as thomasross |
12:49:50 | * | thomasross quit (Remote host closed the connection) |
12:50:18 | * | thomasross_ joined #nim |
12:50:18 | * | thomasross_ is now known as thomasross |
12:59:20 | * | nsf quit (Quit: WeeChat 2.6) |
13:10:20 | * | thomasross quit (Remote host closed the connection) |
13:10:44 | * | thomasross joined #nim |
13:14:22 | FromGitter | <alehander92> awesome example @deech |
13:14:34 | FromGitter | <alehander92> the type providers-like sample thing |
13:14:44 | FromGitter | <alehander92> ops this is from the forum https://www.youtube.com/watch?v=ElHi2h9Ho6M |
13:17:27 | * | eys joined #nim |
13:30:03 | * | adriano` joined #nim |
13:36:21 | FromDiscord | <Kiloneie> Are there only 3 ways of calling procedures or are there more ? https://play.nim-lang.org/#ix=2154 |
13:36:58 | Araq | you can also use named parameters |
13:37:15 | Araq | and you can put stuff in backticks |
13:38:43 | narimiran | hey @Kiloneie! i was wondering earlier today where have you gone and what happened to you and your videos |
13:39:43 | FromDiscord | <Kiloneie> Let's just say i got bored, and played way too many games D: |
13:40:00 | FromDiscord | <Kiloneie> Gotta work overtime now <.< |
13:40:14 | FromDiscord | <Kiloneie> Video views kept actually growing, so that's nice. |
13:40:26 | * | adriano` quit (Ping timeout: 265 seconds) |
13:42:52 | FromDiscord | <Kiloneie> Gaming for me is... well it's fun when im getting better and winning, when im not, im like what am i doing with my life... i don't think i can make anything out of that on YT or Twitch i just suck at talking. |
13:43:25 | FromGitter | <kaushalmodi> Araq: Yesterday, I boiled down the minimal reproducible example for that crash with GC enabled, to this: https://play.nim-lang.org/#ix=2158 |
13:44:18 | Araq | kaushalmodi: that means you didn't setup the stack handling properly, I think |
13:44:20 | FromGitter | <kaushalmodi> I tried using the compiled .so of that snippet with and without libnimrtl.so, but saw the same crash |
13:44:27 | FromGitter | <kaushalmodi> Araq: How do I do that? |
13:44:59 | FromGitter | <kaushalmodi> here's the crash when using libnimrtl.so: https://gitter.im/nim-lang/Nim?at=5dc38ff83f4ea333f2c531c8 |
13:45:27 | * | krux02 joined #nim |
13:45:27 | FromGitter | <kaushalmodi> here's the same crash when I do not use libnimrtl.so" https://gitter.im/nim-lang/Nim?at=5dc39052a4541815c8a352a1 |
13:45:32 | FromGitter | <zacharycarter> could always combine gaming and Nim |
13:45:55 | FromGitter | <alehander92> Kiloneie thats why you should upload them from time to time imo, when you have several prepared, you can than rest more |
13:46:02 | FromGitter | <alehander92> and views might still keep coming |
13:46:37 | FromGitter | <zacharycarter> I just can't stand watching video tutorials - I can read / scan documents faster than folks can talk. |
13:46:53 | FromDiscord | <Kiloneie> yeah i know |
13:47:13 | FromGitter | <zacharycarter> If the video has a table of contents, that's slightly better, but still overall textual tutorials are so much nicer. Unless there's a lot of visual interaction required for the given subject. |
13:47:23 | FromDiscord | <Kiloneie> i got frustrated with the amount of work it went into every video |
13:47:37 | FromDiscord | <Kiloneie> idk lots of people prefer video |
13:47:53 | FromDiscord | <Kiloneie> i do as well as long as the subject is difficult for me, otherwise like you said |
13:48:15 | narimiran | heh, when was it when we told you you need to keep the frequency down? and you were like "naah, guys, i'll be fine" :D |
13:48:30 | FromDiscord | <Kiloneie> i do it intentionally very slow and step by step, because i know some people will get lost at any time |
13:48:44 | FromDiscord | <Kiloneie> xD |
13:49:17 | FromDiscord | <Kiloneie> I gotta do something else other than watch YT or play games when not working on videos, that's the big one |
13:49:19 | Araq | I enjoy videos and articles fwiw |
13:49:21 | FromGitter | <kaushalmodi> Araq: In summary, I am compiling a .so from Nim code and using it in a host C application (not related to Nim). The .so only has exportc'd procs which are called from the host app. So how do I init the GC on the Nim side? Can I see an example of that somewhere? |
13:49:43 | Araq | you need to call NimMain or similar, it's exported for you |
13:50:54 | FromDiscord | <Kiloneie> Like how the deceased YouTuber once said TotalBiscuit to his followers when some said that it should be like a job and all, it really shouldn't if you want to keep doing it. |
13:51:50 | FromGitter | <kaushalmodi> Araq: OK, I need to map the signature of NimMain to SystemVerilog too then.. looking up its signature.. |
13:54:13 | * | Hideki_ joined #nim |
13:55:18 | * | Hideki_ quit (Remote host closed the connection) |
13:55:50 | FromGitter | <kaushalmodi> Araq: I was able to call NimMain from SV side.. but that did not help prevent the crash |
14:03:45 | * | ng0 quit (Remote host closed the connection) |
14:04:11 | * | disbot quit (Remote host closed the connection) |
14:04:54 | * | ng0 joined #nim |
14:24:13 | * | disruptek frowns. |
14:24:18 | PMunch | How do I free a pointer that I get from a C call in Nim ? |
14:25:17 | * | disbot joined #nim |
14:25:23 | disruptek | any way you want. |
14:26:02 | disruptek | disbot: do me a favor and just hang out in here; don't disconnect randomly. |
14:26:02 | disbot | on it. 👍 |
14:26:09 | disruptek | lol okay |
14:26:56 | PMunch | disruptek, helpful.. |
14:27:09 | PMunch | I think something else might be going on here though.. |
14:27:19 | shashlick | @PMunch you can wrap free |
14:27:36 | disruptek | bad things happen after you free it? |
14:28:38 | FromGitter | <mratsim> the C library should provide you with a free or delete function |
14:28:39 | PMunch | Well, it seems like bad things are happening no matter what I do.. |
14:28:50 | disruptek | story of my life. |
14:28:53 | PMunch | Haha |
14:29:12 | FromGitter | <alehander92> ansi_c ? |
14:29:28 | FromGitter | <alehander92> lib/system/ansi_c wraps malloc free etc |
14:29:28 | disruptek | i wouldn't free anything until you know memory corruption isn't the cause. |
14:29:57 | PMunch | alehander42, oh neat |
14:30:07 | PMunch | Well I have no idea what's going on.. |
14:30:08 | FromGitter | <alehander92> i am 92 now ! |
14:30:17 | FromGitter | <alehander92> i have to make a bot. |
14:30:35 | FromGitter | <alehander92> gdb it |
14:30:43 | FromGitter | <alehander92> watchpoints are a good tool |
14:30:45 | FromGitter | <mratsim> You should call it HAL |
14:30:50 | FromGitter | <mratsim> HAL92 |
14:31:18 | FromGitter | <alehander92> no, i have my own bot names arthur clarke |
14:31:31 | FromGitter | <kaushalmodi> Anyone? Can I see an example how NimMain from a linked Nim compiled .so is called in an external program? |
14:34:19 | PMunch | I think it's called by _init() |
14:34:54 | FromGitter | <kaushalmodi> My .so only has exported procs |
14:35:16 | FromGitter | <kaushalmodi> So from the host C appl I need to call "something" to init the GC |
14:35:36 | FromGitter | <kaushalmodi> I called the auto-exported NimMain, but that didn't make any difference |
14:35:39 | PMunch | dlopen will call _init in a dynlib before it returns |
14:35:44 | * | dddddd joined #nim |
14:35:48 | Araq | kaushalmodi: just a sec please |
14:35:55 | PMunch | Which I believe is set up to call NimMain |
14:36:11 | PMunch | Or maybe not :P |
14:36:15 | FromGitter | <kaushalmodi> Araq: OK |
14:36:27 | PMunch | This should really be documented better somewhere.. |
14:37:45 | FromGitter | <mratsim> Nim DLL usage really needs a blog post and/or an good doc/tuto |
14:38:09 | Araq | kaushalmodi: please check if NimMain ends up calling initStackBottomWith() |
14:38:27 | PMunch | I'd love to write one, but I haven't been able to piece together enough information to know exactly what's going on.. |
14:39:10 | PMunch | I mean, I am writing a so/dll right now that will be loaded by a C program. It works, but I have no idea if the GC is running properly.. |
14:40:26 | * | GordonBGood quit (Ping timeout: 240 seconds) |
14:40:56 | FromGitter | <kaushalmodi> Araq: How do I check that? Are there some debug functions I can call from the host C appl to verify that? |
14:41:19 | Araq | I would inspect the generated C code |
14:42:04 | FromGitter | <kaushalmodi> I'm away from the PC for few minutes (in a meeting), but last I checked, NimMain in see was probably calling that stack function |
14:42:20 | FromGitter | <kaushalmodi> Will paste a snippet of the generated NimMain soon |
14:42:28 | FromGitter | <alehander92> PMunch you should really run it under a debugger imo |
14:43:32 | PMunch | alehander92, ugh that would be a pain to set up.. |
14:44:14 | FromGitter | <mratsim> with —debugger:native, and breakpoint you should be able to use it |
14:44:28 | Araq | so ... I checked the produced code |
14:45:18 | PMunch | mratsim, how do I set a breakpoint in a dynlib before it is loaded? |
14:45:33 | Araq | and you don't have to call NimMain at all! |
14:45:39 | Araq | NIM_POSIX_INIT does it for you |
14:45:48 | PMunch | Yeah, that's what I thought |
14:46:07 | PMunch | Which is why I don't |
14:46:26 | PMunch | But since that's not actually documented anywhere I wasn't sure if the GC was even running at all |
14:46:30 | Araq | nim c -d:useNimRtl --app:lib tests/dll/server.nim |
14:46:31 | FromDiscord | <Chiqqum_Ngbata> What effect would calling NimMain() have |
14:46:50 | * | thomasross quit (Remote host closed the connection) |
14:46:51 | Araq | is what the testsuite uses and the tests are green on all major OSes |
14:46:57 | PMunch | What happens if you don't have -d:useNimRtl but it's the only Nim code that would run? |
14:47:01 | Araq | and the tests cover the GC |
14:47:14 | * | thomasross joined #nim |
14:47:16 | FromGitter | <kaushalmodi> Araq: then how do I proceed with that issue? |
14:47:27 | Araq | PMunch: then it should work too but it's pretty much unsuported, can't test everything |
14:47:34 | PMunch | A C program loading a Nim dynlib is what I'm doing. And I don't use -d:nimrtl |
14:47:38 | Araq | kaushalmodi: do you use -d:useNimRtl? |
14:47:48 | FromGitter | <kaushalmodi> I tried with and without, same crash |
14:47:55 | FromGitter | <kaushalmodi> (see the above gdb backtraces) |
14:48:13 | FromGitter | <kaushalmodi> one goes up to the markSweep.. proc in librlt |
14:48:32 | FromGitter | <kaushalmodi> another goes into the gc.nim packed as part of the .so compiled without nimrtl |
14:48:53 | FromGitter | <kaushalmodi> Araq: backtraces at https://gitter.im/nim-lang/Nim?at=5dc41fb4a9f0dc24852bce75 |
14:49:42 | Araq | does the C code use threads? |
14:51:42 | FromGitter | <alehander92> PMunch i think there was a way to add a breakpoint inline |
14:51:46 | FromGitter | <alehander92> maybe if you just add an interrupt |
14:51:48 | * | Hideki_ joined #nim |
14:51:49 | FromGitter | <alehander92> with inline assembly |
14:51:51 | FromGitter | <alehander92> this might work |
14:52:16 | FromGitter | <alehander92> https://stackoverflow.com/questions/3634124/why-does-int-3-generate-a-sigsegv-in-64-bit-instead-of-stopping-the-debugger |
14:53:04 | FromGitter | <kaushalmodi> Araq: I think, yes |
14:53:12 | PMunch | Oh wait, now everything works fine. I had just imported the C procedure wrong -_- |
14:53:18 | FromGitter | <kaushalmodi> the host C app probably uses threads |
14:53:27 | FromGitter | <alehander92> https://stackoverflow.com/a/49079078 |
14:53:30 | FromGitter | <alehander92> maybe a better one |
14:53:37 | Araq | then you need to call setupForeignThreadGC() in your .exportc proc |
14:53:40 | FromGitter | <kaushalmodi> it's a full blown commercial applicaton |
14:53:48 | FromGitter | <alehander92> ah good: still interesting to notice one can do similar thing to javascript's `debugger` |
14:53:57 | FromGitter | <kaushalmodi> Araq: do I call that in each exported proc? |
14:54:08 | Araq | yes |
14:54:14 | FromGitter | <kaushalmodi> thanks, let me try that |
14:54:16 | Araq | at least it can't hurt |
14:56:59 | * | Hideki_ quit (Ping timeout: 276 seconds) |
14:57:50 | FromGitter | <Vindaar> maybe also check what @yglukhov does in nimpy? https://github.com/yglukhov/nimpy/blob/master/nimpy.nim#L213-L219 and https://github.com/yglukhov/nimpy/blob/master/nimpy.nim#L994-L1009 |
14:57:50 | * | luis_ joined #nim |
14:58:20 | PMunch | alehander42, tried with {.emit: """__breakpoint(42);""".} and that crashes with an unassigned error on runtime :S |
14:58:26 | FromGitter | <kaushalmodi> @Vindaar I looked at that yest when rayman pointed it out |
14:58:33 | FromGitter | <kaushalmodi> but it is related to --threads:on |
14:58:38 | PMunch | Oh wait, that was for ARM.. |
14:58:44 | FromGitter | <kaushalmodi> does it mean I need to compile my .so with --threads:on? |
14:58:53 | FromGitter | <kaushalmodi> (some many new revelations today) |
14:59:21 | Araq | yeah, in fact, you do need --threads:on |
14:59:31 | FromGitter | <Vindaar> ok, I'm pretty cluesless on this too :) |
14:59:44 | FromGitter | <kaushalmodi> oh boy.. I forsee a big rabbit hole |
15:00:01 | FromGitter | <kaushalmodi> both threads and gc are foreign to me.. will try it out though |
15:02:26 | PMunch | alehander92, {.emit: """raise(SIGTRAP);""".} and an {.emit: """#include <signal.h>""".} worked like a charm with --debugger:native |
15:03:59 | PMunch | Would be neat if this was a nimble module with all the portable versions |
15:04:08 | * | ponyrider quit (Read error: Connection reset by peer) |
15:04:23 | FromGitter | <kaushalmodi> Araq: now I have http://ix.io/215v/nim and compiled with --threads:on, but the same crash |
15:04:23 | disbot | ^ play at https://play.nim-lang.org/#ix=215v 😏 |
15:05:20 | PMunch | disruptek, maybe we could have a !playground command to your bot that turns the last ix.io link into a playground link instead? |
15:05:35 | PMunch | A lot of Nim code snippets doesn't really make sense to run in the playground :P |
15:06:12 | Araq | kaushalmodi: what's your CPU/OS? |
15:06:21 | disruptek | it's as much for us as it is for a newbie posting links. |
15:06:22 | FromGitter | <kaushalmodi> 64-bit RHEL 6.8 |
15:07:16 | Araq | kaushalmodi: .exportc, cdecl |
15:07:20 | shashlick | It's not a callback is it? |
15:07:36 | Araq | but apart from that I'm running out of ideas, this should work :-( |
15:08:28 | * | luis_ quit (Ping timeout: 264 seconds) |
15:08:33 | shashlick | Why do you need to setup foreign gc - it's being called by pure C |
15:09:33 | FromGitter | <kaushalmodi> Araq: sorry, that also did not help.. here's the full bt from valgrind: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc433adbbdf5f17b420b9fc] |
15:10:25 | FromGitter | <kaushalmodi> I see many of these.. is that concerning?: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc433e13f4ea333f2c53234] |
15:15:15 | FromGitter | <alehander92> PMunch nice |
15:15:22 | FromGitter | <alehander92> i cant believe i havent used it much |
15:16:17 | FromGitter | <alehander92> you can even start such a program and attach to it with `attach -p ` |
15:16:25 | FromGitter | <alehander92> from what i read |
15:17:40 | FromGitter | <alehander92> currently you can use `raise` from posix |
15:18:16 | FromGitter | <alehander92> and SIGTRAP as well |
15:18:54 | FromGitter | <alehander92> so maybe you can do it without emit at least, but yeah we can do a `breakpoint()` experimental api |
15:19:10 | FromGitter | <kaushalmodi> Araq: In the backtrace, I see `/lib64/libpthread-2.12.so` |
15:19:30 | FromGitter | <kaushalmodi> Is there some pthread version dependency/mismatch that could be causing this? |
15:20:09 | * | PMunch quit (Quit: Leaving) |
15:21:08 | FromGitter | <kaushalmodi> The backtrace is leading to the last `gcMark` call in this snippet from gc_common.nim: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc436633f4ea333f2c5323b] |
15:22:45 | Araq | that's a false positive by valgrind |
15:22:57 | Araq | but also compile with -d:noSignalhandler |
15:23:11 | FromGitter | <kaushalmodi> trying *now* |
15:25:13 | FromGitter | <kaushalmodi> still the same crash and backtrace |
15:25:34 | FromGitter | <kaushalmodi> the signal handling is done by the host C app here, right? |
15:25:51 | Araq | yes |
15:25:57 | FromGitter | <Willyboar> @citycide are you here |
15:25:58 | FromGitter | <Willyboar> ? |
15:26:09 | FromGitter | <kaushalmodi> Araq: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc43791a4541815c8a352f9] |
15:26:26 | FromGitter | <kaushalmodi> something happens in libpthread and triggers the serror handler in the host app |
15:26:45 | Araq | i'm out of ideas, try --gc:boehm please |
15:29:38 | FromGitter | <kaushalmodi> If I do --gc:boehm, I get: ⏎ ⏎ > libdpi.nim(11, 7) Error: undeclared identifier: 'setupForeignThreadGc' |
15:30:57 | FromGitter | <kaushalmodi> ok.. so if I remove all the setupForeignThreadGc stuff and run with --gc:boehm, it works fine! |
15:31:03 | FromGitter | <kaushalmodi> what does this mean? |
15:31:24 | Araq | it means we still get the stack pointers wrong but I dunno why |
15:31:47 | Araq | the good news is that --gc:destructors doesn't have this problem |
15:32:03 | FromGitter | <kaushalmodi> is --gc:boehm production safe? |
15:32:07 | Araq | so please use --gc:boehm until --gc:destructors is ready |
15:32:10 | FromGitter | <kaushalmodi> (I have never used it) |
15:32:30 | Araq | --gc:boehm is production ready, it's covered by our test suite, I regularly use it with 'koch boot' |
15:32:40 | FromGitter | <zacharycarter> I wonder if that's a similar issue to what I was running into with hot reloading? |
15:32:48 | FromGitter | <kaushalmodi> seems like I might not even need --threads:on. -d:noSignalHandler |
15:32:53 | Araq | zacharycarter: most likely |
15:33:00 | * | tklohna quit (Ping timeout: 268 seconds) |
15:33:10 | Araq | yeah boehm is pretty robust against switches like these |
15:33:42 | FromGitter | <kaushalmodi> Araq: thanks for sticking through and helping with this |
15:34:00 | FromGitter | <zacharycarter> I think fowlmouth's libraries / code will remain infinitely useful forever |
15:34:05 | FromGitter | <kaushalmodi> let me know if there's anything I can provide further to help debug the root cause |
15:34:15 | FromGitter | <kaushalmodi> I can reproduce that crash 100% of the times with the default gc |
15:34:29 | FromGitter | <zacharycarter> I'm using his enet bindings and the helper module he wrote for creating packets |
15:34:34 | Araq | it's interesting but I would need access to the machine |
15:34:46 | Araq | and I'd rather spend the effort on --gc:destructors tbh |
15:34:59 | FromGitter | <kaushalmodi> Araq: ok |
15:35:16 | FromGitter | <kaushalmodi> Let me check with Cadence if I can get a temp license for you to try out |
15:35:31 | FromGitter | <kaushalmodi> .. to run their SV simulator |
15:36:00 | FromGitter | <kaushalmodi> the SV side code is pretty trivial: http://ix.io/215G |
15:36:01 | disbot | ^ play at https://play.nim-lang.org/#ix=215G 😏 |
15:36:12 | FromGitter | <kaushalmodi> ok disbot.. that was SystemVerilog |
15:36:26 | FromGitter | <kaushalmodi> anyone not knowing SV can read what it's doing |
15:36:48 | FromGitter | <kaushalmodi> the `imported_func` that I exporc from Nim is "import"ed into SV |
15:36:55 | disruptek | http://ix.io/215G/SV |
15:37:09 | disruptek | if you give it a type that isn't nim, the bot will ignore it. |
15:37:18 | FromGitter | <kaushalmodi> got it |
15:37:27 | FromGitter | <kaushalmodi> that link did not work, but this works: http://ix.io/215G/sv |
15:37:35 | disruptek | fwiw 😊 |
15:37:35 | shashlick | @kaushalmodi - how complex is your nim code here |
15:37:36 | FromGitter | <kaushalmodi> seems like ix.io is case sensitive |
15:38:12 | disruptek | they both work for me. |
15:38:19 | FromGitter | <kaushalmodi> shashlick: laughably uncomplex: http://ix.io/215I/nim |
15:38:19 | disbot | ^ play at https://play.nim-lang.org/#ix=215I 😏 |
15:41:33 | * | nsf joined #nim |
15:45:18 | FromGitter | <kaushalmodi> Here's the dummy code to reproduce that crash: https://github.com/kaushalmodi/nim-systemverilog-dpic/tree/master/gc_crash_debug |
15:46:18 | * | tklohna joined #nim |
15:55:33 | FromGitter | <kaushalmodi> Araq: I got a crash on boehm too, using a slightly more complex code. bt: http://ix.io/215R/text |
15:56:11 | FromGitter | <kaushalmodi> the above link renders weird with /text.. just remove that |
15:56:23 | Araq | bummer |
15:56:42 | Araq | so your stack is corrupt, do you use .bycopy for all your imported objects? |
15:57:45 | FromGitter | <kaushalmodi> the objects from SV to Nim are passed via pointer |
15:58:35 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc43f2bbbdf5f17b420ba12] |
15:59:16 | FromGitter | <kaushalmodi> the svOpenArrayHandle is an API .. it's basically a void* ptr |
16:00:18 | FromGitter | <kaushalmodi> it's a ptr to a dynamic array on SV side.. there another API to fetch each elem of that dyn array.. I get a ptr to each elem of that: ⏎ ⏎ ```arrElemPtr = cast[ptr XY](svGetArrElemPtr1(arrPtr, i))``` [https://gitter.im/nim-lang/Nim?at=5dc43f910725f61e9c80ce27] |
16:00:26 | FromGitter | <kaushalmodi> so I am not sure where to use bycopy |
16:01:25 | * | narimiran_ joined #nim |
16:01:59 | * | narimiran quit (Ping timeout: 250 seconds) |
16:05:36 | FromGitter | <kaushalmodi> Araq: I wrap that SV API header file using nimterop to generate this: http://ix.io/215T |
16:06:07 | FromGitter | <kaushalmodi> I see that .bycopy. is not auto-inserted there.. would it be correct to blindly add .bycopy. everywhere? |
16:06:15 | disbot | ^ play at https://play.nim-lang.org/#ix=215T 😏 |
16:09:38 | Araq | pretty much yeah, every imported object should by .bycopy |
16:09:51 | Araq | you're right that it probably won't change things but it also doesn't hurt |
16:11:00 | disruptek | nimph search via github query syntax: http://ix.io/215U |
16:11:01 | disbot | ^ play at https://play.nim-lang.org/#ix=215U 😏 |
16:11:18 | disruptek | disbot: quiet down, young'un. |
16:11:19 | disbot | on it. 👍 |
16:13:40 | Araq | kaushalmodi: what *else* is valgrind reporting? |
16:13:53 | Araq | usually the real problem is also in its log |
16:14:03 | Araq | not only false positives |
16:16:02 | * | floppydh quit (Quit: WeeChat 2.6) |
16:17:41 | Araq | say what you want but '.since' is sexy, https://github.com/nim-lang/Nim/pull/12600/files |
16:17:56 | Araq | esp the fact that it's a 3 line implementation |
16:18:02 | FromGitter | <kaushalmodi> Araq: brb in 10 mins |
16:18:37 | disruptek | Araq: does it work with tuples of len 3? |
16:18:54 | Araq | no because semver |
16:19:01 | disruptek | it should get special doc handling. |
16:19:14 | Araq | indeed but then its simplicity is lost |
16:19:28 | Araq | but yeah, it needs docgen support |
16:19:50 | disruptek | splitPath was a pretty damaging change considering it was in a patch. |
16:19:55 | disruptek | also, the base64 change. |
16:20:20 | disruptek | i actually had to just copy the previous splitPath and use that to guarantee stability. |
16:20:33 | disruptek | not really the idea behind a stdlib... |
16:20:51 | Araq | ouch, I wasn't aware |
16:21:04 | Araq | we might need to revert this splitPath change then |
16:21:36 | disruptek | that's part of why i forked it into my codebase. 🤣 |
16:21:50 | Araq | anyway, the idea behind --useVersion:1.0 is a "best effort emulation", some minor things like base64 are acceptable for now |
16:22:41 | disruptek | well, anyway, since sounds good but while stuff breaks in patch-level releases, it's insufficient. |
16:22:44 | Araq | I was sceptical about splitPath but every "important package" was green as well as my compiler which is usually fragile about these things |
16:23:08 | disruptek | i think golden is broken too but i haven't looked at it. seemed more important to get aws apis working again. |
16:23:22 | * | Hideki_ joined #nim |
16:23:26 | Araq | so that's why I accepted splitPath. now you tell me I shouldn't have |
16:23:34 | Araq | raise your voice earlier please |
16:23:44 | disruptek | sorry, i was 8 days behind on `devel`. |
16:23:51 | Araq | :-) |
16:23:58 | * | Hideki_ quit (Remote host closed the connection) |
16:24:18 | Araq | but notice that devel is not a patch-level release |
16:24:28 | Araq | that would be the version-1-0 branch |
16:24:32 | * | Hideki_ joined #nim |
16:24:34 | disruptek | when this stuff goes in, it kinda needs to stay in. i just wish there'd be a deprecated version that was retained. |
16:24:59 | disruptek | there's some subtlety to splitPath, or my use of it, that was hard to grok. |
16:25:48 | Araq | I think I'll revert it, I personally dislike "yeah, let's break it, it's INCONSISTENT with something else, who cares about existing users" |
16:26:04 | Araq | everything is always inconsistent to something ffs |
16:26:17 | * | narimiran_ is now known as narimiran |
16:26:23 | FromGitter | <alehander92> consistency is cool |
16:26:25 | Araq | it's the most overrated word in programming. |
16:26:30 | FromGitter | <alehander92> what is inconsistent about splitPath |
16:26:33 | FromGitter | <alehander92> its really not |
16:26:34 | narimiran | btw, disruptek, i can ping you once 1.0.4 is ready for beta-testing |
16:26:55 | FromGitter | <alehander92> if you have an api where half of the case are function(path, line) and function(line, path) its just confusing |
16:27:00 | Araq | in C# land there is .Length vs .Count vs .Count() and yet it survives |
16:27:03 | FromGitter | <alehander92> yeah autocomplete and types help |
16:27:07 | FromGitter | <alehander92> but its just confusing |
16:27:15 | disruptek | narimiran: okie, but i actually require 1.1.1 for a lot of stuff now. i will try it for my public things. |
16:27:39 | disruptek | because nimph requires 1.1.1 because of compiler fixes... 🙂 |
16:27:49 | FromGitter | <kaushalmodi> > *<Araq>* we might need to revert this splitPath change then ⏎ ⏎ I did have my reservations on that PR and pinged @timotheecour .. but looks like he's been away for a while |
16:28:05 | FromGitter | <alehander92> btw krux02 |
16:28:09 | narimiran | he's not the authority ;) |
16:28:20 | FromGitter | <alehander92> those bugs with csize for one of the modes i got them |
16:28:24 | FromGitter | <alehander92> with os:standalone |
16:28:26 | FromGitter | <alehander92> as well |
16:28:29 | FromGitter | <alehander92> iirc |
16:28:59 | disruptek | maybe take a look at sigv4 package and see if you want it in important packages. it's very tiny, though. but it would at least ensure that aws signing doesn't break. |
16:29:07 | * | Hideki_ quit (Ping timeout: 265 seconds) |
16:29:21 | Araq | disruptek: did your tests catch it? |
16:29:25 | disruptek | yep. |
16:29:49 | Araq | interesting. Do you happen to misuse os procs on URLs? :P |
16:29:59 | disruptek | but i released a new version with safeSplitPath, so it won't notice if you roll splitPath back. |
16:30:10 | Araq | yeah I understand |
16:30:46 | disruptek | os path procs are just string manipulation procs. 😁 |
16:32:10 | FromGitter | <kaushalmodi> narimiran: He was the most active person in defining and discussing all the path splitting use cases |
16:34:02 | disruptek | Araq: fwiw, the base64 change broke google api signing. nim-jwt is the relevant package there. |
16:34:13 | Araq | :-( |
16:34:17 | Araq | bummer |
16:34:33 | Araq | but at least that one was marked as "unstable API" |
16:34:54 | Araq | does it work now? |
16:35:23 | disruptek | since i PR'd it, yes. though i had to patch it twice because nim grew to be 1.1.0 while my patch was under review. |
16:35:43 | disruptek | and afaik, treeform is the only person using my google api code. |
16:35:47 | disruptek | you just can't make this stuff up. |
16:40:24 | FromGitter | <kaushalmodi> Araq: the full valgrind log: http://dpaste.com/01XD7M4 .. but when I run the SV compiler with its -valgrind option, the crash doesn't happen :/ |
16:40:41 | Araq | I know one other party *very* interested in this code, disruptek. |
16:41:10 | disruptek | how mysterious. |
16:41:17 | FromGitter | <kaushalmodi> Without valgrind, the crash happens after the "Saving plot .." line: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc4492da4541815c8a35316] |
16:42:10 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc449623f4ea333f2c53278] |
16:42:40 | * | tklohna quit (Ping timeout: 264 seconds) |
16:43:04 | * | tklohna joined #nim |
16:43:49 | Araq | Warning: client switching stacks? SP change: 0x7feff3140 --> 0xf32fc00 |
16:44:15 | * | nsf quit (Quit: WeeChat 2.6) |
16:44:26 | Araq | never seen a warning like this before, this C code is doing dangerous crap |
16:45:22 | Araq | Invalid read of size 8 |
16:45:22 | Araq | ==2218== at 0x62EED50: ??? |
16:45:26 | * | Vladar quit (Quit: Leaving) |
16:45:33 | Araq | ^ looks like you're in serious trouble |
16:47:04 | FromGitter | <kaushalmodi> looks like the host C app is doing the switching stacks thing |
16:47:22 | FromGitter | <kaushalmodi> and then the switching reverts after the Nim code finishes? running |
16:47:27 | FromGitter | <kaushalmodi> and that's where the crash happens |
16:47:50 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc44ab66570b076740f773a] |
16:49:45 | Araq | switching stacks is not C btw as C has no idea about the involved runtime stacks |
16:49:45 | disruptek | more irony: nimble breaks on my --define:key:val fix. |
16:50:28 | Araq | so we are not dealing with "C code" here but with something else |
16:51:11 | Araq | if you are on devel, please give --gc:destructors a try |
16:51:32 | Araq | it's in development but it's the only GC that doesn't trace the stack |
16:51:40 | Araq | so maybe you're lucky and it works for you already |
16:52:11 | disruptek | shashlick: this means i can't install nimgit2 with nimble. also, it doesn't work in nimble anyway because it's still looking for a doc directory that doesn't exist when nimble is performing the installation. |
16:52:12 | FromGitter | <kaushalmodi> > Error: unhandled exception: liftdestructors.nim(332, 14) `t.assignment != nil` [AssertionError] |
16:52:14 | * | clyybber joined #nim |
16:52:26 | FromGitter | <kaushalmodi> I am unlucku :/ |
16:52:33 | FromGitter | <kaushalmodi> s/unlucku/unlucky |
16:52:47 | Araq | how to reproduce? |
16:54:13 | FromGitter | <kaushalmodi> it's not giving a full backtrace. that's the only error.. let me figure out how it can be reproduced.. right now it used svdpi.nim which requires svdpi.h |
16:55:14 | FromGitter | <kaushalmodi> I ran another arbitrary code and I got: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ but that also uses svdpi.nim [https://gitter.im/nim-lang/Nim?at=5dc44c71a9f0dc24852bcebf] |
17:03:15 | Araq | oh I wasn't aware you use xml and stuff |
17:03:38 | * | NimBot joined #nim |
17:04:13 | FromGitter | <kaushalmodi> that xml stuff is probably pulled in by other nimble packages |
17:04:51 | * | theelous3 joined #nim |
17:12:19 | shashlick | @disruptek - what's the issue? the CI seems to work |
17:12:33 | shashlick | is it looking for nimterop/doc |
17:12:52 | disruptek | yeah. |
17:18:11 | FromGitter | <kaushalmodi> Araq: Recipe for the above move[T] error: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Probably compiling just parsexml.nim will also do that, but I was just tracing why my "little" example failed.. because it was importing nimetry [https://gitter.im/nim-lang/Nim?at=5dc451d3a4541815c8a35321] |
17:18:28 | Araq | that one is already fixed |
17:18:37 | Araq | I'm interested in the AssertionError |
17:18:37 | FromGitter | <kaushalmodi> oh is it? |
17:18:49 | FromGitter | <kaushalmodi> ok, finding recipe for that now |
17:24:24 | FromGitter | <kaushalmodi> Araq: Here's the recipe: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ > fatal.nim(39) sysFatal ... [https://gitter.im/nim-lang/Nim?at=5dc45348a85791488f89617f] |
17:29:23 | * | Vladar joined #nim |
17:29:28 | shashlick | @disruptek - do you have nimterop installed? |
17:30:14 | shashlick | or is it failing during nimble install which should install deps |
17:30:24 | * | berndl joined #nim |
17:31:50 | shashlick | https://github.com/genotrance/nimgit2/blob/master/nimgit2.nimble#L18 should be helping - if not i need to look at it again |
17:31:54 | * | luis_ joined #nim |
17:32:14 | shashlick | i guess i'm not testing a clean install in travis |
17:32:58 | disruptek | i'm not sure how the .nimble should be written, or if it needs to be rewritten, to work with localdeps. |
17:33:18 | disruptek | i have to fix the compiler to accept a define of `0.28.3` first. 🙁 |
17:34:52 | shashlick | can you explain some details on the issue? |
17:36:02 | disruptek | Error: cannot open file: nimterop/docs |
17:37:31 | FromGitter | <kaushalmodi> import nimterop/docs is in nimterop.nimble |
17:37:38 | disruptek | yep. |
17:38:05 | shashlick | am testing on linux, a sec |
17:38:42 | disruptek | i wouldn't spend any time on it yet. |
17:39:29 | FromGitter | <kaushalmodi> fwiw, `nimble uninstall nimterop -i && nimble install nimterop` worked fine for me (RHEL 6.8) |
17:39:59 | FromGitter | <genotrance> gt@gt:~/programming/a$ nimble install nimgit2 --nimbleDir:abc ⏎ ⏎ ``` Info: Dependency on unicodedb@>= 0.7 already satisfied``` ⏎ ⏎ Verifying dependencies for [email protected] ... [https://gitter.im/nim-lang/Nim?at=5dc456ee9c39821509fe1e7d] |
17:40:26 | disruptek | yes; it's a localdeps thing -- that's why i suggest not working on it until i can offer something useful. |
17:40:49 | FromGitter | <mratsim> Seems like the most popular package manager written in Nim bit the dust: https://github.com/kitsunyan/pakku/pull/49 |
17:40:51 | shashlick | okay i'll hold off |
17:41:38 | * | nsf joined #nim |
17:41:47 | disruptek | written in a stillborn programming language? |
17:46:42 | disruptek | oh, --define:getSetVer2:"0.28.3" works. |
17:46:54 | disruptek | i'm just an idiot. |
17:47:19 | FromGitter | <kaushalmodi> or use config.nims :) |
17:47:32 | disruptek | no way. |
17:50:36 | clyybber | Araq: Huh, why does parsexml need this changes? |
17:50:59 | Araq | clyybber: 'move' is destructive, shallowCopy isn't |
17:52:35 | clyybber | Maybe it was too long since I last worked on nrt but didn't we keep the implementation so that move isn't destructive and we just insert wasMoved? |
17:53:18 | clyybber | Ah, sorry. Was mixing things up, I'm thinking about =sink |
17:54:24 | clyybber | Hmm |
17:54:53 | clyybber | Araq: Wouldn't it be better to change the parameter to sink T instead of var T? |
17:54:56 | shashlick | why do you need SetVer2? <= 2 |
17:55:03 | clyybber | We should still be able to move sink T parameters. |
17:55:19 | shashlick | you mean -d:git2SetVer? |
17:55:32 | disruptek | yeah. |
17:56:18 | Araq | clyybber: I considered it but I think 'var T' is better |
17:56:47 | Araq | it's a move, it's destructive, otherwise 'move(notLastRead)' would compile and produce a copy! |
17:56:58 | clyybber | Araq: It shouldn't matter unless you try to access the XmlParser after using rawData. |
17:57:03 | Araq | and then it would move the copy, never what I intended |
17:57:12 | clyybber | Ah ok. |
17:57:47 | Araq | it's pretty well designed now, if only the compiler was stable |
17:57:50 | clyybber | I didn't look too much into it. If mutating XmlParser is better than copying it in this then I wasn't aware |
17:57:59 | clyybber | Araq: Yeah its pretty cool. |
18:01:12 | lqdev[m] | is it safe to cast a `ptr T` for a `var T` when a proc expects that as a param? https://play.nim-lang.org/#ix=216y |
18:01:51 | disruptek | shashlick: does nimterop work for you in localdeps? it installs but i can't successfully run the tests, even with toast in my path. |
18:01:56 | Araq | lqdev[m]: yes |
18:03:18 | lqdev[m] | ah, good. |
18:03:20 | * | lritter joined #nim |
18:06:21 | clyybber | Araq: How can I quickly print an TLineInfo for compiler debugging purposes? |
18:07:56 | * | nc-x joined #nim |
18:08:04 | * | berndl quit (Quit: WeeChat 2.5) |
18:08:21 | nc-x | clyybber: just print its fields instead of the whole object iirc |
18:08:22 | * | rockcavera quit (Remote host closed the connection) |
18:10:27 | * | Trustable joined #nim |
18:11:04 | disruptek | shashlick: okay, seems to work perfectly if i set NIMBLE_DIR to the localdeps directory. |
18:11:07 | * | nc-x quit (Remote host closed the connection) |
18:12:33 | * | GordonBGood joined #nim |
18:17:11 | * | GordonBGood quit (Ping timeout: 276 seconds) |
18:17:46 | Araq | clyybber: c.config $ n.info |
18:18:05 | Araq | you need a ConfigRef but there is always one hanging around |
18:18:30 | clyybber | Thanks |
18:18:42 | clyybber | nc-x: Thanks, but I need the filename too :) |
18:22:32 | * | rockcavera joined #nim |
18:23:44 | FromGitter | <kaushalmodi> Araq: I rebuilt nim and now the parsexml error when using --gc:destructors is gone, but |
18:23:54 | FromGitter | <kaushalmodi> now I get this at run time: ⏎ ⏎ ```Saving plot to plot.png .. ⏎ [FATAL] unpaired dealloc``` [https://gitter.im/nim-lang/Nim?at=5dc461390725f61e9c80ce5c] |
18:24:06 | FromGitter | <kaushalmodi> there's no except.. just that print statement |
18:24:11 | FromGitter | <kaushalmodi> *exception |
18:24:28 | FromGitter | <kaushalmodi> and it's happening just where it crashes when using boehm |
18:24:38 | Araq | er |
18:24:46 | Araq | do you use 'ref' in your wrapper? |
18:24:53 | Araq | instead of 'ptr'? |
18:25:29 | FromGitter | <kaushalmodi> no: http://ix.io/216C/nim |
18:25:30 | disbot | ^ play at https://play.nim-lang.org/#ix=216C 😏 |
18:25:52 | FromDiscord | <mratsim> btw in the destructors spec, you don't talk about {.threadvar.} are destructors of thread-local variables inserted before a thread is joined? |
18:26:06 | FromGitter | <kaushalmodi> above error is without the -d:useGgplot |
18:26:15 | FromDiscord | <mratsim> it seems like for C++ it causes a lot of stack overflow issues |
18:26:18 | FromGitter | <kaushalmodi> with -dLuseGgplot, I get that assertion error |
18:27:33 | FromGitter | <kaushalmodi> Araq: to make it simpler, this is what I am running effectively: http://ix.io/216D |
18:27:34 | disbot | ^ play at https://play.nim-lang.org/#ix=216D 😏 |
18:28:43 | FromGitter | <kaushalmodi> The FATAL happens in line 63 |
18:28:55 | * | jjido joined #nim |
18:29:00 | FromGitter | <kaushalmodi> somewhere in the nimetry/flippy pkg when the file save is happening |
18:30:10 | FromGitter | <kaushalmodi> ok, you can recreate the FATAL using this same recipe above: https://gitter.im/nim-lang/Nim?at=5dc451d3a4541815c8a35321 |
18:31:27 | * | luis_ quit (Quit: luis_) |
18:31:53 | * | luis_ joined #nim |
18:39:47 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:42:11 | * | snwmzr quit (Remote host closed the connection) |
18:46:09 | Araq | kaushalmodi: compile with -d:useSysAssert -d:useGcAssert and the default GC please |
18:46:39 | shashlick | @disruptek so --cleanNimbleDir isn't working? |
18:46:44 | Araq | mratsim: uhm, they are not, good point |
18:47:18 | shashlick | Or you running nimble actually |
18:47:57 | disruptek | shashlick: everything works if you set NIMBLE_DIR. i'm just testing nimble; you can use nimble to install nimph. |
18:49:55 | * | fredrik92 joined #nim |
18:50:20 | * | couven92 quit (Disconnected by services) |
18:50:24 | * | fredrik92 is now known as couven92 |
18:50:41 | FromGitter | <kaushalmodi> Araq: With those defines and the default GC, I get the same crash: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc46781a4541815c8a3534a] |
18:50:45 | * | fredrik92 joined #nim |
18:56:26 | FromGitter | <kaushalmodi> woo! I can see more info in valgrind though: http://ix.io/216J/text |
19:05:51 | * | uu91 quit (Read error: Connection reset by peer) |
19:06:05 | FromGitter | <kaushalmodi> Araq: Here's what I see when using those defines and default GC with that earlier minimal Nim code: http://ix.io/216M/text |
19:06:10 | * | uu91 joined #nim |
19:06:42 | shashlick | Ok how about using nimbleDir |
19:06:46 | shashlick | It doesn't work? |
19:07:18 | * | eys quit (Quit: eys) |
19:07:19 | disruptek | no, probably because you have a gorgEx call to `nimble` which picks up the global env. |
19:08:31 | shashlick | I see ya, there's another issue from as @kaushalmodi where I don't propagate paths to child Nim processes |
19:08:59 | disruptek | oh yeah, the one his cow-orker ran into? |
19:09:02 | shashlick | Unless I can find out flags Nim was called with, no way to know that one |
19:09:11 | FromGitter | <kaushalmodi> disruptek: hah! yes :) |
19:09:15 | FromGitter | <kaushalmodi> my coworker is famous |
19:09:25 | disruptek | better than infamous. |
19:10:18 | * | uu91 quit (Ping timeout: 252 seconds) |
19:10:45 | * | uu91 joined #nim |
19:26:58 | * | clyybber quit (Quit: WeeChat 2.6) |
19:27:42 | * | rayman22201 quit (Quit: Connection closed for inactivity) |
19:31:32 | * | luis_ quit (Quit: luis_) |
19:37:05 | Araq | shashlick: oh look I have to look into ...nimble/pkgs/nimetry-0.4.0/nimetry.nim |
19:37:40 | Araq | kaushalmodi: can show me this file please? |
19:38:48 | shashlick | I'm benched, getting itchy though |
19:39:24 | shashlick | Thinking of redoing px in Nim with libcurl |
19:40:01 | shashlick | https://github.com/genotrance/px |
19:40:36 | shashlick | Too much work though |
19:40:51 | Araq | sorry, didn't want to annoy you |
19:41:14 | Araq | tried to prove my point, all the time I have to look at what is "hidden" away |
19:41:21 | * | rockcavera quit (Remote host closed the connection) |
19:45:12 | * | uu91 quit (Read error: Connection reset by peer) |
19:45:38 | * | uu91 joined #nim |
19:45:42 | shashlick | Not at all, just restless |
19:45:54 | FromGitter | <kaushalmodi> Araq: https://github.com/benjif/nimetry/blob/master/nimetry.nim |
19:48:47 | * | nif_ quit (Quit: ...) |
19:48:57 | * | nif joined #nim |
19:52:57 | * | jjido joined #nim |
19:59:52 | * | rockcavera joined #nim |
20:07:17 | zedeus | I recall "openArray" simply being a way to accept both seqs and arrays as parameters, but since openArray is all about borrowing/memory safety now, it causes issues with async |
20:07:19 | zedeus | https://play.nim-lang.org/#ix=2177 |
20:07:26 | zedeus | is there a way to solve this problem? |
20:12:18 | Araq | openArray always was a borrowed pointer and for async it must be put onto the heap |
20:12:24 | Araq | workaround: use a 'seq' |
20:15:14 | zedeus | so the workaround to use the nice `{key: val}` syntax is adding `toSeq` |
20:16:15 | zedeus | I guess it's worth noting the "Open arrays" part of the manual doesn't mention anything about being a borrowed pointer |
20:18:52 | Araq | well it is a (pointer, len) pair, it never was anything else |
20:19:09 | Araq | and the pointer doesn't own the memory, nowadays known as "borrowing" |
20:19:20 | Araq | when I wrote the manual Rust wasn't a thing. |
20:23:19 | Araq | it's not like "boo! no Rust in my Nim lang please!", we have comparable designs since forever in Nim and we too must refine them further. |
20:24:14 | FromGitter | <mratsim> we must borrow them further |
20:27:53 | Araq | even C# has the same problems, cannot have an 'out' parameter in an async function. |
20:28:32 | Araq | ultimately C#, Rust, C++, Nim are all the same language :P |
20:32:48 | * | GordonBGood joined #nim |
20:32:50 | * | thomasross quit (Remote host closed the connection) |
20:33:16 | * | thomasross joined #nim |
20:35:34 | * | nsf quit (Quit: WeeChat 2.6) |
20:45:50 | * | thomasross quit (Remote host closed the connection) |
20:46:15 | * | thomasross joined #nim |
20:52:03 | * | GordonBGood quit (Ping timeout: 265 seconds) |
20:52:11 | * | GordonBGood joined #nim |
20:53:40 | FromDiscord | <krab4t> with difference ` isNil is user-defined error ` |
20:55:24 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:57:52 | Araq | well if details matter then Nim is better :P |
20:58:50 | GordonBGood | Araq: Yup, Nim is getting much better :) |
20:59:09 | Araq | GordonBGood: I'm back at fixing destructor bugs |
20:59:15 | Araq | all RFCs have been written |
20:59:46 | GordonBGood | Araq: on the RTTI thing, if there is no RTTI except for RootObj derived things, they ref T finalizers go away? |
21:00:12 | Araq | finalizers are replaced by destructors, what else |
21:01:28 | GordonBGood | Araq: that's what I though - there will be a few rough edges to file off do do with the "new" overloads, but --gc:destructors is a major change anyway |
21:03:14 | GordonBGood | Araq: better read the latest RFC's; is there a list of changed ones |
21:03:26 | GordonBGood | Good you are back to destructors |
21:05:29 | GordonBGood | Araq; also missing repr, which I used to use quite a bit - can we re-write repr.nim to not depend on RTTI? |
21:19:50 | GordonBGood | Araq: I see the lent/var/openArray RFC but nothing else new? |
21:20:01 | * | Vladar quit (Quit: Leaving) |
21:20:34 | * | rayman22201 joined #nim |
21:28:59 | * | shashlic- joined #nim |
21:30:43 | * | narimiran quit (Ping timeout: 265 seconds) |
21:31:21 | Araq | well yes, I write one RFC per day, sorry |
21:33:02 | FromDiscord | <mratsim> For my need at the moment I wrap ptr objects in an object to have destructor (for object pooling), but it doesn't compose well with concepts, and I don't see how to write a clean "PtrLike" concept. Any ideas as simmple as "myConcept is ptr"? |
21:36:39 | GordonBGood | Araq: I just mean "where should we watch for the latest RFC's - https://github.com/nim-lang/RFCs/issues? |
21:39:07 | * | revere quit (Ping timeout: 250 seconds) |
21:44:56 | Araq | yes |
21:45:12 | * | revere joined #nim |
21:47:18 | * | clyybber joined #nim |
21:47:19 | * | crem quit (Ping timeout: 268 seconds) |
21:48:44 | * | crem joined #nim |
21:51:34 | GordonBGood | Okay, I'll watch that for updates |
21:51:50 | * | thomasross quit (Remote host closed the connection) |
21:52:17 | * | thomasross joined #nim |
21:58:28 | * | jjido joined #nim |
21:59:05 | * | Trustable quit (Remote host closed the connection) |
22:19:50 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:22:28 | * | solitudesf quit (Ping timeout: 268 seconds) |
22:28:15 | * | hemite joined #nim |
22:29:14 | hemite | The Nim Arch Linux packages seem fairly out of date. I was wondering if there were other Arch users here, and their solution to get a working Nim setup on their personal machines |
22:30:02 | * | FromGitter quit (Remote host closed the connection) |
22:30:21 | * | FromGitter joined #nim |
22:34:20 | zedeus | choosenim |
22:34:23 | * | shashlic- quit (Quit: ZNC 1.7.5 - https://znc.in) |
22:36:47 | * | shashlick_ joined #nim |
22:47:29 | FromGitter | <zetashift> I'm on Manjaro and use choosenim for all the nim setup stuff |
22:54:09 | rayman22201 | Araq are you online? |
22:54:48 | rayman22201 | Is anyone that has knowledge of the codegen online? |
22:54:57 | * | clyybber waves |
22:55:11 | rayman22201 | lol. hi clyybber |
22:55:19 | clyybber | Hi |
22:55:27 | rayman22201 | GDB and looking at the C code was helpful :-) |
22:55:30 | rayman22201 | https://github.com/nim-lang/Nim/blob/df4c339cfce15ccc5406bc7763eac4daf9b8c76f/compiler/ccgtrav.nim#L137 |
22:56:04 | rayman22201 | this is the proc that generates the "marker" proc for the GC mark pass |
22:56:17 | rayman22201 | if that makes sense? too much meta lol |
22:56:44 | rayman22201 | It looks like the marker function generated is basically a noop |
22:57:42 | rayman22201 | https://www.irccloud.com/pastebin/Zrahkco3/ |
22:58:33 | clyybber | hmm, what *should* it generate ideally? |
22:58:33 | rayman22201 | I'm pretty sure that proc should either free the memory, or at least "mark" it for freeing.... |
22:58:35 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
22:58:39 | clyybber | Ah okay |
22:59:00 | rayman22201 | the code that generates that proc is the first link I sent |
22:59:19 | rayman22201 | I appear to have hit some edge case where it's not generating the correct thing |
23:00:41 | rayman22201 | but I'm not sure exactly what it should look like |
23:02:57 | clyybber | Hmm, me neither |
23:05:53 | clyybber | rayman22201: Is this the result of your debugging? |
23:06:09 | clyybber | Because it is specific to mark and sweep afaict |
23:06:45 | rayman22201 | yes, correct. |
23:06:56 | rayman22201 | I'm using boehm, so that makes sense |
23:07:34 | rayman22201 | dispose can be ported to other GC schemes, but it's easier to test it in isolation with a known good GC. |
23:08:47 | clyybber | Hmm. So you test with mark and sweep? But you isolated the problem to somewhere that is not enabled with gcBoehm |
23:09:01 | clyybber | because afaict gcBoehm doesn't imply gcMarkAndSweep |
23:10:12 | rayman22201 | dispose triggers mark and sweep directly |
23:10:54 | rayman22201 | but maybe that isn't the problem, because I just checked the version of the code that doesn't leak, and the code it generates for "Marker" is the exact same |
23:11:02 | rayman22201 | so I'm back to square one |
23:11:29 | rayman22201 | seperately, Boehm == MarkandSweep |
23:11:33 | rayman22201 | afaik |
23:11:49 | clyybber | hmm, ok. |
23:12:00 | clyybber | rayman22201: How can I reproduce your issue? |
23:12:08 | clyybber | Clone one of your PR branches? |
23:12:42 | rayman22201 | https://github.com/rayman22201/Nim/tree/async-with-dispose |
23:13:30 | FromDiscord | <krab4t> i have more templates in my shitty code than procs, nice. |
23:13:39 | rayman22201 | `nim --gc:markandsweep -d:nimTypeNames -d:useGcAssert -d:trackAllocationSource -d:nimGcRefLeak -d:useMalloc --debugger:native c -r basicAsync.nim` |
23:13:53 | rayman22201 | and that is the flags needed to compile the test |
23:14:04 | rayman22201 | you don't need all of them, but you get the idea |
23:15:33 | clyybber | rayman22201: Do you have https://github.com/nim-lang/Nim/pull/12512 merged into your branch? |
23:15:57 | rayman22201 | yes. My branch is based on that branch as a base actually |
23:15:58 | * | disbot quit (Read error: Connection reset by peer) |
23:16:47 | rayman22201 | you will need to re-build the compiler for this of course, since there are some vm-gen changes |
23:17:00 | rayman22201 | koch temp or something |
23:17:05 | clyybber | sure |
23:17:47 | * | snwmzr joined #nim |
23:19:11 | * | ponyrider joined #nim |
23:20:21 | * | snwmzr quit (Remote host closed the connection) |
23:20:48 | * | snwmzr joined #nim |
23:22:03 | clyybber | btw, what is the issue again? The string not being reached by dispose right? |
23:29:48 | clyybber | rayman22201: valgrind doesn't report any leaks to me? |
23:30:42 | clyybber | So maybe the allocs/deallocs count is just wrong? |
23:30:52 | rayman22201 | hrmmmm. That is possible |
23:31:08 | rayman22201 | In this case it's the "Buffer" object. I forgot to change the comment |
23:31:14 | rayman22201 | String is the same though |
23:31:29 | rayman22201 | It's not just the count though |
23:31:55 | rayman22201 | If you look at the output of `dumpNumberOfInstances()` it still shows the Buffer object as an active object |
23:32:20 | * | mipri joined #nim |
23:32:55 | rayman22201 | maybe it is just a count bug... |
23:33:27 | clyybber | Or the gc is smart enough to clean it up before terminating.. |
23:33:36 | clyybber | Not sure which is the case. |
23:34:42 | FromDiscord | <yewpad> is it possible to create a nimble project with a lot of submodules? like you would do in java with maven `xxx-core`, `xxx-common`, `xxx-ABC` etc.? i don't really want to create three separate nimble projects with their own git dir |
23:35:18 | clyybber | rayman22201: Its supposed to leak without the dispose calls right? Because valgrind doesn't report any leaks even with them commented out. Which leads me to believe that the gc does cleanup before terminating. |
23:35:33 | rayman22201 | I disable the GC at the start of the test |
23:35:40 | rayman22201 | but then turn it back on again at the end |
23:35:48 | rayman22201 | maybe comment out the GC_enable call |
23:36:13 | clyybber | there is no GC_enable call here.. |
23:36:16 | rayman22201 | oh, yeah |
23:36:22 | clyybber | didn't push? |
23:36:30 | rayman22201 | no, I just mis-remembered |
23:37:08 | rayman22201 | you removed the dispose call on line 27? |
23:37:51 | rayman22201 | that's not actually sufficient because I also add dispose calls in the asyncmacro itself |
23:38:00 | * | mipri left #nim (#nim) |
23:38:57 | clyybber | ah |
23:38:59 | clyybber | ok |
23:39:47 | rayman22201 | I can show you where to remove those if you like |
23:40:01 | clyybber | are these those system.dispose ones in asyncdispatch? |
23:40:17 | rayman22201 | https://github.com/rayman22201/Nim/commit/f6ce22adca7023a57a48fb8de21b8adda35d9bf3#diff-5933d70ab845f7daf7c238319f0b55b6R78 |
23:40:45 | clyybber | thanks |
23:40:58 | rayman22201 | just change it back to `valueReceiver = newDotExpr(futureVarNode, newIdentNode("read"))` |
23:41:08 | rayman22201 | 👍 |
23:42:12 | rayman22201 | It's interesting that seems to be sufficient to not leak. That was my original theory, but this rabbit hole made me doubt myself |
23:42:46 | clyybber | doesn't leak even with them removed |
23:42:59 | clyybber | though the deallocs count changed |
23:43:04 | clyybber | to 0 duh :D |
23:43:37 | rayman22201 | :/ |
23:43:39 | rayman22201 | wat |
23:43:50 | rayman22201 | are you compiling with --use:malloc? |
23:43:52 | clyybber | the deallocs count of dumpInstances |
23:43:59 | clyybber | rayman22201: Yeah |
23:44:10 | clyybber | The free count of valgrind stays the same |
23:44:25 | clyybber | so either mark and sweep is very smart and cleans up before we terminate |
23:44:32 | clyybber | even though you disable it |
23:45:40 | clyybber | or the dealloc counts arent incremented by the gc itself and only by dispose? |
23:47:59 | clyybber | rayman22201: Btw you can debug the generated C code a bit better with -t:-g3 instead of --debugger:native |
23:48:12 | clyybber | If you want to step through the C code in gdb |
23:48:23 | clyybber | which is kinda useful at times |
23:48:27 | clyybber | like this one |
23:48:37 | clyybber | and its also much better on the eyes :) |
23:50:05 | hemite | zedeus: thanks, I'll try choosenim |
23:52:59 | clyybber | rayman22201: Btw dispose is just a call to deepDispose in the generated C code |
23:55:57 | * | couven92 quit (Quit: Client Disconnecting) |
23:59:30 | * | couven92 joined #nim |
23:59:47 | * | krux02 quit (Remote host closed the connection) |