00:01:02 | * | fredrik92 quit (Ping timeout: 276 seconds) |
00:03:09 | rayman22201 | system.dispose == system.deepDispose? |
00:03:10 | clyybber | rayman22201: I'd try inspecting NimMain in the C code and asyncProc__HxLX2 and perhaps the dispose/deepDispose calls. I'm too tired to catch the bug, but I think if there is an intermediate string you are gonna find it there (in asyncProc |
00:03:40 | rayman22201 | I'm loosing you? |
00:03:48 | rayman22201 | there is no intermediate string afaik |
00:04:00 | clyybber | uh sorry |
00:04:05 | clyybber | intermediate Buffer |
00:04:15 | clyybber | you wrote that as a comment in your asyncProc |
00:04:16 | clyybber | body |
00:04:35 | rayman22201 | hold on. I have a newer version of that test. |
00:04:55 | clyybber | Heres the C code for dispose:N_LIB_PRIVATE N_NIMCALL(void, dispose__KUefff9bFSbOH8KIBUi3rSw)(tyObject_DisposableFuturecolonObjectType___Lfg2yGJjDOfBeOhIorLQ0Q** future) { |
00:04:56 | clyybber | nimfr_("dispose", "/tmp/Nim/lib/pure/asyncfutures.nim"); |
00:04:58 | clyybber | nimln_(177, "/tmp/Nim/lib/pure/asyncfutures.nim"); |
00:05:00 | clyybber | deepDispose__w5kI9bH9ai2XW0mXr3WWKtdQsystem(future); |
00:05:02 | clyybber | popFrame(); |
00:05:04 | clyybber | } |
00:05:06 | clyybber | Sorry for the paste |
00:05:12 | rayman22201 | http://ix.io/218n |
00:05:52 | rayman22201 | the thing to note is that, using `assign` does the correct thing. Using `=` appears to leak. |
00:06:06 | clyybber | Hmm |
00:07:15 | clyybber | rayman22201: Theres one |
00:07:22 | clyybber | "best" way to find out |
00:07:35 | rayman22201 | also interesting to note, is that with `=` there is an extra visit to the buffer node inside the `gc_ms.nim` "forAllChildren" proc |
00:08:19 | clyybber | Diff the outputted C code of the leaking and non leaking variants |
00:08:25 | rayman22201 | ohhh. That C code you pasted is a red herring |
00:08:31 | clyybber | oh |
00:08:35 | rayman22201 | that is my own dispose I wrote to account for a different bug |
00:08:39 | clyybber | ah, haha |
00:08:46 | clyybber | Alright, I didn't check the hashes |
00:09:10 | rayman22201 | I wrote an override specific for futures. yeah. there is a lot of context here |
00:09:50 | clyybber | Are you there tomorrow? I might be a bit less dumb then :p need to sleep |
00:10:07 | rayman22201 | I will try to be :-) |
00:10:14 | rayman22201 | gn |
00:10:18 | clyybber | gn8 |
00:10:24 | * | clyybber quit (Quit: WeeChat 2.6) |
01:12:09 | * | thomasross quit (Ping timeout: 246 seconds) |
01:18:39 | * | thomasross joined #nim |
01:29:11 | * | kevin joined #nim |
01:29:23 | * | kevin is now known as Guest81193 |
01:34:25 | * | Guest81193 is now known as Kevin5 |
02:15:12 | * | Kevin5 quit (Remote host closed the connection) |
02:44:13 | * | rockcavera quit (Remote host closed the connection) |
02:52:50 | * | disbot joined #nim |
02:57:03 | * | lritter_ joined #nim |
02:57:35 | FromGitter | <kayabaNerve> Araq: A feature exists since X; a feature doesn't exist since X. Yours implements the second, although the name is just `since`, which implies the first. |
02:58:17 | FromGitter | <kayabaNerve> Although narimiran summed it up perfectly when the discussion occurred. |
02:58:41 | FromGitter | <kayabaNerve> Can I suggest `removed` for a feature which no longer exists since X.Y? |
02:59:28 | FromDiscord | <Rika> Removed sounds like the next step after deprecated |
02:59:32 | FromDiscord | <Rika> Which is nice |
03:00:03 | FromGitter | <kayabaNerve> @arnetheduck: Thanks for the explanation. I don't have a Mac either and didn't mean to judge; I just know Linux and Mac are decently similar so I was surprised you picked such a foreign target over a similar target. |
03:00:27 | * | lritter quit (Ping timeout: 240 seconds) |
03:14:55 | * | kevin5 joined #nim |
03:17:42 | * | rayman22201 quit (Quit: Connection closed for inactivity) |
03:24:37 | * | uu91 quit (Read error: Connection reset by peer) |
03:24:53 | * | uu91 joined #nim |
03:25:27 | * | uu91 quit (Read error: Connection reset by peer) |
03:26:20 | * | uu91 joined #nim |
03:50:27 | kevin5 | 👑 |
03:57:19 | kevin5 | 0 |
04:07:57 | * | mipri joined #nim |
04:17:40 | * | rayman22201 joined #nim |
04:32:35 | * | theelous3_ joined #nim |
04:33:42 | * | theelous3 quit (Ping timeout: 268 seconds) |
04:47:53 | hemite | Hello, is there an editor that has great nim support, including debugging ( callstack, breakpoints, etc )? |
04:48:18 | hemite | I know these are all obviously available separately, I was just wondering if there was one editor with everything included |
04:49:21 | * | nsf joined #nim |
04:51:36 | * | chemist69 quit (Ping timeout: 246 seconds) |
04:52:56 | * | kevin5 quit (Ping timeout: 240 seconds) |
04:53:34 | * | chemist69 joined #nim |
04:55:22 | FromGitter | <kayabaNerve> The most popular editor with Nim developers is MS VS IIRC. It also has the most support for Nim. No idea about its feature list for Nim. |
04:55:52 | hemite | Thanks, I was looking at that but it didn't seem like debugging support was there yet |
04:56:06 | hemite | other than that it looked fairly complete |
04:56:07 | FromGitter | <kayabaNerve> Yep. That and rename are still 'TODO' |
05:22:07 | * | uu91 quit (Read error: Connection reset by peer) |
05:22:28 | * | uu91 joined #nim |
05:31:59 | FromDiscord | <treeform> does any editor has good nim debugging support? |
05:59:37 | * | shashlick_ quit (Quit: quit) |
06:08:54 | * | shashlick_ joined #nim |
06:13:41 | * | nif quit (Quit: ...) |
06:13:50 | * | nif joined #nim |
06:15:49 | * | dddddd quit (Remote host closed the connection) |
06:16:22 | * | kevin5 joined #nim |
06:24:01 | * | lritter_ quit (Quit: Leaving) |
06:30:58 | * | narimiran joined #nim |
06:31:44 | * | uu91 quit (Read error: Connection reset by peer) |
06:31:59 | * | uu91 joined #nim |
06:33:06 | Araq | kayabaNerve: I think the common name for it is "obsolete" |
06:33:57 | Araq | but it means we need to keep cruft even longer than we currently do, so it's not really desirable for us |
06:36:02 | GordonBGood | Araq: I have two issues to discuss with you to do with destructors: one fairly serious (I think) and one not so important... |
06:36:27 | * | uu91 quit (Ping timeout: 250 seconds) |
06:37:06 | GordonBGood | The serious one first: we can't seem to "new up" a ref to an object that has a custom destructor: https://play.nim-lang.org/#ix=219d |
06:37:25 | * | uu91 joined #nim |
06:37:38 | GordonBGood | Error: the destructor that is turned into a finalizer needs to have the 'nimcall' calling convention |
06:37:39 | narimiran | @kayabaNerve ("A feature exists since X; a feature doesn't exist since X. Yours implements the second"): umm, no, it implements the first one |
06:38:42 | GordonBGood | This isn't a problem later when finalizers are eliminated from RTTI, but we need to support it for now for the legacy stuff |
06:39:30 | GordonBGood | Should I do an issue for this? |
06:42:00 | GordonBGood | Second issue isn't so big because it's rarely needed and there is a neat workaround... |
06:42:45 | Araq | how is this serious? the destructor must be '.nimcall' |
06:43:15 | GordonBGood | I made the destructor `.nimcall` and still get the error |
06:43:36 | Araq | you also made it .inline |
06:43:55 | Araq | most likely the backend check is wrong, very simple to fix |
06:44:34 | Araq | ccgexprs.nim line 1217 |
06:44:37 | Araq | bt.destructor.typ.callConv != ccDefault --> |
06:44:49 | Araq | bt.destructor.typ.callConv notin {ccDefault, ccNimcall} |
06:45:04 | GordonBGood | Sorry, you are right, taking out the `.inline` makes it work, and then `.nimcall` is the default |
06:45:16 | Araq | no |
06:45:23 | Araq | sorry, there is no ccNimcall |
06:45:35 | Araq | there only is ccDefault and it's the same as .nimcall |
06:45:48 | Araq | so yeah, no bug here |
06:47:00 | GordonBGood | Yes, I was looking at that line, but didn't want to start mucking about without consulting - I should have thought that `.inline` means there is no call at all (maybe), so of course it isn't definitely `.nimcall` - sorry |
06:48:03 | GordonBGood | Okay, maybe the less serious issue is nothing as well: has to do with "Error: internal error: destructor turned out to be not trivial"... |
06:49:56 | GordonBGood | https://play.nim-lang.org/#ix=219f |
06:50:38 | Araq | internal errors are bugs |
06:51:14 | GordonBGood | The use case would be if one wanted to force an immediate destruction, but as you see there is a nice work around that doesn't even need the thing to be destroyed to be a var |
06:53:18 | GordonBGood | The error is coming from the same genDestructor you had me look at before |
06:57:38 | GordonBGood | ^Sorry, genDestroy |
06:58:28 | GordonBGood | Looks like we should add some logic there to handle "non-trivial destructors" rather than erroring out? |
07:03:39 | * | kevin5 quit (Ping timeout: 240 seconds) |
07:09:04 | * | fanta1 joined #nim |
07:09:12 | GordonBGood | And maybe also not letting calling default destructors do nothing when called, letting the destruction happen at the end of the proc |
07:10:55 | GordonBGood | As I said, there could be a use case where the user wants to force immediate destruction |
07:24:43 | * | solitudesf joined #nim |
07:40:35 | * | stefantalpalaru quit (Ping timeout: 276 seconds) |
07:54:39 | Araq | I'm not a fan of wondering about other valid use cases when we have real, hard bugs to fix |
07:58:20 | GordonBGood | Well, I wasn't wondering, I actually thought I had a need for this |
07:59:40 | GordonBGood | It's still a bug, even if it doesn't come up too often, as most won't call `=destroy` directly other than writing custom destructors, which may be not necessary too often when we are through |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:00:26 | GordonBGood | But when writing custom destructors for nested things such as objects that contain objects, it could come up... |
08:01:03 | GordonBGood | If you don't want to worry about it now, I can just file an issue and we can come back and look at it later when things stabilize to do with destructors |
08:01:25 | * | PMunch joined #nim |
08:01:25 | GordonBGood | If it's a bug, it should be noted somewhere |
08:01:58 | * | stefantalpalaru joined #nim |
08:04:00 | GordonBGood | It came about because of my trying to trace my problems with closure assignments/moves/destructors and RC, and trying to emulate what closures do without using ref's |
08:04:24 | GordonBGood | If that worked, then the problem is the tyRef one you are working on |
08:05:01 | * | gmpreussner joined #nim |
08:07:52 | * | drewr quit (Ping timeout: 264 seconds) |
08:13:30 | PMunch | Just pushed a new version of nimlsp that does away with the git submodule stuff :) |
08:19:10 | PMunch | But apparently the nimble pre-build hook doesn't work.. |
08:19:23 | PMunch | So it needs to be run manually.. |
08:22:12 | * | krux02 joined #nim |
08:24:03 | Araq | PMunch: what were the downsides of submodules? |
08:24:42 | PMunch | Well, mostly that the submodule had to be the same version as the Nim that was compiling the project |
08:25:19 | PMunch | Now it finds the installed Nim version that you're using and compiles from its sources instead :) |
08:25:30 | PMunch | So the build process is much easier |
08:25:58 | Araq | ok :-) |
08:26:11 | Araq | is there an agreement on https://github.com/nim-lang/Nim/pull/12599 being better than my solution? |
08:26:20 | PMunch | If the "before install"/"before build" hooks worked correctly it would basically "just work" and you could to "nimble install nimlsp" without any further hassle |
08:27:04 | Araq | what does "worked correctly" mean? |
08:27:24 | * | floppydh joined #nim |
08:28:07 | PMunch | Well they don't seem to run at all |
08:28:41 | PMunch | You can do nimble build and it will fail. Run the command in the before build section manually and it works just fine |
08:28:59 | PMunch | Or explicitly run the task that does the same thing before building |
08:30:14 | PMunch | Example: http://ix.io/219x |
08:30:15 | disbot | ^ play at https://play.nim-lang.org/#ix=219x 😏 |
08:31:22 | PMunch | Araq, what was your outplace solution by the way? Haven't kept track |
08:32:09 | Araq | it's a.outplace(sort()) vs outplace(sort(a)) <-- my solution |
08:32:38 | Araq | clybber's works better for chaining and doesn't use 'untyped' as the first argument so it also works better with overloading |
08:32:49 | Araq | my solution is more logical :P |
08:33:04 | PMunch | Oh yeah, then I'd definitely prefer clybbers version :P |
08:33:40 | PMunch | I've been anoyed that chaining where the first argument was a `var` didn't work for the longest time |
08:34:02 | Araq | maybe we should extend it to: a.outplace(sort) |
08:34:13 | Araq | doesn't look as weird then |
08:34:20 | * | theelous3_ quit (Ping timeout: 265 seconds) |
08:34:24 | PMunch | Well preferably you should be able to do a.outplace(sort(reversed = true)) |
08:34:40 | PMunch | ie pass other arguments to the procedure |
08:35:17 | PMunch | Kinda like how dot-chaining works normally, just insert the argument as the first element |
08:35:20 | FromGitter | <zacharycarter> curious Araq - is https://github.com/Araq/araqsgc something that is going to continue to evolve, or is it just an experiment or is it usable and will stay as is |
08:35:22 | FromGitter | <zacharycarter> ? |
08:35:57 | PMunch | Oh I see that it already works this way, neat! |
08:37:28 | * | rayman22201 quit (Quit: Connection closed for inactivity) |
08:37:50 | Araq | zacharycarter: maybe I'll continue the work but the primary focus is on https://github.com/nim-lang/RFCs/issues/177 |
08:38:06 | FromGitter | <zacharycarter> 👍 thanks! |
08:38:29 | FromGitter | <zacharycarter> networking code for the RTS I'm making is coming along |
08:38:43 | PMunch | Oh cool |
08:38:48 | FromGitter | <zacharycarter> I already have map rendering prototyped so hopefully soon I'll have something to show |
08:38:54 | Araq | so yeah, if you want to know what is going on, now it's documented in the RFCs |
08:39:07 | FromGitter | <zacharycarter> I need to pay more attention to them |
08:39:32 | Araq | and with yesterdays' RFC I consider them complete, need a Nim2020 milestone for them |
08:42:10 | Araq | PMunch: how about a.outplace(sort, more, args, here) |
08:42:34 | Araq | then it's clear (maybe?) that we construct the call from sort(copyOf(a), more, args, here) |
08:42:41 | Araq | well... |
08:43:07 | Araq | a.outplace(sort(it, arg1, arg2)) |
08:43:31 | Araq | we have 'it' as an idiom |
08:48:08 | PMunch | Hmm, that is of course also an option |
08:48:56 | PMunch | I'll probably make myself an operator like `.!` to do this for me anyways. So I can do a.!sort(arg1, arg2) |
08:49:16 | Araq | mratsim has a point though, outplace is a function tranformator; outplace(reverse)(a) |
08:56:48 | FromGitter | <alehander92> i wonder if you can do |
08:56:49 | FromGitter | <alehander92> inplace |
08:57:29 | FromGitter | <alehander92> which injects the argument as a result variable |
08:57:33 | FromGitter | <alehander92> and counts on RVO |
08:58:03 | Araq | inplace is much more complex |
08:58:26 | FromGitter | <alehander92> but probably not yeah, as usually people init explicitly the new result and add to it |
08:58:44 | Araq | usually you need it to rewrite all 'result = f(result)' where 'f' is recursive |
08:59:28 | FromGitter | <alehander92> yeah |
08:59:52 | Araq | layering FP on top of optimized imperative code works well, extracting optimized imperative code out of FP is harder |
09:02:19 | FromGitter | <alehander92> that's true |
09:02:34 | FromGitter | <alehander92> which reminds me of the iterator chaining question, i saw a comment somewhere these days |
09:04:58 | FromGitter | <alehander92> can't really find it uh |
09:06:37 | FromGitter | <alehander92> ah this topic https://forum.nim-lang.org/t/5458 |
09:06:59 | FromGitter | <alehander92> i just saw people recommending zero-functional and wanted to point out that it just doesnt solve this fully |
09:08:16 | FromGitter | <alehander92> because its hard to extend to use with a custom function (even if @michael72 did amazing dsl-s to help exactly with making it work for custom functions) but still it seems much harder than just defining a normal nim proc/iterator |
09:09:23 | FromGitter | <alehander92> so some kind of working iterator chaining is still the only actual solution in my mind (with better borrowing maybe the aliasing wouldnt be such a big deal) |
09:10:29 | * | Trustable joined #nim |
09:12:07 | FromGitter | <alehander92> hemite, the debugging support in vscode should be kinda there iirc (especially if using the nim-gdb.py script in your debug config), just dont know if there is an example config somewhere |
09:15:09 | Araq | I live in costs-vs-benefits land. What's proposed is usually very costly and in the end the benefits are minor. I don't see how many more ways one can need in order to avoid writing an explicit 'for' loop. |
09:16:10 | Araq | I wrote SQL queries that were pages long with nested joins, all "declarative". you know what I would have preferred? a 'for' with accumulator variables. |
09:16:42 | FromGitter | <alehander92> well, you can say that for almost any abstraction honestly |
09:17:10 | Araq | no, I'm talking about the general desire to nuke 'for' + 'if' |
09:17:32 | Araq | I don't mind them, they are simpler, more powerful and more predictable. |
09:17:41 | FromGitter | <alehander92> but chaining iterators does not mean you nuke for + if |
09:17:46 | FromGitter | <alehander92> it means you get more powerful for + if |
09:18:58 | FromGitter | <alehander92> because you can loop over exactly the shape/result you want e.g. map + zip or map + filter |
09:19:28 | FromGitter | <alehander92> and of course, sometimes for + if is simpler, sometimes the other option might seem simpler |
09:21:28 | FromGitter | <alehander92> but i dont think thats a good motivation, because independently of this opinions, nim already provides ⏎ two(!) versions of some of those constructs in sequtils (map/filter etc mapIt/filterIt etc) and both of them lead to people using them but not very efficiently |
09:22:13 | FromGitter | <alehander92> so the cat is out of the bag, might as well make this more efficiently composable and extensible a bit |
09:23:54 | Araq | yeah and we also already have a macro system, so let's extend it to a compiler plugin system. Or let's extend it to all for arbitrary symbol lookups |
09:24:41 | PMunch | Hmm, can you turn hints off in the config.nims file? |
09:24:48 | Araq | what you need to understand is when we're doing X we are *not* doing Y. And Y might benefit more users or address a more pressing problem. |
09:26:22 | FromGitter | <alehander92> i am not saying to do it now, just to not dismiss it completely as a possible feature |
09:28:14 | FromGitter | <alehander92> maybe it would be easier to make a different better 3rd party solution in a while |
09:29:01 | Araq | speaking of which, can I steal your for loop expressions? is it ready for the stdlib? |
09:31:05 | FromGitter | <alehander92> as i said before , i stole them of some of your test examples iirc |
09:32:31 | PMunch | Yay, SolitudeSF made a better version of the config for nimlsp. So now "nimble install nimlsp" should work :) |
09:36:01 | FromGitter | <alehander92> and this version of b3liever https://github.com/alehander92/comprehension/pull/1/files |
09:36:21 | * | ng0 joined #nim |
09:36:39 | FromGitter | <alehander92> has a bit more clear/robust impl |
09:36:44 | FromGitter | <alehander92> but it offers a different api |
09:37:08 | FromGitter | <alehander92> so you should decide on which api looks better for `sugar` |
09:37:56 | FromGitter | <alehander92> i think his impl can still be adapted to the inline api and the opposite (mostly i want to ensure we can collect into tables/sets not only seq) |
09:40:22 | PMunch | Looking at nimterlingua, how does that actually work? |
09:40:40 | PMunch | Like how does it do replacement on unmodified code? |
09:48:29 | Araq | alehander42: sorry, but what are the differences? |
09:49:48 | Araq | never mind |
09:50:11 | * | endragor joined #nim |
09:51:46 | Araq | yeah I want the 'collect' thing. turns statements into expressions that support indentation |
09:52:52 | Araq | instead of Python's weird "let's squash it into one line and hope for the best" |
09:54:52 | Mister_Magister | !eval echo "hello" |
09:54:56 | NimBot | hello |
09:56:00 | endragor | > Error: interpretation requires too many iterations |
09:56:03 | endragor | > MaxLoopIterations* = 10_000_000 |
09:56:16 | endragor | love those magic constants in the compiler :) |
09:57:17 | Araq | endragor: what else to do? the halting problem is a nasty one |
09:59:45 | PMunch | Just leave it looping? |
10:00:03 | PMunch | The user could abort it if they suspected an infinite loop |
10:00:06 | endragor | Araq: I think hanging would be better than this. Right now the only way I can fix this is by modifying the constant in compiler it seems. |
10:00:22 | endragor | Yeah, I agree with PMunch |
10:00:44 | Araq | at least nimsuggest definitely needs this protection |
10:01:08 | * | NimBot joined #nim |
10:01:52 | Araq | endragor: what are you doing that requires 10 million iterations though? |
10:02:04 | Mister_Magister | !eval while 1: echo "hello" |
10:02:06 | NimBot | Compile failed: /usercode/in.nim(1, 7) Error: type mismatch: got <int literal(1)> but expected 'bool' |
10:02:15 | Mister_Magister | !eval while true: echo "hello" |
10:02:31 | Mister_Magister | yay killed it |
10:02:39 | NimBot | Compile failed: <no output> |
10:02:44 | Mister_Magister | xd |
10:02:45 | endragor | Araq: using https://github.com/PMunch/protobuf-nim, which parses protobuf specs in compile time |
10:03:19 | Araq | maybe we can make this limit for every single loop but not for nested loops combined |
10:05:54 | PMunch | !eval echo "I'm not dead yet!" |
10:05:58 | NimBot | I'm not dead yet! |
10:06:15 | endragor | If this is mainly a nimsuggest problem, I'd rather have a compiler option for max loop iterations, but default to infinite. nimsuggest would then use this option. As a user, I don't see a problem in long loops in compile time |
10:06:56 | PMunch | TBH I should switch out the parser in protobuf-nim |
10:07:09 | PMunch | That's what causes the deep recursion |
10:07:17 | endragor | PMunch: I'm still not settled on whether I'll use the library :) But worst case I'll probably just heavily modify it |
10:07:25 | PMunch | Zevv, you up for another parsing challenge? |
10:08:14 | PMunch | What are you using this for endragor? |
10:09:07 | endragor | PMunch: er.. for protobuf-based communications? :) |
10:10:32 | Zevv | PMunch: pretty busy with $stuff these days, but do tell |
10:11:10 | PMunch | endragor, haha well that I could guess |
10:11:25 | PMunch | Zevv, I'm looking to replace the parser in protobuf-nim |
10:11:49 | PMunch | So I need something to parse protobuf syntax, preferably into the same format it uses today |
10:12:19 | Zevv | that should be fairly trivial |
10:12:59 | Zevv | https://developers.google.com/protocol-buffers/docs/proto is that the right one? |
10:13:34 | endragor | Zevv: https://developers.google.com/protocol-buffers/docs/proto3 |
10:13:40 | Zevv | thanks |
10:14:08 | PMunch | Yeah, the version 3 one |
10:14:23 | PMunch | This is how the parsing is done today: https://github.com/PMunch/protobuf-nim/blob/master/src/protobuf/private/parse.nim |
10:14:38 | PMunch | And this is the type it parses it into: https://github.com/PMunch/protobuf-nim/blob/master/src/protobuf/private/decldef.nim |
10:14:44 | Zevv | that's not too bad, is it? |
10:15:13 | PMunch | No it shouldn't be too difficult |
10:16:12 | Zevv | but why replace the current impleemntation then? |
10:19:47 | Araq | this ... is not how to parse stuff :P |
10:20:10 | endragor | Yeah it takes > 10 mil iterations for a fairly trivial protocol spec. |
10:21:13 | PMunch | Yeah.. It's not great |
10:21:40 | PMunch | I mean it works, but that's about the nicest thing I can say about it :P |
10:23:15 | Zevv | fair enough :) |
10:26:20 | FromGitter | <mratsim> seems like you need more monads |
10:27:38 | Araq | to be fair though, we don't know if a different parser would avoid the VM limit |
10:34:15 | FromGitter | <alehander92> Araq but then how do you hint you need a set/table/other collection |
10:34:20 | FromGitter | <alehander92> as a result of the comprehension |
10:38:57 | FromGitter | <alehander92> we can just have collectSet / collectTable or collect[set]: / collect(set): |
10:39:36 | * | uu91 quit (Ping timeout: 240 seconds) |
10:39:40 | FromGitter | <alehander92> ah sorry nvm, i realized here its done with the shape of `it` as well |
10:39:53 | FromGitter | <alehander92> however .. |
10:39:58 | FromGitter | <alehander92> we can do it generically .. |
10:40:25 | FromGitter | <alehander92> we can just have `it` be either `v` or `{k: v}` / in the block of code |
10:40:54 | FromGitter | <alehander92> and accept any typeclass in `collect[typ]:` with seq as default |
10:41:27 | FromGitter | <alehander92> and just require `init` + inc/adder implementations for the type |
10:41:43 | FromGitter | <alehander92> so we have those by default for seq/set/table |
10:41:46 | Araq | maybe. |
10:41:53 | FromGitter | <alehander92> and if somebody wants to support his own seq or class |
10:42:05 | FromGitter | <alehander92> he just overloads 1-2 primitives for it and its ready |
10:43:02 | FromGitter | <alehander92> this can be done with minimal changes to the b3liever PR |
10:44:12 | * | uu91 joined #nim |
10:50:23 | * | narimiran quit (Ping timeout: 250 seconds) |
11:02:42 | * | uu91 quit (Read error: Connection reset by peer) |
11:02:57 | * | uu91 joined #nim |
11:19:52 | * | beatmox quit (Ping timeout: 264 seconds) |
11:20:17 | * | qwertfisch quit (Ping timeout: 276 seconds) |
11:25:47 | FromDiscord | <kodkuce> so if i want to play with jester should i wait this 1.2 new magic or am i cool allready |
11:27:55 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
11:36:27 | FromGitter | <mratsim> @alehander92 that's what rust is doing with their inline iterator chaining |
11:40:02 | * | rockcavera joined #nim |
11:41:44 | * | beatmox joined #nim |
11:42:18 | * | qwertfisch joined #nim |
11:45:45 | FromGitter | <alehander92> @mratsim ? |
11:46:45 | FromGitter | <alehander92> (i mean, which of the things we discussed in particula) |
11:48:52 | FromGitter | <alehander92> ah, they do have their `collect` indeed |
11:49:47 | FromGitter | <alehander92> of course yeah, the idea of `collect` on the end of an iterator chain and for our comprehension is relatively similar but orthogonal |
11:51:39 | FromGitter | <alehander92> but nim's collect is about the return type contract: it can easily add a `for` if you just pass a iterator(chain), but this is overally something that `for` is responsible for |
11:53:44 | * | Vladar joined #nim |
11:55:43 | FromGitter | <alehander92> i remember @timotheeocur had his own idea of how to implement this on top of almost existing nim but i have to check it out some day |
11:58:39 | * | Vladar quit (Quit: Leaving) |
12:01:17 | FromDiscord | <kodkuce> so should i w8 1.2 will async be rewritten or whatever, and @GooRoo or @manterolat make a text chanel nim-newbs or nim-help for simple questions i noticed people here ask questions form time to time but insted answer get spam of you all talking about uber smart issues atm heppening we newbs dont get 🙂 |
12:02:39 | Araq | kodkuce: async works well, we're working on making threading easier |
12:04:15 | * | narimiran joined #nim |
12:04:47 | FromDiscord | <kodkuce> ye but i know you mention seqsv2, then something about async not working with newruntime i think, then soemthign about iterators duno anymore |
12:05:10 | FromDiscord | <kodkuce> like is say mostly i see like Matrix magic letters falling down this chat 🙂 |
12:08:08 | PMunch | Araq, well most parsers aren't as recursive as that |
12:15:19 | FromGitter | <alehander92> kodkuce sorry, threaded conversations would be cool for that indeed |
12:15:37 | FromGitter | <alehander92> what do you want to do ? a web app ? |
12:16:50 | FromDiscord | <kodkuce> me, wanted to try to finish a multyplayer server for dumb games, like poker pool ectera |
12:17:43 | FromGitter | <alehander92> make it for smart games, as chess and go :P |
12:18:50 | FromGitter | <alehander92> using async/await in general wouldn't change soon |
12:19:17 | FromGitter | <alehander92> if you need more special stuff like awaiting other threads, then you need a workaround |
12:27:53 | * | dddddd joined #nim |
12:28:23 | narimiran | anybody here having 32-bit OS and some free time to help me debug something? |
12:29:57 | narimiran | there's a strange bug in 1.0.x (not in devel) that happens only on 32-bit, and i cannot pinpoint what exactly went wrong |
12:31:16 | * | Vladar joined #nim |
12:36:51 | FromGitter | <mratsim> setting up a VM is probably faster ;) |
12:37:10 | FromGitter | <mratsim> I have a raspberr Pi with 32-bit raspbian but no time :/ |
12:38:01 | FromGitter | <alehander92> you should be able to run 32bit programs |
12:38:12 | FromGitter | <alehander92> in some cases |
12:39:47 | narimiran | @alehander92 i just need to test what some `shr`'s and bit `and`'s produce on 32-bit OS |
12:40:47 | narimiran | @mratsim can i prepare everything, so you only need to copy/paste and do `nim c -r`? if not, i guess setting up a VM is what i'll do |
12:43:58 | FromGitter | <mratsim> prepare everything yes, you can even open an issue on https://github.com/status-im/nim-stint as it would be the library most impacted by that |
12:44:12 | FromGitter | <alehander92> you can do it online i think |
12:46:30 | FromDiscord | <mratsim> only if we had godbolt :p |
12:47:33 | FromGitter | <alehander92> yea i actually tried it |
12:47:44 | FromGitter | <alehander92> but i cant seem to find a 32bit gcc? |
12:47:50 | FromGitter | <alehander92> otherwise it doesnt matter |
12:47:54 | FromGitter | <alehander92> you can --cpu:i386 |
12:48:04 | FromGitter | <alehander92> and just try the related c code |
12:48:10 | FromGitter | <alehander92> but maybe it depends on a lot of nimbase |
12:48:41 | narimiran | @alehander92 @kaushalmodi already suggested me `c --cpu:i386 --passC:-m32 --passL:-m32` the other day, but that does not reproduce the bug :/ |
12:50:14 | solitudesf | narimiran, whats the snippet you need to test? |
12:51:11 | narimiran | solitudesf: this is what fails: http://ix.io/21an — if you can reproduce the fail, i'll create some more specific test case |
12:51:12 | disbot | ^ play at https://play.nim-lang.org/#ix=21an 😏 |
12:52:21 | narimiran | gah, i changed the example while playing, wait a bit |
12:53:03 | Zevv | PMunch: it's not particulary pretty: http://ix.io/21ao |
12:53:04 | disbot | ^ play at https://play.nim-lang.org/#ix=21ao 😏 |
12:53:09 | * | endragor quit (Remote host closed the connection) |
12:53:30 | narimiran | this is the example as seen in 1.0.x branch: http://ix.io/21ap |
12:53:31 | disbot | ^ play at https://play.nim-lang.org/#ix=21ap 😏 |
12:53:43 | FromGitter | <alehander92> zevv, npeg looks fantastic |
12:54:13 | FromGitter | <alehander92> btw i think .. nim should recognize a literal is in given range |
12:54:14 | FromGitter | <alehander92> somehow |
12:54:27 | * | clyybber joined #nim |
12:54:44 | FromGitter | <alehander92> is it too hard for the sem checker to match those cases |
12:55:00 | solitudesf | narimiran, runs fine on my pi |
12:55:29 | narimiran | solitudesf: is that nim devel (1.1.1) or nim stable (1.0.x)? |
12:55:33 | solitudesf | ah |
12:55:39 | solitudesf | yes, let me switch to stable |
12:59:38 | clyybber | Araq: Doing the checking in sem and the transformation in transf.nim seems a bit like a waste. Ideally I'd like to do the checking and store the result somewhere so that transf can pick it up? |
12:59:45 | clyybber | Where should I do that? |
13:02:29 | solitudesf | narimiran, runs fine with 1.0.0 and 1.0.2 |
13:02:45 | narimiran | solitudesf: huh, that's strange |
13:03:09 | narimiran | it continuously fails on 32-bit travis and azure pipelines |
13:05:09 | narimiran | i can get rid of the symptom (failing runnable examples), but i was intrigued by the cause. |
13:05:33 | narimiran | but if it isn't reproducible even on 32-bit, then i have no idea what might be causing this |
13:07:09 | FromGitter | <zacharycarter> do you still have to initialize tables? |
13:07:13 | narimiran | no |
13:07:22 | FromGitter | <zacharycarter> that's what I thought - okay thanks |
13:14:23 | PMunch | endragor, can you check if Zevvs parser works on your file? |
13:14:44 | Zevv | endragor: or please send me your file |
13:22:24 | * | tklohna quit (Ping timeout: 265 seconds) |
13:28:26 | PMunch | Araq, is there a way to check the recursion depth? |
13:28:34 | PMunch | I mean since it's tracked anyways |
13:31:59 | FromDiscord | <Aidiakapi> Is there a way to print at compile-time from a macro expansion? The `echo` commands inside of the macro body don't seem to go anywhere. |
13:32:01 | FromDiscord | <Aidiakapi> Is there a way to print at compile-time from a macro expansion? The `echo` commands inside of the macro body don't seem to go anywhere? |
13:32:21 | FromDiscord | <Aidiakapi> Is there a way to print at compile-time from a macro expansion? The `echo` commands inside of the macro body don't seem to go anywhere. |
13:32:25 | PMunch | Echos inside macros should work fine |
13:32:43 | PMunch | And by the way, please don't edit your message on Discord, it sends a completely new copy to IRC :P |
13:33:59 | FromDiscord | <Aidiakapi> Ah, I see, regardless, it's not actually showing up. The macro runs, but the echo isn't shown |
13:34:48 | PMunch | Do you have an example? |
13:35:49 | * | hoijui joined #nim |
13:35:59 | FromDiscord | <Aidiakapi> `macro foo(data: untyped): untyped = echo "hello"; assert(5 == 6)` |
13:36:07 | PMunch | https://play.nim-lang.org/#ix=21aB |
13:36:29 | PMunch | Try that, if you switch to "Showing: debug" you will see the echo from the macro |
13:37:50 | FromDiscord | <Aidiakapi> I think it's actually nimble hiding it, when I added the error to the macro, it does show the message, but without it, it's just "everything fine, moving on" |
13:38:27 | PMunch | Oh right, yeah Nimble takes all the output from compilation. |
13:39:36 | FromDiscord | <Aidiakapi> That's mildly annoying, but alright, thanks :) |
13:39:50 | solitudesf | --debug flag in nimble shows compiler output |
13:40:15 | PMunch | Hmm, it would be cool if there was some way you could tell nimble that something should be output |
13:41:34 | FromDiscord | <Aidiakapi> Thanks! `--debug` did it |
13:44:27 | * | GordonBGood quit (Ping timeout: 240 seconds) |
13:49:12 | FromGitter | <Vindaar> so random performance puzzle for you: I have proc `f1` and `f2`. They each run fast on their own. `f3` which is just `f1(); f2()` is fast too. But `f4` which has the bodies of `f1` and `f2` below one another is 6 times slower than `f3`. What the heck? |
13:50:09 | Araq | Vindaar: instruction cache problems? |
13:50:50 | disruptek | not really surprising. |
13:50:54 | Araq | clyybber: we don't do that, instead do the transformation in sem and macros can pick it up |
13:53:05 | * | stefantalpalaru quit (Changing host) |
13:53:05 | * | stefantalpalaru joined #nim |
13:55:08 | FromGitter | <Vindaar> @Araq no clue. I barely know what instruction cache problems are. I guess I have some reading to do... :) |
14:01:28 | clyybber | Araq: The problem is the new/reset/default/declared variables transformation. IMO it doesn't make sense to do those in sem, so why do any transformation in sem? |
14:02:15 | clyybber | Vindaar: Compare the asm? |
14:02:58 | shashlick | Anyone uses znc here? |
14:03:53 | shashlick | Where do you host if you do |
14:05:03 | Araq | clyybber: huh? new/reset/default? |
14:05:10 | FromGitter | <Vindaar> @clybber I'm playing around with `perf` right now, but I'm fighting it rather than learning stuff about my code so far |
14:06:13 | clyybber | Araq: Well if someone does new(someVar) , someVar should have its default fields set up |
14:06:25 | kungtotte | n0--- |
14:06:26 | clyybber | Similarily for reset(someObj) |
14:06:31 | FromGitter | <iffy> Is it possible on Windows to compile a 32-bit executable with mingw64? I'm doing this `C:\nim\bin\nim.exe c --threads:on --tlsEmulation:off --cpu:i386 -d:release --opt:speed nimsrc\main.nim` and got `size of array 'Nim_and_C_compiler_disagree_on_target_architecture' is negative` |
14:10:04 | Mister_Magister | !eval echo true == "what" |
14:10:06 | NimBot | Compile failed: /usercode/in.nim(1, 11) Error: type mismatch: got <bool, string> |
14:10:11 | Mister_Magister | hm |
14:10:27 | Mister_Magister | according to php result is true :P |
14:10:35 | Mister_Magister | hard typed languages ftw |
14:10:38 | Mister_Magister | nim ftw |
14:10:39 | narimiran | Mister_Magister: last time i checked, nim was not php |
14:10:52 | Mister_Magister | narimiran: just was wondering what nim will do |
14:11:04 | narimiran | just like you cannot do `while 1`, `if mySeq`, etc. |
14:11:14 | FromDiscord | <Rika> nim does not have truthiness |
14:11:16 | Mister_Magister | mhm |
14:11:22 | PMunch | Hmm, can you inject a defer with a template? |
14:15:27 | * | berndl joined #nim |
14:16:05 | * | tklohna joined #nim |
14:17:03 | * | seni joined #nim |
14:18:02 | * | solitudesf quit (Ping timeout: 240 seconds) |
14:19:26 | FromGitter | <jason_koch_twitter> @Vindaar are you able to share a code snippet / repro? |
14:20:15 | PMunch | What I'm trying to do is wrap some C procedure that returns a pointer that needs to be freed, and then free it automatically (I make sure that I don't keep the pointer around). |
14:24:28 | FromGitter | <Vindaar> @jason_koch_twitter sure, give me a few minutes |
14:27:08 | disruptek | PMunch: you can just use the template to wrap a defer followed by the body. i do this for the scenario you describe. |
14:30:49 | * | cgfuh joined #nim |
14:31:17 | FromGitter | <Vindaar> @jason_koch_twitter here you go: https://github.com/Vindaar/ggplotnim/tree/weirdFastSlow/bookPlots |
14:31:41 | FromGitter | <Vindaar> oh, that `bookPlots` at the end wasn't supposed to be there, he |
14:34:23 | FromGitter | <kaushalmodi> @iffy I use `--cpu:i386 --passC:-m32 --passL:-m32` to build 32-bit .so's from Nim on RHEL 6.8 |
14:34:37 | FromGitter | <kaushalmodi> https://scripter.co/notes/nim/#compiling-in-32-bit-mode |
14:35:17 | FromGitter | <kaushalmodi> In Nim code, I have this check to know what mode compilation happened: `when sizeof(int)==8: # 64-bit compilation` |
14:35:33 | FromGitter | <iffy> Thanks @kaushalmodi I tried that and was getting `cannot find -lmsvcrt` and other errors like that |
14:35:55 | FromGitter | <iffy> I seem to be having success with `--cc:vcc` though it's much slower than mingw |
14:36:04 | FromGitter | <kaushalmodi> I use gcc |
14:36:14 | FromGitter | <kaushalmodi> Not much familiar with compiling Linux on Windows |
14:36:51 | FromGitter | <kaushalmodi> @iffy May be this deserves a bug report? |
14:37:45 | FromGitter | <jason_koch_twitter> > oh, that bookPlots at the end wasn't supposed to be there, he ⏎ ⏎ @Vindaar was that your issue? |
14:38:29 | narimiran | @vindaar this is the file, right? https://www.youtube.com/watch?v=E-ZbrtoSuzw |
14:38:32 | narimiran | oops |
14:38:37 | narimiran | https://github.com/Vindaar/ggplotnim/blob/55b5bc7e771caeee88f1fcef93cb72f63ed5d40d/bookPlots/weirdFastSlow.nim |
14:39:10 | FromGitter | <iffy> @kaushalmodi maybe? I don't really know what's happening with my stuff right now, though. If I can get a minimum reproducing example, I'll file a bug. |
14:40:28 | FromGitter | <Vindaar> @jason_koch_twitter no, I just meant I didn't want to include that in the path of the url, becasue I changed the readme of the repo on that branch to explain which file it is :D |
14:40:38 | FromGitter | <Vindaar> yes @narimiran |
14:40:50 | FromGitter | <kaushalmodi> @iffy You probably need a "dual target" mingw? https://stackoverflow.com/a/19346426/1219634 |
14:42:32 | FromGitter | <iffy> I'm using the 64-bit mingw from https://nim-lang.org/install_windows.html |
14:42:41 | FromGitter | <iffy> So, maybe I need the 32-bit one, too |
14:42:50 | FromGitter | <iffy> (or a dual target one) |
14:43:00 | FromGitter | <kaushalmodi> sounds like it |
14:43:37 | FromGitter | <kaushalmodi> you seem to have only 64-bit versions of those libs like *msvcrt* |
14:44:02 | narimiran | @vindaar ok, i can reproduce it on my machine too |
14:46:24 | FromGitter | <Vindaar> yay! thanks for testing |
14:47:00 | narimiran | it is about 15% slower |
14:47:53 | FromGitter | <Vindaar> only 15% on your machine? on mine it's almost a factor of 10 slower w/ debug build and ~4 w/ danger |
14:48:39 | FromGitter | <jason_koch_twitter> i'm still trying to reinstall nim, lol, switched over OSs recently |
14:49:04 | narimiran | i have a quite old machine so it might have to do with that. i don't have all the fancy modern optimizations that you might have |
14:49:25 | FromGitter | <Vindaar> ah yes, maybe |
14:50:25 | * | solitudesf joined #nim |
14:52:55 | clyybber | Soo, Araq, any idea? I can also do it for the checks in semcheck and still do the transformation in transf. The compile time impact isn't too big I think, and its only for case objects anyways. |
14:53:28 | Araq | hmmm ok |
14:56:53 | * | disbot quit (Remote host closed the connection) |
15:00:37 | * | disbot joined #nim |
15:01:14 | FromGitter | <kaushalmodi> Araq: This is what I got back when I asked my SV compiler vendor about the "client switching stacks" warning in valgrind: ⏎ ⏎ > The switching stack warning is coming when xmsim makes the dpi call (or you return). Xmsim doesn’t use a traditional c stack and it confuses valgrind when it makes c calls. You can definitely ignor that. |
15:01:54 | FromGitter | <kaushalmodi> and ⏎ ⏎ > Not sure why the nim gc would be impacted by the internal way xmsim does its stack. When it calls the dpi you have a normal C stack frame at that point… it confuses valgrind because valgrind is seeing the jumps, etc., and it knows something funky is going on… but your dpi code should be pretty insulated from that unless nim is trapping all mallocs, not just the ones you use, and then is trying to |
15:01:54 | FromGitter | ... free something it doesn’t own. |
15:02:29 | Araq | that's not what Boehm nor Nim do |
15:02:42 | Araq | but both trace the stack conservatively |
15:03:14 | FromGitter | <kaushalmodi> "calling the DPI" above means the call to the Nim compiled proc that I call from the SV side |
15:03:37 | FromDiscord | <WilliamDraco> Amateur here looking for a hand with threadpool - the moment I import it, the nim check (VSCode) throws many warnings/errors re: 'imported and not used' and 'template/generic instantiation's. I haven't even done anything with it, how is just importing it breaking so much? (Although it does actually compile... just mistaken checks?) |
15:05:00 | PMunch | disruptek, but then I'd need to pass the body into the template |
15:05:07 | Araq | kaushalmodi: can you do GC_disable/GC_enable in your callback and schedule the GC at some better time |
15:05:19 | PMunch | Essentially adding an indent level for every call to this function |
15:05:38 | Araq | WilliamDraco: I'm not sure, stdlib warnings should be surpressed |
15:05:44 | PMunch | I guess that is the clean solution though.. |
15:06:03 | * | hoijui quit (Ping timeout: 250 seconds) |
15:06:07 | disruptek | PMunch: but you need to indent anyway to put the variable in a scope where defer will free it, right? |
15:06:30 | FromGitter | <kaushalmodi> Araq: ⏎ ⏎ > can you do GC_disable/GC_enable in your callback ⏎ ⏎ You mean call GC_disable at the very beginning of the exportc'd proc and GC_enable at the very end? ... [https://gitter.im/nim-lang/Nim?at=5dc584763f4ea333f2c5345d] |
15:06:44 | Araq | yes |
15:06:53 | FromGitter | <kaushalmodi> wouldn't above be similar to running with --gc:none? |
15:06:59 | PMunch | disruptek, not really. I have let x = createThePointer(); defer: c_free x |
15:06:59 | Araq | but then the GC must run at some time |
15:08:53 | FromGitter | <kaushalmodi> GC_disable/GC_enable did the trick |
15:09:03 | FromGitter | <kaushalmodi> though.. I did not get how to do the scheduling? |
15:09:48 | FromGitter | <kaushalmodi> If I have only exportc'd procs in my Nim lib, and I disable GC when they are being run, when would GC actually run? |
15:10:07 | disruptek | PMunch: i get it. we should probably come up with a macro to do this. |
15:10:38 | * | hoijui joined #nim |
15:10:56 | Araq | kaushalmodi: I don't know, isn't there one exportc'ed proc that is actually called when there is a sane stack around... |
15:11:22 | * | PMunch quit (Quit: Leaving) |
15:11:27 | FromGitter | <kaushalmodi> each time a Nim exportc'd proc is called, it's called via the DPI-C interface in SV |
15:11:41 | FromGitter | <kaushalmodi> so the SV simulator does that stack switching thing each time |
15:12:06 | Araq | this is not a "C interface", c doesn't allow stack switching |
15:12:33 | FromGitter | <kaushalmodi> that means --gc:none is the best bet for now? |
15:12:39 | Araq | they claim it's a C interface, but it isn't. anyway, your only option then is --gc:none until --gc:destructors is ready |
15:12:53 | FromGitter | <kaushalmodi> and then I can try out --gc:destructors |
15:12:56 | FromGitter | <kaushalmodi> yes |
15:12:59 | * | hoijui quit (Client Quit) |
15:13:53 | FromGitter | <kaushalmodi> so.. the "issue" I have with gc:none is that my terminal gets flooded with warns like: ⏎ ⏎ > Warning: 'setLen(result, 1)' uses GC'ed memory [GcMem] |
15:14:12 | FromGitter | <kaushalmodi> I can ignore those warnings I believe, but I do not know how serious those warnings are |
15:17:51 | disruptek | this is fine. |
15:18:14 | clyybber | *house starts burning* |
15:18:37 | narimiran | clyybber: i'll sleep fine tonight |
15:18:48 | clyybber | nice |
15:19:22 | FromDiscord | <Aidiakapi> How do you pass a slice as a function parameter, I can't seem to find it for some reason? |
15:21:20 | FromGitter | <Vindaar> @Adiakapi: https://nim-lang.github.io/Nim/system.html#HSlice see also the procs which take a HSlice for reference |
15:21:38 | narimiran | or maybe what you want is `toOpenArray` |
15:21:57 | FromGitter | <Vindaar> yeah, good point |
15:22:07 | clyybber | Araq: Damnit, actually I *must* cache/store it somewhere (I only need to store which case branches will be taken for an object constructor) since I don't have access to the caseContext in transf |
15:22:09 | FromDiscord | <Aidiakapi> I've actually used `Slice[char]`, but slicing a `string` just gives me a new `string` instead of a slice... 🤔 |
15:25:06 | Araq | clyybber: I know you spent lots of effort on this already but I'm beginning to dislike this feature. |
15:25:23 | Araq | 1. it looks vastly more complex to implement than thought. |
15:25:49 | Araq | 2. it bites somewhat with our goals of enforcing explicit inits for 'not nil' refs. |
15:26:54 | Araq | 3. it also bites Nim's 'alloc0' pattern. binary zero is the default value... |
15:27:06 | * | narimiran_ joined #nim |
15:27:56 | * | narimiran quit (Ping timeout: 276 seconds) |
15:30:03 | clyybber | Araq: It's actually pretty easy to implement, but it bites itself a bit with the design of the compiler currently. |
15:31:05 | clyybber | 2: It shouldn't affect explicit init for not nil refs at all. After all the default initialization for `var a: T` will only happen if T is an object type, not a ref object. |
15:31:18 | clyybber | Or at least thats what makes the most sense to do IMO. |
15:31:35 | * | narimiran_ is now known as narimiran |
15:34:04 | clyybber | the feature is also really useful. It should make range fields, embedded objects and the like much less cumbersome to use. |
15:34:26 | clyybber | I think it really fits into nim. |
15:35:42 | disruptek | you should add some tests to your pr. |
15:36:03 | clyybber | Yeah |
15:37:29 | FromDiscord | <mratsim> Maybe we need to redesign the compiler 😛 |
15:37:45 | Araq | be my guest |
15:38:22 | Araq | in the long run few compilers survived but plenty of programming languages did. |
15:38:58 | Araq | it's why we also work on a good spec. |
15:40:12 | FromGitter | <mratsim> for now I'll just design a multithreading library |
15:40:21 | disruptek | my first nimph distribution has a >10x compression ratio. my 2nd includes npeg and is only 2.5:1. thanks, zevv. |
15:40:27 | FromGitter | <mratsim> then I'll design a compiler for linear algebra / machine learning |
15:40:49 | FromGitter | <mratsim> implemented in macros first, then with a LLVM Jit |
15:41:01 | FromGitter | <mratsim> and if I still have a few years left I'll see about Nim compiler |
15:41:12 | Zevv | disruptek: your welcome. |
15:41:28 | Zevv | There's a whole punch of PDF papers in the repo, that adds up |
15:41:39 | FromGitter | <mratsim> oh and I need to maintain arraymancer as well. yep Nope sorry, no redesign of Nim compiler for me |
15:41:40 | Zevv | you're |
15:41:45 | Araq | however, open source changes the game, apparently. CPython is still around as is Clang and GCC and FPC ... |
15:41:50 | FromGitter | <mratsim> I'll just ping you to ask you for new features |
15:41:53 | disruptek | maybe distributions should be use-only with no git history. |
15:42:09 | * | Vladar quit (Quit: Leaving) |
15:42:23 | FromGitter | <mratsim> the git hash of included package/compiler/nimble should still be available though |
15:42:42 | Araq | though GCC seems to lose against Clang. I read Google only supports clang extensions now |
15:42:44 | FromDiscord | <Chiqqum_Ngbata> Should be able to set the git depth |
15:42:56 | disruptek | yeah, this is dumb. disk space costs nothing. |
15:43:09 | disruptek | the depth is set to 1 and these are bare repositories to boot. |
15:43:21 | clyybber | mratsim: The compiler isn't badly designed though. It doesn't need a redesign IMO. My problem is actually really easy to phrase: I need a way to pass information from sem to transf. |
15:44:24 | FromDiscord | <mratsim> I was n't really criticizing the compiler, so far I managed to get may way around quite easily, except the semcheck part |
15:45:14 | * | floppydh quit (Quit: WeeChat 2.6) |
15:45:43 | Araq | I think the compiler is ok, parts are terrible, parts are really good |
15:45:52 | clyybber | Araq: The only problem is findUsefulCaseContext for my PR |
15:46:36 | Araq | I have a "better design" in my head that is unproven but eventually it'll leave my head |
15:46:44 | disruptek | thank dog. |
15:46:57 | disruptek | drinking helps. |
15:47:42 | clyybber | Araq: WDYT of getting rid of findUsefulCaseContext and refining types inside of case branches generally? |
15:48:38 | FromDiscord | <treeform> Araq, how's fight with the new GC going? |
15:48:53 | FromDiscord | <treeform> Any news from the front? |
15:49:04 | Araq | treeform: https://github.com/nim-lang/Nim/pull/12626 |
15:49:25 | Araq | it's coming around, I'm beginning to understand the problems |
15:49:52 | FromDiscord | <treeform> Are there any docs on how to use it? |
15:50:10 | FromDiscord | <treeform> I tried to figure it out but got confused fast |
15:50:31 | Araq | https://github.com/nim-lang/RFCs/issues/177 docs are here |
15:50:58 | Araq | compile via --gc:destructors, don't have cycles. |
15:52:03 | Araq | still in alpha state. I'm trying to convince clyybber to work on it instead of on default values :P |
15:52:27 | clyybber | Like `int i; case i of 1..10: #Now the compiler could generally treat i like it has the type range[1..10]` |
15:54:57 | Araq | clyybber: I understand but you can getType() i's type so everything you do affects the bloody macro system |
15:55:43 | clyybber | Ugh, yeah. Well fear not. I found a way to do findUsefulCaseContext in transf easily :) |
15:56:15 | * | tklohna quit (Ping timeout: 246 seconds) |
15:58:50 | FromDiscord | <treeform> Araq, I have not seen that rfc, thanks! |
16:06:39 | * | theelous3 joined #nim |
16:10:47 | * | rayman22201 joined #nim |
16:20:53 | clyybber | ayy, rayman22201 |
16:23:07 | Zevv | what/whose is disbot? |
16:23:47 | clyybber | disrupteks |
16:26:02 | rayman22201 | Good morning 😝 |
16:26:25 | rayman22201 | Not quite online yet. Cooking breakfast. I will be on in about an hour |
16:27:36 | clyybber | haha, breakfast. Its getting dark here |
16:27:41 | clyybber | and I hate it |
16:29:20 | * | berndl quit (Quit: WeeChat 2.5) |
16:30:08 | * | endragor joined #nim |
16:34:50 | * | endragor quit (Remote host closed the connection) |
16:37:53 | rayman22201 | You could always come visit 😉 we have a lovely climate in the south western US. |
16:39:18 | shashlick | @disruptek - how easy is it to use the disbot to monitor private messages and post on a channel when one is received? |
16:39:43 | disruptek | it's easy, but why would you want to do that? |
16:40:08 | disruptek | oh, you want it to mirror to #shashlick? |
16:40:16 | shashlick | yep |
16:40:31 | shashlick | right now i use matterbridge to irc <=> slack but it doesn't do pms |
16:41:49 | FromDiscord | <treeform> So with the --gc:destructors we don't have to do anything? No owned refs, just have to think about cycles and iterators? |
16:41:56 | shashlick | so i've setup a znc so matterbridge can do what it does through znc but this tool will communicate to me if i get a pm and then i can use an irc client to connect to the znc and do talk that way |
16:42:43 | disruptek | that would be weird. it would make more sense to just run the bot on your irc handle and just have matterbridge pass messages to/from it. |
16:43:27 | disruptek | or do you not have a way to bridge to matterbridge yourself? |
16:43:32 | shashlick | matterbridge needs an irc server |
16:43:46 | shashlick | matterbridge doesn't support pm bridging |
16:43:56 | shashlick | but for everything else, it is great |
16:44:07 | shashlick | i don't need to see any FromGitter nonsense anymore |
16:44:38 | shashlick | so freenode <-> znc <-> matterbridge <-> slack |
16:44:59 | shashlick | and freenode <-> znc <-> tool |
16:45:14 | shashlick | where tool will post back from pm to a channel which matterbridge can then bridge over |
16:45:16 | shashlick | notification |
16:45:39 | shashlick | right now the option is freenode <-> znc <-> weechat <-> trigger <-> script to post to slack |
16:46:24 | disruptek | this seems pretty ridiculous to me. |
16:48:27 | disruptek | is the problem that the api doesn't support pm bridge or is the problem that your impl doesn't support it? |
16:49:10 | clyybber | the art of overengineering |
16:51:02 | shashlick | That's life |
16:51:18 | narimiran | too much of those <->'s |
16:51:25 | shashlick | Tell me about it |
16:52:15 | shashlick | I added znc last night |
16:52:35 | shashlick | And can use a separate account for it and call it done |
16:52:43 | shashlick | But I'll have no notifications |
16:54:04 | shashlick | How do you get notifications on your phone for irc |
16:54:21 | shashlick | Without running a client all the time |
16:54:43 | disruptek | why would i want that? |
16:54:51 | FromGitter | <Vindaar> findings so far: in the "slow" proc for some reason the `readCsv` call causes a crazy amount of string copies and gc collections (? I think, collectCT calls), which don't happen in the "fast" proc. Compiling with --gc:boehm makes both cases equally fast (and a tiny bit slower than the "fast" refc case) |
16:55:27 | disruptek | turn it off/on around the call. |
16:59:57 | Zevv | @endragor @pmunch here? |
17:02:29 | shashlick | I'm on here all the time so I want to be pm'able also |
17:02:51 | shashlick | Only way to do that is to have znc |
17:03:16 | shashlick | I'm just asking if it a small lift to get notified of pm's |
17:03:56 | disruptek | can you just bridge the "shashlick" (not "#shashlick") channel to something that'll alert you? that should be all it requires. |
17:04:04 | * | uu91 quit (Read error: Connection reset by peer) |
17:04:18 | * | uu91 joined #nim |
17:04:51 | * | nsf quit (Quit: WeeChat 2.6) |
17:34:53 | * | MarderIII joined #nim |
17:39:33 | FromGitter | <mratsim> @Araq I think you missed a RFC: your plans to use Z3 to remove bound checks |
17:43:31 | shashlick | What does shashlick map to? Pm's won't be a channel would it? |
17:43:35 | disruptek | how about an rfc describing how you want user-supplied source code filters to exist? |
17:44:03 | disruptek | shashlick: "shashlick" is a channel holding your pms. "#shashlick" is a public channel named "shashlick". |
17:44:58 | * | Vladar joined #nim |
17:45:00 | disruptek | ie. think of it as the destination of a message. |
17:45:06 | * | hoijui joined #nim |
17:51:23 | * | Trustable quit (Remote host closed the connection) |
18:03:44 | shashlick | Ok I'll try with matterbridge |
18:06:43 | rayman22201 | @clyybber you still here? I'm finally on |
18:10:47 | FromGitter | <kaushalmodi> Araq |
18:11:33 | FromGitter | <kaushalmodi> I just asked Cadence if they can spare a license to help you debug the Nim/SV interface, and they can! |
18:11:48 | FromGitter | <kaushalmodi> Though, would you have time/will to try it out? |
18:11:59 | FromGitter | <kaushalmodi> If so, let me think how to make this work. |
18:13:15 | * | GordonBGood joined #nim |
18:13:59 | clyybber | rayman22201: Yeah I'm here |
18:14:08 | lqdev[m] | can {.compileTime.} variables be used at runtime? |
18:15:06 | clyybber | yes, but I wouldn't rely on it |
18:15:13 | clyybber | It should be changed IMO |
18:15:35 | clyybber | lqdev[m]: Its better to use a const as a "bridge" between compile and runtime |
18:15:52 | rayman22201 | so, where should we start? |
18:16:08 | clyybber | rayman22201: Diffing the C code |
18:16:18 | lqdev[m] | I need var because I have a table into which I insert dynamically in a macro |
18:16:40 | rayman22201 | ok. 👍 |
18:16:46 | lqdev[m] | guess I'll just generate some small glue to bridge the data from the compileTime table into runtime table. |
18:16:58 | clyybber | lqdev[m]: Yeah, and when you are finished modifying the table, asssign it to a const |
18:17:31 | clyybber | Ah, there might be some hickups with compiletime -> runtime for tables |
18:17:38 | clyybber | I'm not sure that will work |
18:17:43 | lqdev[m] | clyybber: I can't exactly tell when I'm finished working with the table |
18:17:58 | clyybber | oh |
18:18:14 | * | GordonBGood quit (Ping timeout: 276 seconds) |
18:18:19 | clyybber | well, then just try to use it the {.compileTime.} variable at runtime |
18:21:06 | * | uu91 quit (Ping timeout: 265 seconds) |
18:21:28 | * | uu91 joined #nim |
18:21:51 | rayman22201 | it's a noisy diff clyybber :/ |
18:23:06 | * | fanta1 quit (Quit: fanta1) |
18:23:17 | clyybber | rayman22201: Oh, why? |
18:23:19 | rayman22201 | http://ix.io/21cu |
18:23:21 | disbot | ^ play at https://play.nim-lang.org/#ix=21cu 😏 |
18:23:23 | rayman22201 | good question |
18:23:52 | clyybber | rayman22201: Because diff is shite |
18:23:57 | rayman22201 | hahahaha |
18:24:05 | clyybber | Just cd into the cache dir |
18:24:08 | clyybber | and do git init |
18:24:34 | rayman22201 | use git diff instead of unix diff? |
18:24:39 | clyybber | yeah :p |
18:27:09 | rayman22201 | http://ix.io/21cw |
18:27:10 | disbot | ^ play at https://play.nim-lang.org/#ix=21cw 😏 |
18:27:53 | rayman22201 | fun fact. you can use `git diff --no-index <fileA> <fileB>` to compare two arbitrary files |
18:28:21 | clyybber | nice |
18:29:06 | clyybber | well |
18:29:10 | clyybber | thats still pretty big |
18:29:16 | rayman22201 | indeed |
18:29:52 | clyybber | maybe use a diff viewer to see the parts that actually matter |
18:31:07 | clyybber | This already is much better: http://ix.io/21cw/diff |
18:31:27 | clyybber | but it doesn't highlight on a char level |
18:32:21 | rayman22201 | some of the changes are just noise from the hash generation |
18:32:36 | clyybber | yeah, we should get rid of that |
18:33:44 | rayman22201 | I remember arguing about the hashing when I was doing the godbolt project, but I already forgot everything about it :-P |
18:35:31 | rayman22201 | line 205 - 213 seems interesting |
18:35:46 | disruptek | if you can use kitty, kitty's side-by-side diff is decent. |
18:36:50 | rayman22201 | but I'm lazy! I don't want to install more tools :P |
18:36:54 | * | hoijui quit (Ping timeout: 246 seconds) |
18:37:17 | disruptek | you are a win/vsc user, right? |
18:37:46 | clyybber | rayman22201: One small sin I did, was use an online diffing tool while working on newruntime :p |
18:38:19 | rayman22201 | I have windows, but I use an Ubuntu VM most of the time actually :-P |
18:38:33 | clyybber | it worked pretty well, because it highlighted per byte, meaning it was pretty easy to identify when something actually changed and not some hash hashed hashing |
18:38:40 | disruptek | so what do you edit in? |
18:38:45 | rayman22201 | vim |
18:38:56 | rayman22201 | vim4life baby ;) |
18:39:15 | rayman22201 | I will say, I use neo-vim. I'm somewhat modern |
18:39:17 | * | adeohluwa joined #nim |
18:39:33 | rayman22201 | what's a good online diff tool? |
18:39:48 | clyybber | diffchecker used to be good |
18:39:52 | clyybber | but its total bullcrap now |
18:39:58 | clyybber | they redesigned the website |
18:40:24 | disruptek | it doesn't matter; he doesn't want to install more tools. |
18:40:49 | rayman22201 | :-P |
18:41:08 | disruptek | if you have vim installed, you might have vimdiff. |
18:41:38 | clyybber | rayman22201: I have a ~great~ idea |
18:41:55 | clyybber | we use sed to delete lines where only the hash or indentation changed |
18:41:57 | rayman22201 | kitty is a whole damn terminal emulator disruptek :-P |
18:42:11 | rayman22201 | I can use VS code. give me a sec |
18:42:36 | disruptek | if you don't care about whitespace, just turn whitespace off in the diff. |
18:42:53 | disruptek | i think it's -w in git diff. |
18:44:03 | clyybber | ah right |
18:45:01 | rayman22201 | that didn't make much a difference |
18:45:18 | rayman22201 | good idea in theory though |
18:46:14 | Zevv | too bad pmunch: Error: VM problem: too many registers required |
18:46:16 | rayman22201 | how do I diff in vscode? |
18:46:52 | rayman22201 | got it |
18:46:57 | Zevv | 'meld' is a nice diff: https://meldmerge.org/ |
18:47:05 | Zevv | give it a try |
18:48:15 | rayman22201 | I'm using the VSCode tool now. it's pretty fancy actually |
18:48:26 | rayman22201 | If that doesn't work I will try meld though. |
18:48:27 | rayman22201 | thanks |
18:48:54 | * | narimiran quit (Quit: Leaving) |
18:49:15 | * | narimiran joined #nim |
18:49:45 | Zevv | yeah last time i recommend you something duuuude |
18:49:49 | Zevv | pffff |
18:49:55 | Zevv | :) |
18:50:03 | clyybber | *pffffffs out the window* |
18:50:26 | Zevv | you also got 7 inches of snow yet? |
18:50:31 | rayman22201 | hahaha. Spoken like the true resident Dutch German :-P |
18:51:30 | clyybber | Zevv: No snow :( |
18:51:48 | clyybber | We never get anything nice. We get boring |
18:51:58 | clyybber | Neither particularily cold or hot or whatever |
18:52:16 | clyybber | but at times we get very dense fog, which is cool |
18:53:07 | Zevv | I love that, but's not often here |
18:55:28 | clyybber | I just hate how it gets dark at 6pm |
18:55:47 | clyybber | but thats just because of wintertime |
18:56:17 | Zevv | for some here it doesn't get darky in winter |
18:56:18 | Zevv | anymore |
18:56:24 | Zevv | it just stays like that all of the time |
18:56:37 | clyybber | wait you are in the netherlands right? |
18:56:45 | Zevv | 'here' I mean at #nim :) |
18:57:10 | clyybber | i was like wtf we must be living on different earths |
18:57:13 | clyybber | lol |
18:57:51 | Zevv | I'm perfectly fine here. If I lived above the arctic circle I'd be a alcoholic |
18:57:54 | Zevv | only way to cope with that |
18:58:00 | rayman22201 | Zevv lives on the moon :-P |
18:58:20 | rayman22201 | or maybe Mars. He is definitely a Martian |
18:59:13 | clyybber | the vodka warms your throat |
18:59:46 | clyybber | in the same way as stabbing your throat with a stick warms your throat |
19:00:12 | FromGitter | <mratsim> you can recover from Vodka though |
19:00:19 | rayman22201 | so, the leaking version has an extra call to `eqDestroy`. I find that interesting, but I don't see how it would cause the leak |
19:00:37 | narimiran | @mratsim not if you drink the right amounts :P |
19:01:12 | rayman22201 | you have to be really desperate to drink a potatoe :-P |
19:01:59 | rayman22201 | brb |
19:02:27 | clyybber | birb |
19:02:37 | FromGitter | <mratsim> btw how much time do you need for your test scrpt for shifts? |
19:02:44 | rayman22201 | here are the C files if you want to try to investigate yourself https://usercontent.irccloud-cdn.com/file/vWl7XMkh/mbasicAsyncNoLeaks.nim.c https://usercontent.irccloud-cdn.com/file/AHS8Mvt0/mbasicAsyncLeaks.nim.c |
19:03:45 | narimiran | @mratsim if you're asking me, solitudesf tested a small snippet on raspberry pi, and he couldn't reproduce the fail i get on CIs. so i decided just to cure the symptom this time.... |
19:05:16 | FromGitter | <mratsim> yes I was |
19:05:45 | FromGitter | <mratsim> OK sounds good, please give me consistent shifts and bit operation,, that's all |
19:05:53 | FromGitter | <mratsim> oh and working modulos |
19:05:57 | narimiran | :D |
19:06:10 | narimiran | just don't use 32-bit OS on 1.0.x and you'll be fine :P :D |
19:06:20 | narimiran | or maybe you can use even that |
19:06:28 | narimiran | but don't use 32-bit travis :P |
19:06:36 | FromGitter | <mratsim> well I had a presentation with a Raspbery Pi a month ago, live demo |
19:06:41 | clyybber | rayman22201: Compiling without -g/--debugger:native will yield more readable results |
19:06:57 | FromGitter | <mratsim> we use Azure Pipelines (previously appveyor) to test on Win32 |
19:06:58 | clyybber | those #line directives are kinda annoying |
19:07:10 | FromGitter | <mratsim> yeah, the #line are super noisy |
19:08:24 | narimiran | @mratsim if you have some extra time, this https://play.nim-lang.org/#ix=21ap is what fails on 32-bit, on version-1-0 branch |
19:08:53 | narimiran | this is an example from colors.nim runnableExample |
19:09:25 | narimiran | this (255, 0, 255) is not that, but (0, 0, 0) and i have no idea why |
19:10:17 | clyybber | rayman22201: This https://www.jstoolset.com/diff isnt too bad |
19:13:10 | FromGitter | <mratsim> I've created this issue @narimiran, https://github.com/status-im/nim-stint/issues/99 |
19:13:32 | narimiran | i've got the notification, i'll write more details there |
19:30:16 | * | nsf joined #nim |
19:38:12 | rayman22201 | I'm back. |
19:38:21 | * | hoijui joined #nim |
19:38:24 | rayman22201 | good idea. I will recompile with less noisy flags |
19:38:35 | rayman22201 | and make more coffee :-P |
19:40:23 | * | hoijui quit (Client Quit) |
19:40:52 | * | adeohluwa quit (Remote host closed the connection) |
19:46:03 | rayman22201 | other weird noise, like the "exception" struct getting declared on a different line. annoying |
19:49:31 | rayman22201 | still not a release build, but hopefully less noise https://usercontent.irccloud-cdn.com/file/k7qlGRYg/mbasicAsyncLeaks.nim.c https://usercontent.irccloud-cdn.com/file/homVcvOI/mbasicAsyncNoLeaks.nim.c |
19:54:41 | narimiran | btw, @mratsim, have you seen https://swift.org/blog/numerics/ ? |
20:00:24 | * | lritter joined #nim |
20:07:40 | FromDiscord | <krab4t> how you do ` bitwise NOT ` or ` bitwise OR ` in nim? im lost |
20:08:17 | FromDiscord | <krab4t> ~ and | |
20:08:42 | narimiran | by using `not` and `or` :) |
20:08:51 | FromDiscord | <krab4t> WTF |
20:11:10 | narimiran | https://play.nim-lang.org/#ix=21d9 |
20:26:55 | FromDiscord | <demotomohiro> bit operators are defined in system module. |
20:30:11 | FromDiscord | <IanIAnIAN> stb_image is going to make me explode |
20:37:21 | Calinou | it'll explode into nothings |
20:37:22 | * | Calinou hides |
20:38:05 | rayman22201 | clyybber: https://www.jstoolset.com/diff/053a38ab6f775ce0 |
20:38:23 | rayman22201 | I moved around some of the definitions by hand to reduce some of the noise |
20:39:17 | rayman22201 | some interesting observations. The no leak version has `genericReset` and the leaking version does not. |
20:40:54 | rayman22201 | the code generated for `assign` is exactly equal to the code generated for `=`. This is good lol. We know it's not the `=` implementation itself, but some other thing. |
20:41:09 | lqdev[m] | how much slower is -d:release with --stacktrace:on compared to just -d:release? |
20:41:17 | lqdev[m] | is it a substantial difference? |
20:42:39 | FromDiscord | <IanIAnIAN> can anyone recommend a substitute for stb_image , it just won't play nicely on my windows |
20:42:47 | clyybber | rayman22201: Hmm, interesting |
20:43:45 | rayman22201 | another interesting note. the leaking version generates an `=sink` proc that does what you expect. The non-leaking version does not generate any `=sink` procs |
20:44:07 | rayman22201 | Idk if that matters |
20:44:34 | Zevv | Error: internal error: (filename: "vmgen.nim", line: 179, column: 16) |
20:44:38 | Zevv | bwah |
20:44:48 | rayman22201 | another big difference is the closure on line 499 |
20:45:23 | Calinou | @IanIAnIAN what image formats do you need to support? |
20:45:54 | rayman22201 | the `=` / leaking version generates this "safepoint" code, that the `assign` / leaking version does not |
20:46:11 | rayman22201 | that is the biggest actual "algorithm" difference I see |
20:48:24 | FromDiscord | <IanIAnIAN> I want only png really |
20:49:03 | lqdev[m] | @IanIAnIAN try nimPNG |
20:51:57 | rayman22201 | @Zevv you need my branch to follow along at home :-) https://github.com/rayman22201/Nim/tree/async-with-dispose |
20:54:00 | Zevv | oooh |
20:54:19 | Zevv | dude you were only going to fix flowvars, remember |
20:54:34 | Zevv | you will be assimilated |
20:54:47 | Zevv | resistance is futile |
20:54:50 | rayman22201 | hahaha. Yup. I'm in too deep now |
20:59:01 | FromGitter | <alehander92> how to |
20:59:28 | FromGitter | <alehander92> hm |
21:00:17 | rayman22201 | `genericReset` is only called once at the start of `NimMainModule`. It looks like the `=` version does a essentially equivalent thing using `nimZeroMem` and `=sink` |
21:00:27 | rayman22201 | So I don't think genericReset is the culprit here |
21:00:54 | FromGitter | <Vindaar> if anyone is bored and wants to read a half rant / half informational / half (yeah that's 3/2) "me showing how little I know" piece about slow code, here you go: ⏎ https://gist.github.com/Vindaar/0fe9340d40e3b70c006e8b5c3c380f87 |
21:01:59 | rayman22201 | looks fascinating, will read when I'm not so in the weeds with my own code issues :-P |
21:04:26 | disruptek | fun, thanks. |
21:04:49 | * | Vladar quit (Quit: Leaving) |
21:10:14 | * | joachimschmidt55 joined #nim |
21:11:23 | rayman22201 | the safepoint stuff involves getting a reference to the current frame. but that doesn't seem relevant. |
21:12:11 | Zevv | Vindaar: nice read, I had similar adventures the other day, nice to see you in the same tar pit :) |
21:12:17 | Zevv | add a "conclusion" section to the end though :) |
21:13:37 | Zevv | I got some nice tips from mratsim, about code alignment. Not something that's trivial to influence, but if your code happens to be put somewhere at the border of two I cache lines stuff slows down |
21:16:34 | * | tklohna joined #nim |
21:20:25 | FromDiscord | <IanIAnIAN> I find nimPNG's documentation partially unreadable, I guess that's just me |
21:31:29 | FromGitter | <alehander92> you should make it a blog article vindaar |
21:33:41 | rayman22201 | after staring at this diff for an hour lol... my intuition is telling me that it may have something to do with `=sink` |
21:34:17 | rayman22201 | That's the biggest fundamental difference I can see |
21:34:33 | FromGitter | <Vindaar> @Zevv: heh, nice not to be alone ;) yeah, I could add a conclusion, but the thing is I don't have one yet. It's way too late already (gotta get up at 5 am, it's 10:30pm already here). The hunt continues tomorrow and then I might add one. ⏎ @alehander92 I should. I should start writing articles anyways... We'll see! |
21:36:45 | * | cgfuh quit (Ping timeout: 268 seconds) |
21:37:11 | FromGitter | <kaushalmodi> @Vindaar The source is already Org, just install ox-hugo and you have a blog ;-) |
21:38:23 | FromGitter | <Vindaar> and about alignment and stuff. I vaguely get the idea, but I don't even have the faintest clue how that applies to code that's so far away from low level. ⏎ @kaushalmodi yes, I know :P I actually wanted to check that out because of you anyways |
21:41:10 | * | Snackys joined #nim |
21:41:39 | * | adeohluwa joined #nim |
21:42:09 | * | Snackys quit (Remote host closed the connection) |
21:44:41 | clyybber | rayman22201: I think so too, but sink is just an assignment inside a proc basically |
21:44:50 | * | nsf quit (Quit: WeeChat 2.6) |
21:46:23 | rayman22201 | I'm running out of ideas |
21:46:52 | rayman22201 | I'm still curious about your valgrind results too.... |
21:47:14 | rayman22201 | Is it actually leaking, or is the count just broken? |
21:51:06 | FromDiscord | <krab4t> so this how you invert colors ` toHex(0 or not int(rgb), 6) ` |
21:51:37 | rayman22201 | side note: I'm a bit surprised `=sink` is not `=sink[T](dst, src: var T)`, to allow you to nil out the src (like a C++ move constructor) |
21:52:41 | rayman22201 | But I guess it doesn't matter anyway since src should be destroyed right afterwards anyway... |
21:52:59 | FromDiscord | <krab4t> https://play.nim-lang.org/#ix=21e3 |
21:55:01 | clyybber | rayman22201: Yeah the signature of =sink is supposed to be like that. |
21:56:19 | * | thomasross quit (Read error: Connection reset by peer) |
21:56:34 | * | thomasross joined #nim |
21:57:06 | clyybber | rayman22201: I have an idea, we put it in a loop and try to make it leak really hard, (in terms of alloc/dealloc ratio) |
21:57:16 | clyybber | and then we check if it *really* leaks |
21:58:04 | rayman22201 | lol |
21:58:30 | rayman22201 | My concern with that, is what if there are other leaks from independent things |
21:58:45 | rayman22201 | (I don't trust nim code I didn't write to not leak :-P) |
22:05:34 | FromGitter | <mratsim> @Vindaar you forgot the flags that remove the cfi directives in your investigation |
22:09:12 | FromGitter | <mratsim> @narimiran looking |
22:09:30 | FromGitter | <mratsim> I was expecting to see Swift for Tensorflow by Google but let's see what Apple cooked |
22:11:06 | * | adeohluwa quit (Remote host closed the connection) |
22:11:21 | FromGitter | <mratsim> for now nothing exciting, it's just `import math` |
22:12:59 | * | adeohluwa joined #nim |
22:13:00 | * | adeohluwa quit (Remote host closed the connection) |
22:14:50 | * | tklohna quit (Ping timeout: 276 seconds) |
22:14:57 | * | adeohluwa joined #nim |
22:16:14 | clyybber | rayman22201: Build the loop, then to verify its your code remove it and see if it (still?) leaks |
22:16:58 | * | adeohluwa quit (Remote host closed the connection) |
22:20:16 | Araq | lqdev[m]: it is substantial, avoid it |
22:21:01 | rayman22201 | putting some printf tracing shows that the `=` variant allocs 6 buffers but only frees 3 |
22:21:20 | rayman22201 | the assign variant allocs 2 and frees 2 |
22:21:30 | rayman22201 | something is wrong with the `=` code |
22:21:31 | lqdev[m] | right. how can I embed crash info for end users in my apps? so when an app crashes, they can open a github issue without having to build it from source? |
22:21:50 | lqdev[m] | open a github issue with a stack trace, or some other useful info. |
22:22:41 | rayman22201 | That's for clyybber (and maybe araq) |
22:22:44 | Araq | there are native ways to get a stack trace but it depends on your OS |
22:23:12 | clyybber | rayman22201: Hmm |
22:23:27 | * | adeohluwa joined #nim |
22:23:33 | clyybber | Araq: Where do we assign types to int literals? |
22:23:58 | clyybber | Because I'm getting assertion errors on bootstrapping because some int literal's type is nil |
22:25:53 | * | al_ joined #nim |
22:26:57 | * | adeohluwa quit (Remote host closed the connection) |
22:27:34 | * | al_ quit (Client Quit) |
22:28:12 | * | Jesin quit (Quit: Leaving) |
22:30:23 | Araq | magicsys.getIntLitType |
22:30:26 | * | crem quit (Ping timeout: 276 seconds) |
22:33:04 | * | solitudesf quit (Ping timeout: 264 seconds) |
22:33:15 | clyybber | Thanks, btw Araq. I remember having issues with that exact thing (nkIntLits without their type == nil) when working on another thing in the compiler. |
22:33:43 | clyybber | I think it was the =move PR or one ofthe injectdestructors refactorings.. can't remember |
22:34:04 | clyybber | But this isn't intended right? |
22:35:05 | * | Jesin joined #nim |
22:41:58 | * | narimiran quit (Ping timeout: 245 seconds) |
22:43:04 | * | jjido joined #nim |
22:45:37 | FromGitter | <Vindaar> @mratsim "forgot" implies I knew of their existence..! Thanks, I'll take a look tomorrow. ⏎ and now, good night everyone :) |
22:52:04 | FromDiscord | <krab4t> lqdev[m] im pretty sure you need debug symbols for that, and that magic from google's breakpad |
22:52:52 | rayman22201 | https://www.irccloud.com/pastebin/LUMG2sZG/ |
22:54:03 | rayman22201 | https://www.irccloud.com/pastebin/GCj6WfcX/ |
22:54:26 | rayman22201 | the `=` version produces a lot of intermediate allocs |
22:58:11 | * | MarderIII quit (Quit: Leaving) |
22:58:59 | clyybber | Which shouldn't be a problem unless they produce copies on the heap, might be worth counting those. |
22:59:01 | clyybber | bbl |
22:59:03 | clyybber | gn8 |
22:59:04 | * | clyybber quit (Quit: WeeChat 2.6) |
22:59:14 | rayman22201 | gn |
23:06:30 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:21:51 | FromDiscord | <exelotl> @IanIAnIAN not just you, I've written substantial stuff with nimPNG and it's like, really not obvious how to actually use it |
23:41:24 | * | shashlick quit (Remote host closed the connection) |
23:41:55 | * | shashlick_ quit (Quit: quit) |
23:42:48 | * | shashlick joined #nim |
23:49:24 | enthus1ast | any idea why a runningExamples block with `discard waitFor socket.recvFrom(MSG_LEN)` blocks forever? |
23:50:17 | enthus1ast | or another way i could write this that does not block :) |
23:51:31 | enthus1ast | mh asyncCheck but then the example is not so good ... |
23:56:54 | * | jjido joined #nim |