<< 08-11-2019 >>

00:01:02*fredrik92 quit (Ping timeout: 276 seconds)
00:03:09rayman22201system.dispose == system.deepDispose?
00:03:10clyybberrayman22201: 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:40rayman22201I'm loosing you?
00:03:48rayman22201there is no intermediate string afaik
00:04:00clyybberuh sorry
00:04:05clyybberintermediate Buffer
00:04:15clyybberyou wrote that as a comment in your asyncProc
00:04:16clyybberbody
00:04:35rayman22201hold on. I have a newer version of that test.
00:04:55clyybberHeres the C code for dispose:N_LIB_PRIVATE N_NIMCALL(void, dispose__KUefff9bFSbOH8KIBUi3rSw)(tyObject_DisposableFuturecolonObjectType___Lfg2yGJjDOfBeOhIorLQ0Q** future) {
00:04:56clyybber nimfr_("dispose", "/tmp/Nim/lib/pure/asyncfutures.nim");
00:04:58clyybber nimln_(177, "/tmp/Nim/lib/pure/asyncfutures.nim");
00:05:00clyybber deepDispose__w5kI9bH9ai2XW0mXr3WWKtdQsystem(future);
00:05:02clyybber popFrame();
00:05:04clyybber}
00:05:06clyybberSorry for the paste
00:05:12rayman22201http://ix.io/218n
00:05:52rayman22201the thing to note is that, using `assign` does the correct thing. Using `=` appears to leak.
00:06:06clyybberHmm
00:07:15clyybberrayman22201: Theres one
00:07:22clyybber"best" way to find out
00:07:35rayman22201also interesting to note, is that with `=` there is an extra visit to the buffer node inside the `gc_ms.nim` "forAllChildren" proc
00:08:19clyybberDiff the outputted C code of the leaking and non leaking variants
00:08:25rayman22201ohhh. That C code you pasted is a red herring
00:08:31clyybberoh
00:08:35rayman22201that is my own dispose I wrote to account for a different bug
00:08:39clyybberah, haha
00:08:46clyybberAlright, I didn't check the hashes
00:09:10rayman22201I wrote an override specific for futures. yeah. there is a lot of context here
00:09:50clyybberAre you there tomorrow? I might be a bit less dumb then :p need to sleep
00:10:07rayman22201I will try to be :-)
00:10:14rayman22201gn
00:10:18clyybbergn8
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:35FromGitter<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:17FromGitter<kayabaNerve> Although narimiran summed it up perfectly when the discussion occurred.
02:58:41FromGitter<kayabaNerve> Can I suggest `removed` for a feature which no longer exists since X.Y?
02:59:28FromDiscord<Rika> Removed sounds like the next step after deprecated
02:59:32FromDiscord<Rika> Which is nice
03:00:03FromGitter<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:27kevin5👑
03:57:19kevin50
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:53hemiteHello, is there an editor that has great nim support, including debugging ( callstack, breakpoints, etc )?
04:48:18hemiteI 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:22FromGitter<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:52hemiteThanks, I was looking at that but it didn't seem like debugging support was there yet
04:56:06hemiteother than that it looked fairly complete
04:56:07FromGitter<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:59FromDiscord<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:06AraqkayabaNerve: I think the common name for it is "obsolete"
06:33:57Araqbut it means we need to keep cruft even longer than we currently do, so it's not really desirable for us
06:36:02GordonBGoodAraq: 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:06GordonBGoodThe 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:38GordonBGoodError: the destructor that is turned into a finalizer needs to have the 'nimcall' calling convention
06:37:39narimiran@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:42GordonBGoodThis 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:30GordonBGoodShould I do an issue for this?
06:42:00GordonBGoodSecond issue isn't so big because it's rarely needed and there is a neat workaround...
06:42:45Araqhow is this serious? the destructor must be '.nimcall'
06:43:15GordonBGoodI made the destructor `.nimcall` and still get the error
06:43:36Araqyou also made it .inline
06:43:55Araqmost likely the backend check is wrong, very simple to fix
06:44:34Araqccgexprs.nim line 1217
06:44:37Araqbt.destructor.typ.callConv != ccDefault -->
06:44:49Araqbt.destructor.typ.callConv notin {ccDefault, ccNimcall}
06:45:04GordonBGoodSorry, you are right, taking out the `.inline` makes it work, and then `.nimcall` is the default
06:45:16Araqno
06:45:23Araqsorry, there is no ccNimcall
06:45:35Araqthere only is ccDefault and it's the same as .nimcall
06:45:48Araqso yeah, no bug here
06:47:00GordonBGoodYes, 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:03GordonBGoodOkay, 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:56GordonBGoodhttps://play.nim-lang.org/#ix=219f
06:50:38Araqinternal errors are bugs
06:51:14GordonBGoodThe 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:18GordonBGoodThe error is coming from the same genDestructor you had me look at before
06:57:38GordonBGood^Sorry, genDestroy
06:58:28GordonBGoodLooks 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:12GordonBGoodAnd maybe also not letting calling default destructors do nothing when called, letting the destruction happen at the end of the proc
07:10:55GordonBGoodAs 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:39AraqI'm not a fan of wondering about other valid use cases when we have real, hard bugs to fix
07:58:20GordonBGoodWell, I wasn't wondering, I actually thought I had a need for this
07:59:40GordonBGoodIt'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:26GordonBGoodBut when writing custom destructors for nested things such as objects that contain objects, it could come up...
08:01:03GordonBGoodIf 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:25GordonBGoodIf it's a bug, it should be noted somewhere
08:01:58*stefantalpalaru joined #nim
08:04:00GordonBGoodIt 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:24GordonBGoodIf 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:30PMunchJust pushed a new version of nimlsp that does away with the git submodule stuff :)
08:19:10PMunchBut apparently the nimble pre-build hook doesn't work..
08:19:23PMunchSo it needs to be run manually..
08:22:12*krux02 joined #nim
08:24:03AraqPMunch: what were the downsides of submodules?
08:24:42PMunchWell, mostly that the submodule had to be the same version as the Nim that was compiling the project
08:25:19PMunchNow it finds the installed Nim version that you're using and compiles from its sources instead :)
08:25:30PMunchSo the build process is much easier
08:25:58Araqok :-)
08:26:11Araqis there an agreement on https://github.com/nim-lang/Nim/pull/12599 being better than my solution?
08:26:20PMunchIf 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:04Araqwhat does "worked correctly" mean?
08:27:24*floppydh joined #nim
08:28:07PMunchWell they don't seem to run at all
08:28:41PMunchYou can do nimble build and it will fail. Run the command in the before build section manually and it works just fine
08:28:59PMunchOr explicitly run the task that does the same thing before building
08:30:14PMunchExample: http://ix.io/219x
08:30:15disbot^ play at https://play.nim-lang.org/#ix=219x 😏
08:31:22PMunchAraq, what was your outplace solution by the way? Haven't kept track
08:32:09Araqit's a.outplace(sort()) vs outplace(sort(a)) <-- my solution
08:32:38Araqclybber's works better for chaining and doesn't use 'untyped' as the first argument so it also works better with overloading
08:32:49Araqmy solution is more logical :P
08:33:04PMunchOh yeah, then I'd definitely prefer clybbers version :P
08:33:40PMunchI've been anoyed that chaining where the first argument was a `var` didn't work for the longest time
08:34:02Araqmaybe we should extend it to: a.outplace(sort)
08:34:13Araqdoesn't look as weird then
08:34:20*theelous3_ quit (Ping timeout: 265 seconds)
08:34:24PMunchWell preferably you should be able to do a.outplace(sort(reversed = true))
08:34:40PMunchie pass other arguments to the procedure
08:35:17PMunchKinda like how dot-chaining works normally, just insert the argument as the first element
08:35:20FromGitter<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:22FromGitter<zacharycarter> ?
08:35:57PMunchOh I see that it already works this way, neat!
08:37:28*rayman22201 quit (Quit: Connection closed for inactivity)
08:37:50Araqzacharycarter: maybe I'll continue the work but the primary focus is on https://github.com/nim-lang/RFCs/issues/177
08:38:06FromGitter<zacharycarter> 👍 thanks!
08:38:29FromGitter<zacharycarter> networking code for the RTS I'm making is coming along
08:38:43PMunchOh cool
08:38:48FromGitter<zacharycarter> I already have map rendering prototyped so hopefully soon I'll have something to show
08:38:54Araqso yeah, if you want to know what is going on, now it's documented in the RFCs
08:39:07FromGitter<zacharycarter> I need to pay more attention to them
08:39:32Araqand with yesterdays' RFC I consider them complete, need a Nim2020 milestone for them
08:42:10AraqPMunch: how about a.outplace(sort, more, args, here)
08:42:34Araqthen it's clear (maybe?) that we construct the call from sort(copyOf(a), more, args, here)
08:42:41Araqwell...
08:43:07Araqa.outplace(sort(it, arg1, arg2))
08:43:31Araqwe have 'it' as an idiom
08:48:08PMunchHmm, that is of course also an option
08:48:56PMunchI'll probably make myself an operator like `.!` to do this for me anyways. So I can do a.!sort(arg1, arg2)
08:49:16Araqmratsim has a point though, outplace is a function tranformator; outplace(reverse)(a)
08:56:48FromGitter<alehander92> i wonder if you can do
08:56:49FromGitter<alehander92> inplace
08:57:29FromGitter<alehander92> which injects the argument as a result variable
08:57:33FromGitter<alehander92> and counts on RVO
08:58:03Araqinplace is much more complex
08:58:26FromGitter<alehander92> but probably not yeah, as usually people init explicitly the new result and add to it
08:58:44Araqusually you need it to rewrite all 'result = f(result)' where 'f' is recursive
08:59:28FromGitter<alehander92> yeah
08:59:52Araqlayering FP on top of optimized imperative code works well, extracting optimized imperative code out of FP is harder
09:02:19FromGitter<alehander92> that's true
09:02:34FromGitter<alehander92> which reminds me of the iterator chaining question, i saw a comment somewhere these days
09:04:58FromGitter<alehander92> can't really find it uh
09:06:37FromGitter<alehander92> ah this topic https://forum.nim-lang.org/t/5458
09:06:59FromGitter<alehander92> i just saw people recommending zero-functional and wanted to point out that it just doesnt solve this fully
09:08:16FromGitter<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:23FromGitter<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:07FromGitter<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:09AraqI 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:10AraqI 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:42FromGitter<alehander92> well, you can say that for almost any abstraction honestly
09:17:10Araqno, I'm talking about the general desire to nuke 'for' + 'if'
09:17:32AraqI don't mind them, they are simpler, more powerful and more predictable.
09:17:41FromGitter<alehander92> but chaining iterators does not mean you nuke for + if
09:17:46FromGitter<alehander92> it means you get more powerful for + if
09:18:58FromGitter<alehander92> because you can loop over exactly the shape/result you want e.g. map + zip or map + filter
09:19:28FromGitter<alehander92> and of course, sometimes for + if is simpler, sometimes the other option might seem simpler
09:21:28FromGitter<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:13FromGitter<alehander92> so the cat is out of the bag, might as well make this more efficiently composable and extensible a bit
09:23:54Araqyeah 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:41PMunchHmm, can you turn hints off in the config.nims file?
09:24:48Araqwhat 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:22FromGitter<alehander92> i am not saying to do it now, just to not dismiss it completely as a possible feature
09:28:14FromGitter<alehander92> maybe it would be easier to make a different better 3rd party solution in a while
09:29:01Araqspeaking of which, can I steal your for loop expressions? is it ready for the stdlib?
09:31:05FromGitter<alehander92> as i said before , i stole them of some of your test examples iirc
09:32:31PMunchYay, SolitudeSF made a better version of the config for nimlsp. So now "nimble install nimlsp" should work :)
09:36:01FromGitter<alehander92> and this version of b3liever https://github.com/alehander92/comprehension/pull/1/files
09:36:21*ng0 joined #nim
09:36:39FromGitter<alehander92> has a bit more clear/robust impl
09:36:44FromGitter<alehander92> but it offers a different api
09:37:08FromGitter<alehander92> so you should decide on which api looks better for `sugar`
09:37:56FromGitter<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:22PMunchLooking at nimterlingua, how does that actually work?
09:40:40PMunchLike how does it do replacement on unmodified code?
09:48:29Araqalehander42: sorry, but what are the differences?
09:49:48Araqnever mind
09:50:11*endragor joined #nim
09:51:46Araqyeah I want the 'collect' thing. turns statements into expressions that support indentation
09:52:52Araqinstead of Python's weird "let's squash it into one line and hope for the best"
09:54:52Mister_Magister!eval echo "hello"
09:54:56NimBothello
09:56:00endragor> Error: interpretation requires too many iterations
09:56:03endragor> MaxLoopIterations* = 10_000_000
09:56:16endragorlove those magic constants in the compiler :)
09:57:17Araqendragor: what else to do? the halting problem is a nasty one
09:59:45PMunchJust leave it looping?
10:00:03PMunchThe user could abort it if they suspected an infinite loop
10:00:06endragorAraq: 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:22endragorYeah, I agree with PMunch
10:00:44Araqat least nimsuggest definitely needs this protection
10:01:08*NimBot joined #nim
10:01:52Araqendragor: what are you doing that requires 10 million iterations though?
10:02:04Mister_Magister!eval while 1: echo "hello"
10:02:06NimBotCompile failed: /usercode/in.nim(1, 7) Error: type mismatch: got <int literal(1)> but expected 'bool'
10:02:15Mister_Magister!eval while true: echo "hello"
10:02:31Mister_Magisteryay killed it
10:02:39NimBotCompile failed: <no output>
10:02:44Mister_Magisterxd
10:02:45endragorAraq: using https://github.com/PMunch/protobuf-nim, which parses protobuf specs in compile time
10:03:19Araqmaybe we can make this limit for every single loop but not for nested loops combined
10:05:54PMunch!eval echo "I'm not dead yet!"
10:05:58NimBotI'm not dead yet!
10:06:15endragorIf 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:56PMunchTBH I should switch out the parser in protobuf-nim
10:07:09PMunchThat's what causes the deep recursion
10:07:17endragorPMunch: I'm still not settled on whether I'll use the library :) But worst case I'll probably just heavily modify it
10:07:25PMunchZevv, you up for another parsing challenge?
10:08:14PMunchWhat are you using this for endragor?
10:09:07endragorPMunch: er.. for protobuf-based communications? :)
10:10:32ZevvPMunch: pretty busy with $stuff these days, but do tell
10:11:10PMunchendragor, haha well that I could guess
10:11:25PMunchZevv, I'm looking to replace the parser in protobuf-nim
10:11:49PMunchSo I need something to parse protobuf syntax, preferably into the same format it uses today
10:12:19Zevvthat should be fairly trivial
10:12:59Zevvhttps://developers.google.com/protocol-buffers/docs/proto is that the right one?
10:13:34endragorZevv: https://developers.google.com/protocol-buffers/docs/proto3
10:13:40Zevvthanks
10:14:08PMunchYeah, the version 3 one
10:14:23PMunchThis is how the parsing is done today: https://github.com/PMunch/protobuf-nim/blob/master/src/protobuf/private/parse.nim
10:14:38PMunchAnd this is the type it parses it into: https://github.com/PMunch/protobuf-nim/blob/master/src/protobuf/private/decldef.nim
10:14:44Zevvthat's not too bad, is it?
10:15:13PMunchNo it shouldn't be too difficult
10:16:12Zevvbut why replace the current impleemntation then?
10:19:47Araqthis ... is not how to parse stuff :P
10:20:10endragorYeah it takes > 10 mil iterations for a fairly trivial protocol spec.
10:21:13PMunchYeah.. It's not great
10:21:40PMunchI mean it works, but that's about the nicest thing I can say about it :P
10:23:15Zevvfair enough :)
10:26:20FromGitter<mratsim> seems like you need more monads
10:27:38Araqto be fair though, we don't know if a different parser would avoid the VM limit
10:34:15FromGitter<alehander92> Araq but then how do you hint you need a set/table/other collection
10:34:20FromGitter<alehander92> as a result of the comprehension
10:38:57FromGitter<alehander92> we can just have collectSet / collectTable or collect[set]: / collect(set):
10:39:36*uu91 quit (Ping timeout: 240 seconds)
10:39:40FromGitter<alehander92> ah sorry nvm, i realized here its done with the shape of `it` as well
10:39:53FromGitter<alehander92> however ..
10:39:58FromGitter<alehander92> we can do it generically ..
10:40:25FromGitter<alehander92> we can just have `it` be either `v` or `{k: v}` / in the block of code
10:40:54FromGitter<alehander92> and accept any typeclass in `collect[typ]:` with seq as default
10:41:27FromGitter<alehander92> and just require `init` + inc/adder implementations for the type
10:41:43FromGitter<alehander92> so we have those by default for seq/set/table
10:41:46Araqmaybe.
10:41:53FromGitter<alehander92> and if somebody wants to support his own seq or class
10:42:05FromGitter<alehander92> he just overloads 1-2 primitives for it and its ready
10:43:02FromGitter<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:47FromDiscord<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:27FromGitter<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:45FromGitter<alehander92> @mratsim ?
11:46:45FromGitter<alehander92> (i mean, which of the things we discussed in particula)
11:48:52FromGitter<alehander92> ah, they do have their `collect` indeed
11:49:47FromGitter<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:39FromGitter<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:43FromGitter<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:17FromDiscord<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:39Araqkodkuce: async works well, we're working on making threading easier
12:04:15*narimiran joined #nim
12:04:47FromDiscord<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:10FromDiscord<kodkuce> like is say mostly i see like Matrix magic letters falling down this chat 🙂
12:08:08PMunchAraq, well most parsers aren't as recursive as that
12:15:19FromGitter<alehander92> kodkuce sorry, threaded conversations would be cool for that indeed
12:15:37FromGitter<alehander92> what do you want to do ? a web app ?
12:16:50FromDiscord<kodkuce> me, wanted to try to finish a multyplayer server for dumb games, like poker pool ectera
12:17:43FromGitter<alehander92> make it for smart games, as chess and go :P
12:18:50FromGitter<alehander92> using async/await in general wouldn't change soon
12:19:17FromGitter<alehander92> if you need more special stuff like awaiting other threads, then you need a workaround
12:27:53*dddddd joined #nim
12:28:23narimirananybody here having 32-bit OS and some free time to help me debug something?
12:29:57narimiranthere'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:51FromGitter<mratsim> setting up a VM is probably faster ;)
12:37:10FromGitter<mratsim> I have a raspberr Pi with 32-bit raspbian but no time :/
12:38:01FromGitter<alehander92> you should be able to run 32bit programs
12:38:12FromGitter<alehander92> in some cases
12:39:47narimiran@alehander92 i just need to test what some `shr`'s and bit `and`'s produce on 32-bit OS
12:40:47narimiran@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:58FromGitter<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:12FromGitter<alehander92> you can do it online i think
12:46:30FromDiscord<mratsim> only if we had godbolt :p
12:47:33FromGitter<alehander92> yea i actually tried it
12:47:44FromGitter<alehander92> but i cant seem to find a 32bit gcc?
12:47:50FromGitter<alehander92> otherwise it doesnt matter
12:47:54FromGitter<alehander92> you can --cpu:i386
12:48:04FromGitter<alehander92> and just try the related c code
12:48:10FromGitter<alehander92> but maybe it depends on a lot of nimbase
12:48:41narimiran@alehander92 @kaushalmodi already suggested me `c --cpu:i386 --passC:-m32 --passL:-m32` the other day, but that does not reproduce the bug :/
12:50:14solitudesfnarimiran, whats the snippet you need to test?
12:51:11narimiransolitudesf: this is what fails: http://ix.io/21an — if you can reproduce the fail, i'll create some more specific test case
12:51:12disbot^ play at https://play.nim-lang.org/#ix=21an 😏
12:52:21narimirangah, i changed the example while playing, wait a bit
12:53:03ZevvPMunch: it's not particulary pretty: http://ix.io/21ao
12:53:04disbot^ play at https://play.nim-lang.org/#ix=21ao 😏
12:53:09*endragor quit (Remote host closed the connection)
12:53:30narimiranthis is the example as seen in 1.0.x branch: http://ix.io/21ap
12:53:31disbot^ play at https://play.nim-lang.org/#ix=21ap 😏
12:53:43FromGitter<alehander92> zevv, npeg looks fantastic
12:54:13FromGitter<alehander92> btw i think .. nim should recognize a literal is in given range
12:54:14FromGitter<alehander92> somehow
12:54:27*clyybber joined #nim
12:54:44FromGitter<alehander92> is it too hard for the sem checker to match those cases
12:55:00solitudesfnarimiran, runs fine on my pi
12:55:29narimiransolitudesf: is that nim devel (1.1.1) or nim stable (1.0.x)?
12:55:33solitudesfah
12:55:39solitudesfyes, let me switch to stable
12:59:38clyybberAraq: 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:45clyybberWhere should I do that?
13:02:29solitudesfnarimiran, runs fine with 1.0.0 and 1.0.2
13:02:45narimiransolitudesf: huh, that's strange
13:03:09narimiranit continuously fails on 32-bit travis and azure pipelines
13:05:09narimirani can get rid of the symptom (failing runnable examples), but i was intrigued by the cause.
13:05:33narimiranbut if it isn't reproducible even on 32-bit, then i have no idea what might be causing this
13:07:09FromGitter<zacharycarter> do you still have to initialize tables?
13:07:13narimiranno
13:07:22FromGitter<zacharycarter> that's what I thought - okay thanks
13:14:23PMunchendragor, can you check if Zevvs parser works on your file?
13:14:44Zevvendragor: or please send me your file
13:22:24*tklohna quit (Ping timeout: 265 seconds)
13:28:26PMunchAraq, is there a way to check the recursion depth?
13:28:34PMunchI mean since it's tracked anyways
13:31:59FromDiscord<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:01FromDiscord<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:21FromDiscord<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:25PMunchEchos inside macros should work fine
13:32:43PMunchAnd by the way, please don't edit your message on Discord, it sends a completely new copy to IRC :P
13:33:59FromDiscord<Aidiakapi> Ah, I see, regardless, it's not actually showing up. The macro runs, but the echo isn't shown
13:34:48PMunchDo you have an example?
13:35:49*hoijui joined #nim
13:35:59FromDiscord<Aidiakapi> `macro foo(data: untyped): untyped = echo "hello"; assert(5 == 6)`
13:36:07PMunchhttps://play.nim-lang.org/#ix=21aB
13:36:29PMunchTry that, if you switch to "Showing: debug" you will see the echo from the macro
13:37:50FromDiscord<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:27PMunchOh right, yeah Nimble takes all the output from compilation.
13:39:36FromDiscord<Aidiakapi> That's mildly annoying, but alright, thanks :)
13:39:50solitudesf--debug flag in nimble shows compiler output
13:40:15PMunchHmm, it would be cool if there was some way you could tell nimble that something should be output
13:41:34FromDiscord<Aidiakapi> Thanks! `--debug` did it
13:44:27*GordonBGood quit (Ping timeout: 240 seconds)
13:49:12FromGitter<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:09AraqVindaar: instruction cache problems?
13:50:50disrupteknot really surprising.
13:50:54Araqclyybber: 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:08FromGitter<Vindaar> @Araq no clue. I barely know what instruction cache problems are. I guess I have some reading to do... :)
14:01:28clyybberAraq: 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:15clyybberVindaar: Compare the asm?
14:02:58shashlickAnyone uses znc here?
14:03:53shashlickWhere do you host if you do
14:05:03Araqclyybber: huh? new/reset/default?
14:05:10FromGitter<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:13clyybberAraq: Well if someone does new(someVar) , someVar should have its default fields set up
14:06:25kungtotte n0---
14:06:26clyybberSimilarily for reset(someObj)
14:06:31FromGitter<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:04Mister_Magister!eval echo true == "what"
14:10:06NimBotCompile failed: /usercode/in.nim(1, 11) Error: type mismatch: got <bool, string>
14:10:11Mister_Magisterhm
14:10:27Mister_Magisteraccording to php result is true :P
14:10:35Mister_Magisterhard typed languages ftw
14:10:38Mister_Magisternim ftw
14:10:39narimiranMister_Magister: last time i checked, nim was not php
14:10:52Mister_Magisternarimiran: just was wondering what nim will do
14:11:04narimiranjust like you cannot do `while 1`, `if mySeq`, etc.
14:11:14FromDiscord<Rika> nim does not have truthiness
14:11:16Mister_Magistermhm
14:11:22PMunchHmm, 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:26FromGitter<jason_koch_twitter> @Vindaar are you able to share a code snippet / repro?
14:20:15PMunchWhat 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:28FromGitter<Vindaar> @jason_koch_twitter sure, give me a few minutes
14:27:08disruptekPMunch: 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:17FromGitter<Vindaar> @jason_koch_twitter here you go: https://github.com/Vindaar/ggplotnim/tree/weirdFastSlow/bookPlots
14:31:41FromGitter<Vindaar> oh, that `bookPlots` at the end wasn't supposed to be there, he
14:34:23FromGitter<kaushalmodi> @iffy I use `--cpu:i386 --passC:-m32 --passL:-m32` to build 32-bit .so's from Nim on RHEL 6.8
14:34:37FromGitter<kaushalmodi> https://scripter.co/notes/nim/#compiling-in-32-bit-mode
14:35:17FromGitter<kaushalmodi> In Nim code, I have this check to know what mode compilation happened: `when sizeof(int)==8: # 64-bit compilation`
14:35:33FromGitter<iffy> Thanks @kaushalmodi I tried that and was getting `cannot find -lmsvcrt` and other errors like that
14:35:55FromGitter<iffy> I seem to be having success with `--cc:vcc` though it's much slower than mingw
14:36:04FromGitter<kaushalmodi> I use gcc
14:36:14FromGitter<kaushalmodi> Not much familiar with compiling Linux on Windows
14:36:51FromGitter<kaushalmodi> @iffy May be this deserves a bug report?
14:37:45FromGitter<jason_koch_twitter> > oh, that bookPlots at the end wasn't supposed to be there, he ⏎ ⏎ @Vindaar was that your issue?
14:38:29narimiran@vindaar this is the file, right? https://www.youtube.com/watch?v=E-ZbrtoSuzw
14:38:32narimiranoops
14:38:37narimiranhttps://github.com/Vindaar/ggplotnim/blob/55b5bc7e771caeee88f1fcef93cb72f63ed5d40d/bookPlots/weirdFastSlow.nim
14:39:10FromGitter<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:28FromGitter<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:38FromGitter<Vindaar> yes @narimiran
14:40:50FromGitter<kaushalmodi> @iffy You probably need a "dual target" mingw? https://stackoverflow.com/a/19346426/1219634
14:42:32FromGitter<iffy> I'm using the 64-bit mingw from https://nim-lang.org/install_windows.html
14:42:41FromGitter<iffy> So, maybe I need the 32-bit one, too
14:42:50FromGitter<iffy> (or a dual target one)
14:43:00FromGitter<kaushalmodi> sounds like it
14:43:37FromGitter<kaushalmodi> you seem to have only 64-bit versions of those libs like *msvcrt*
14:44:02narimiran@vindaar ok, i can reproduce it on my machine too
14:46:24FromGitter<Vindaar> yay! thanks for testing
14:47:00narimiranit is about 15% slower
14:47:53FromGitter<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:39FromGitter<jason_koch_twitter> i'm still trying to reinstall nim, lol, switched over OSs recently
14:49:04narimirani 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:25FromGitter<Vindaar> ah yes, maybe
14:50:25*solitudesf joined #nim
14:52:55clyybberSoo, 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:28Araqhmmm ok
14:56:53*disbot quit (Remote host closed the connection)
15:00:37*disbot joined #nim
15:01:14FromGitter<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:54FromGitter<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:54FromGitter... free something it doesn’t own.
15:02:29Araqthat's not what Boehm nor Nim do
15:02:42Araqbut both trace the stack conservatively
15:03:14FromGitter<kaushalmodi> "calling the DPI" above means the call to the Nim compiled proc that I call from the SV side
15:03:37FromDiscord<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:00PMunchdisruptek, but then I'd need to pass the body into the template
15:05:07Araqkaushalmodi: can you do GC_disable/GC_enable in your callback and schedule the GC at some better time
15:05:19PMunchEssentially adding an indent level for every call to this function
15:05:38AraqWilliamDraco: I'm not sure, stdlib warnings should be surpressed
15:05:44PMunchI guess that is the clean solution though..
15:06:03*hoijui quit (Ping timeout: 250 seconds)
15:06:07disruptekPMunch: but you need to indent anyway to put the variable in a scope where defer will free it, right?
15:06:30FromGitter<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:44Araqyes
15:06:53FromGitter<kaushalmodi> wouldn't above be similar to running with --gc:none?
15:06:59PMunchdisruptek, not really. I have let x = createThePointer(); defer: c_free x
15:06:59Araqbut then the GC must run at some time
15:08:53FromGitter<kaushalmodi> GC_disable/GC_enable did the trick
15:09:03FromGitter<kaushalmodi> though.. I did not get how to do the scheduling?
15:09:48FromGitter<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:07disruptekPMunch: i get it. we should probably come up with a macro to do this.
15:10:38*hoijui joined #nim
15:10:56Araqkaushalmodi: 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:27FromGitter<kaushalmodi> each time a Nim exportc'd proc is called, it's called via the DPI-C interface in SV
15:11:41FromGitter<kaushalmodi> so the SV simulator does that stack switching thing each time
15:12:06Araqthis is not a "C interface", c doesn't allow stack switching
15:12:33FromGitter<kaushalmodi> that means --gc:none is the best bet for now?
15:12:39Araqthey 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:53FromGitter<kaushalmodi> and then I can try out --gc:destructors
15:12:56FromGitter<kaushalmodi> yes
15:12:59*hoijui quit (Client Quit)
15:13:53FromGitter<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:12FromGitter<kaushalmodi> I can ignore those warnings I believe, but I do not know how serious those warnings are
15:17:51disruptekthis is fine.
15:18:14clyybber*house starts burning*
15:18:37narimiranclyybber: i'll sleep fine tonight
15:18:48clyybbernice
15:19:22FromDiscord<Aidiakapi> How do you pass a slice as a function parameter, I can't seem to find it for some reason?
15:21:20FromGitter<Vindaar> @Adiakapi: https://nim-lang.github.io/Nim/system.html#HSlice see also the procs which take a HSlice for reference
15:21:38narimiranor maybe what you want is `toOpenArray`
15:21:57FromGitter<Vindaar> yeah, good point
15:22:07clyybberAraq: 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:09FromDiscord<Aidiakapi> I've actually used `Slice[char]`, but slicing a `string` just gives me a new `string` instead of a slice... 🤔
15:25:06Araqclyybber: I know you spent lots of effort on this already but I'm beginning to dislike this feature.
15:25:23Araq1. it looks vastly more complex to implement than thought.
15:25:49Araq2. it bites somewhat with our goals of enforcing explicit inits for 'not nil' refs.
15:26:54Araq3. 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:03clyybberAraq: It's actually pretty easy to implement, but it bites itself a bit with the design of the compiler currently.
15:31:05clyybber2: 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:18clyybberOr at least thats what makes the most sense to do IMO.
15:31:35*narimiran_ is now known as narimiran
15:34:04clyybberthe feature is also really useful. It should make range fields, embedded objects and the like much less cumbersome to use.
15:34:26clyybberI think it really fits into nim.
15:35:42disruptekyou should add some tests to your pr.
15:36:03clyybberYeah
15:37:29FromDiscord<mratsim> Maybe we need to redesign the compiler 😛
15:37:45Araqbe my guest
15:38:22Araqin the long run few compilers survived but plenty of programming languages did.
15:38:58Araqit's why we also work on a good spec.
15:40:12FromGitter<mratsim> for now I'll just design a multithreading library
15:40:21disruptekmy first nimph distribution has a >10x compression ratio. my 2nd includes npeg and is only 2.5:1. thanks, zevv.
15:40:27FromGitter<mratsim> then I'll design a compiler for linear algebra / machine learning
15:40:49FromGitter<mratsim> implemented in macros first, then with a LLVM Jit
15:41:01FromGitter<mratsim> and if I still have a few years left I'll see about Nim compiler
15:41:12Zevvdisruptek: your welcome.
15:41:28ZevvThere's a whole punch of PDF papers in the repo, that adds up
15:41:39FromGitter<mratsim> oh and I need to maintain arraymancer as well. yep Nope sorry, no redesign of Nim compiler for me
15:41:40Zevvyou're
15:41:45Araqhowever, open source changes the game, apparently. CPython is still around as is Clang and GCC and FPC ...
15:41:50FromGitter<mratsim> I'll just ping you to ask you for new features
15:41:53disruptekmaybe distributions should be use-only with no git history.
15:42:09*Vladar quit (Quit: Leaving)
15:42:23FromGitter<mratsim> the git hash of included package/compiler/nimble should still be available though
15:42:42Araqthough GCC seems to lose against Clang. I read Google only supports clang extensions now
15:42:44FromDiscord<Chiqqum_Ngbata> Should be able to set the git depth
15:42:56disruptekyeah, this is dumb. disk space costs nothing.
15:43:09disruptekthe depth is set to 1 and these are bare repositories to boot.
15:43:21clyybbermratsim: 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:24FromDiscord<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:43AraqI think the compiler is ok, parts are terrible, parts are really good
15:45:52clyybberAraq: The only problem is findUsefulCaseContext for my PR
15:46:36AraqI have a "better design" in my head that is unproven but eventually it'll leave my head
15:46:44disruptekthank dog.
15:46:57disruptekdrinking helps.
15:47:42clyybberAraq: WDYT of getting rid of findUsefulCaseContext and refining types inside of case branches generally?
15:48:38FromDiscord<treeform> Araq, how's fight with the new GC going?
15:48:53FromDiscord<treeform> Any news from the front?
15:49:04Araqtreeform: https://github.com/nim-lang/Nim/pull/12626
15:49:25Araqit's coming around, I'm beginning to understand the problems
15:49:52FromDiscord<treeform> Are there any docs on how to use it?
15:50:10FromDiscord<treeform> I tried to figure it out but got confused fast
15:50:31Araqhttps://github.com/nim-lang/RFCs/issues/177 docs are here
15:50:58Araqcompile via --gc:destructors, don't have cycles.
15:52:03Araqstill in alpha state. I'm trying to convince clyybber to work on it instead of on default values :P
15:52:27clyybberLike `int i; case i of 1..10: #Now the compiler could generally treat i like it has the type range[1..10]`
15:54:57Araqclyybber: I understand but you can getType() i's type so everything you do affects the bloody macro system
15:55:43clyybberUgh, 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:50FromDiscord<treeform> Araq, I have not seen that rfc, thanks!
16:06:39*theelous3 joined #nim
16:10:47*rayman22201 joined #nim
16:20:53clyybberayy, rayman22201
16:23:07Zevvwhat/whose is disbot?
16:23:47clyybberdisrupteks
16:26:02rayman22201Good morning 😝
16:26:25rayman22201Not quite online yet. Cooking breakfast. I will be on in about an hour
16:27:36clyybberhaha, breakfast. Its getting dark here
16:27:41clyybberand 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:53rayman22201You could always come visit 😉 we have a lovely climate in the south western US.
16:39:18shashlick@disruptek - how easy is it to use the disbot to monitor private messages and post on a channel when one is received?
16:39:43disruptekit's easy, but why would you want to do that?
16:40:08disruptekoh, you want it to mirror to #shashlick?
16:40:16shashlickyep
16:40:31shashlickright now i use matterbridge to irc <=> slack but it doesn't do pms
16:41:49FromDiscord<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:56shashlickso 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:43disruptekthat 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:27disruptekor do you not have a way to bridge to matterbridge yourself?
16:43:32shashlickmatterbridge needs an irc server
16:43:46shashlickmatterbridge doesn't support pm bridging
16:43:56shashlickbut for everything else, it is great
16:44:07shashlicki don't need to see any FromGitter nonsense anymore
16:44:38shashlickso freenode <-> znc <-> matterbridge <-> slack
16:44:59shashlickand freenode <-> znc <-> tool
16:45:14shashlickwhere tool will post back from pm to a channel which matterbridge can then bridge over
16:45:16shashlicknotification
16:45:39shashlickright now the option is freenode <-> znc <-> weechat <-> trigger <-> script to post to slack
16:46:24disruptekthis seems pretty ridiculous to me.
16:48:27disruptekis the problem that the api doesn't support pm bridge or is the problem that your impl doesn't support it?
16:49:10clyybberthe art of overengineering
16:51:02shashlickThat's life
16:51:18narimirantoo much of those <->'s
16:51:25shashlickTell me about it
16:52:15shashlickI added znc last night
16:52:35shashlickAnd can use a separate account for it and call it done
16:52:43shashlickBut I'll have no notifications
16:54:04shashlickHow do you get notifications on your phone for irc
16:54:21shashlickWithout running a client all the time
16:54:43disruptekwhy would i want that?
16:54:51FromGitter<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:27disruptekturn it off/on around the call.
16:59:57Zevv@endragor @pmunch here?
17:02:29shashlickI'm on here all the time so I want to be pm'able also
17:02:51shashlickOnly way to do that is to have znc
17:03:16shashlickI'm just asking if it a small lift to get notified of pm's
17:03:56disruptekcan 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:33FromGitter<mratsim> @Araq I think you missed a RFC: your plans to use Z3 to remove bound checks
17:43:31shashlickWhat does shashlick map to? Pm's won't be a channel would it?
17:43:35disruptekhow about an rfc describing how you want user-supplied source code filters to exist?
17:44:03disruptekshashlick: "shashlick" is a channel holding your pms. "#shashlick" is a public channel named "shashlick".
17:44:58*Vladar joined #nim
17:45:00disruptekie. 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:44shashlickOk I'll try with matterbridge
18:06:43rayman22201@clyybber you still here? I'm finally on
18:10:47FromGitter<kaushalmodi> Araq
18:11:33FromGitter<kaushalmodi> I just asked Cadence if they can spare a license to help you debug the Nim/SV interface, and they can!
18:11:48FromGitter<kaushalmodi> Though, would you have time/will to try it out?
18:11:59FromGitter<kaushalmodi> If so, let me think how to make this work.
18:13:15*GordonBGood joined #nim
18:13:59clyybberrayman22201: Yeah I'm here
18:14:08lqdev[m]can {.compileTime.} variables be used at runtime?
18:15:06clyybberyes, but I wouldn't rely on it
18:15:13clyybberIt should be changed IMO
18:15:35clyybberlqdev[m]: Its better to use a const as a "bridge" between compile and runtime
18:15:52rayman22201so, where should we start?
18:16:08clyybberrayman22201: Diffing the C code
18:16:18lqdev[m]I need var because I have a table into which I insert dynamically in a macro
18:16:40rayman22201ok. 👍
18:16:46lqdev[m]guess I'll just generate some small glue to bridge the data from the compileTime table into runtime table.
18:16:58clyybberlqdev[m]: Yeah, and when you are finished modifying the table, asssign it to a const
18:17:31clyybberAh, there might be some hickups with compiletime -> runtime for tables
18:17:38clyybberI'm not sure that will work
18:17:43lqdev[m]clyybber: I can't exactly tell when I'm finished working with the table
18:17:58clyybberoh
18:18:14*GordonBGood quit (Ping timeout: 276 seconds)
18:18:19clyybberwell, 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:51rayman22201it's a noisy diff clyybber :/
18:23:06*fanta1 quit (Quit: fanta1)
18:23:17clyybberrayman22201: Oh, why?
18:23:19rayman22201http://ix.io/21cu
18:23:21disbot^ play at https://play.nim-lang.org/#ix=21cu 😏
18:23:23rayman22201good question
18:23:52clyybberrayman22201: Because diff is shite
18:23:57rayman22201hahahaha
18:24:05clyybberJust cd into the cache dir
18:24:08clyybberand do git init
18:24:34rayman22201use git diff instead of unix diff?
18:24:39clyybberyeah :p
18:27:09rayman22201http://ix.io/21cw
18:27:10disbot^ play at https://play.nim-lang.org/#ix=21cw 😏
18:27:53rayman22201fun fact. you can use `git diff --no-index <fileA> <fileB>` to compare two arbitrary files
18:28:21clyybbernice
18:29:06clyybberwell
18:29:10clyybberthats still pretty big
18:29:16rayman22201indeed
18:29:52clyybbermaybe use a diff viewer to see the parts that actually matter
18:31:07clyybberThis already is much better: http://ix.io/21cw/diff
18:31:27clyybberbut it doesn't highlight on a char level
18:32:21rayman22201some of the changes are just noise from the hash generation
18:32:36clyybberyeah, we should get rid of that
18:33:44rayman22201I remember arguing about the hashing when I was doing the godbolt project, but I already forgot everything about it :-P
18:35:31rayman22201line 205 - 213 seems interesting
18:35:46disruptekif you can use kitty, kitty's side-by-side diff is decent.
18:36:50rayman22201but I'm lazy! I don't want to install more tools :P
18:36:54*hoijui quit (Ping timeout: 246 seconds)
18:37:17disruptekyou are a win/vsc user, right?
18:37:46clyybberrayman22201: One small sin I did, was use an online diffing tool while working on newruntime :p
18:38:19rayman22201I have windows, but I use an Ubuntu VM most of the time actually :-P
18:38:33clyybberit 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:40disruptekso what do you edit in?
18:38:45rayman22201vim
18:38:56rayman22201vim4life baby ;)
18:39:15rayman22201I will say, I use neo-vim. I'm somewhat modern
18:39:17*adeohluwa joined #nim
18:39:33rayman22201what's a good online diff tool?
18:39:48clyybberdiffchecker used to be good
18:39:52clyybberbut its total bullcrap now
18:39:58clyybberthey redesigned the website
18:40:24disruptekit doesn't matter; he doesn't want to install more tools.
18:40:49rayman22201:-P
18:41:08disruptekif you have vim installed, you might have vimdiff.
18:41:38clyybberrayman22201: I have a ~great~ idea
18:41:55clyybberwe use sed to delete lines where only the hash or indentation changed
18:41:57rayman22201kitty is a whole damn terminal emulator disruptek :-P
18:42:11rayman22201I can use VS code. give me a sec
18:42:36disruptekif you don't care about whitespace, just turn whitespace off in the diff.
18:42:53disrupteki think it's -w in git diff.
18:44:03clyybberah right
18:45:01rayman22201that didn't make much a difference
18:45:18rayman22201good idea in theory though
18:46:14Zevvtoo bad pmunch: Error: VM problem: too many registers required
18:46:16rayman22201how do I diff in vscode?
18:46:52rayman22201got it
18:46:57Zevv'meld' is a nice diff: https://meldmerge.org/
18:47:05Zevvgive it a try
18:48:15rayman22201I'm using the VSCode tool now. it's pretty fancy actually
18:48:26rayman22201If that doesn't work I will try meld though.
18:48:27rayman22201thanks
18:48:54*narimiran quit (Quit: Leaving)
18:49:15*narimiran joined #nim
18:49:45Zevvyeah last time i recommend you something duuuude
18:49:49Zevvpffff
18:49:55Zevv:)
18:50:03clyybber*pffffffs out the window*
18:50:26Zevvyou also got 7 inches of snow yet?
18:50:31rayman22201hahaha. Spoken like the true resident Dutch German :-P
18:51:30clyybberZevv: No snow :(
18:51:48clyybberWe never get anything nice. We get boring
18:51:58clyybberNeither particularily cold or hot or whatever
18:52:16clyybberbut at times we get very dense fog, which is cool
18:53:07ZevvI love that, but's not often here
18:55:28clyybberI just hate how it gets dark at 6pm
18:55:47clyybberbut thats just because of wintertime
18:56:17Zevvfor some here it doesn't get darky in winter
18:56:18Zevvanymore
18:56:24Zevvit just stays like that all of the time
18:56:37clyybberwait you are in the netherlands right?
18:56:45Zevv'here' I mean at #nim :)
18:57:10clyybberi was like wtf we must be living on different earths
18:57:13clyybberlol
18:57:51ZevvI'm perfectly fine here. If I lived above the arctic circle I'd be a alcoholic
18:57:54Zevvonly way to cope with that
18:58:00rayman22201Zevv lives on the moon :-P
18:58:20rayman22201or maybe Mars. He is definitely a Martian
18:59:13clyybberthe vodka warms your throat
18:59:46clyybberin the same way as stabbing your throat with a stick warms your throat
19:00:12FromGitter<mratsim> you can recover from Vodka though
19:00:19rayman22201so, 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:37narimiran@mratsim not if you drink the right amounts :P
19:01:12rayman22201you have to be really desperate to drink a potatoe :-P
19:01:59rayman22201brb
19:02:27clyybberbirb
19:02:37FromGitter<mratsim> btw how much time do you need for your test scrpt for shifts?
19:02:44rayman22201here 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:45narimiran@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:16FromGitter<mratsim> yes I was
19:05:45FromGitter<mratsim> OK sounds good, please give me consistent shifts and bit operation,, that's all
19:05:53FromGitter<mratsim> oh and working modulos
19:05:57narimiran:D
19:06:10narimiranjust don't use 32-bit OS on 1.0.x and you'll be fine :P :D
19:06:20narimiranor maybe you can use even that
19:06:28narimiranbut don't use 32-bit travis :P
19:06:36FromGitter<mratsim> well I had a presentation with a Raspbery Pi a month ago, live demo
19:06:41clyybberrayman22201: Compiling without -g/--debugger:native will yield more readable results
19:06:57FromGitter<mratsim> we use Azure Pipelines (previously appveyor) to test on Win32
19:06:58clyybberthose #line directives are kinda annoying
19:07:10FromGitter<mratsim> yeah, the #line are super noisy
19:08:24narimiran@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:53narimiranthis is an example from colors.nim runnableExample
19:09:25narimiranthis (255, 0, 255) is not that, but (0, 0, 0) and i have no idea why
19:10:17clyybberrayman22201: This https://www.jstoolset.com/diff isnt too bad
19:13:10FromGitter<mratsim> I've created this issue @narimiran, https://github.com/status-im/nim-stint/issues/99
19:13:32narimirani've got the notification, i'll write more details there
19:30:16*nsf joined #nim
19:38:12rayman22201I'm back.
19:38:21*hoijui joined #nim
19:38:24rayman22201good idea. I will recompile with less noisy flags
19:38:35rayman22201and make more coffee :-P
19:40:23*hoijui quit (Client Quit)
19:40:52*adeohluwa quit (Remote host closed the connection)
19:46:03rayman22201other weird noise, like the "exception" struct getting declared on a different line. annoying
19:49:31rayman22201still 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:41narimiranbtw, @mratsim, have you seen https://swift.org/blog/numerics/ ?
20:00:24*lritter joined #nim
20:07:40FromDiscord<krab4t> how you do ` bitwise NOT ` or ` bitwise OR ` in nim? im lost
20:08:17FromDiscord<krab4t> ~ and |
20:08:42narimiranby using `not` and `or` :)
20:08:51FromDiscord<krab4t> WTF
20:11:10narimiranhttps://play.nim-lang.org/#ix=21d9
20:26:55FromDiscord<demotomohiro> bit operators are defined in system module.
20:30:11FromDiscord<IanIAnIAN> stb_image is going to make me explode
20:37:21Calinouit'll explode into nothings
20:37:22*Calinou hides
20:38:05rayman22201clyybber: https://www.jstoolset.com/diff/053a38ab6f775ce0
20:38:23rayman22201I moved around some of the definitions by hand to reduce some of the noise
20:39:17rayman22201some interesting observations. The no leak version has `genericReset` and the leaking version does not.
20:40:54rayman22201the 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:09lqdev[m]how much slower is -d:release with --stacktrace:on compared to just -d:release?
20:41:17lqdev[m]is it a substantial difference?
20:42:39FromDiscord<IanIAnIAN> can anyone recommend a substitute for stb_image , it just won't play nicely on my windows
20:42:47clyybberrayman22201: Hmm, interesting
20:43:45rayman22201another 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:07rayman22201Idk if that matters
20:44:34ZevvError: internal error: (filename: "vmgen.nim", line: 179, column: 16)
20:44:38Zevvbwah
20:44:48rayman22201another big difference is the closure on line 499
20:45:23Calinou@IanIAnIAN what image formats do you need to support?
20:45:54rayman22201the `=` / leaking version generates this "safepoint" code, that the `assign` / leaking version does not
20:46:11rayman22201that is the biggest actual "algorithm" difference I see
20:48:24FromDiscord<IanIAnIAN> I want only png really
20:49:03lqdev[m]@IanIAnIAN try nimPNG
20:51:57rayman22201@Zevv you need my branch to follow along at home :-) https://github.com/rayman22201/Nim/tree/async-with-dispose
20:54:00Zevvoooh
20:54:19Zevvdude you were only going to fix flowvars, remember
20:54:34Zevvyou will be assimilated
20:54:47Zevvresistance is futile
20:54:50rayman22201hahaha. Yup. I'm in too deep now
20:59:01FromGitter<alehander92> how to
20:59:28FromGitter<alehander92> hm
21:00:17rayman22201`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:27rayman22201So I don't think genericReset is the culprit here
21:00:54FromGitter<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:59rayman22201looks fascinating, will read when I'm not so in the weeds with my own code issues :-P
21:04:26disruptekfun, thanks.
21:04:49*Vladar quit (Quit: Leaving)
21:10:14*joachimschmidt55 joined #nim
21:11:23rayman22201the safepoint stuff involves getting a reference to the current frame. but that doesn't seem relevant.
21:12:11ZevvVindaar: nice read, I had similar adventures the other day, nice to see you in the same tar pit :)
21:12:17Zevvadd a "conclusion" section to the end though :)
21:13:37ZevvI 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:25FromDiscord<IanIAnIAN> I find nimPNG's documentation partially unreadable, I guess that's just me
21:31:29FromGitter<alehander92> you should make it a blog article vindaar
21:33:41rayman22201after staring at this diff for an hour lol... my intuition is telling me that it may have something to do with `=sink`
21:34:17rayman22201That's the biggest fundamental difference I can see
21:34:33FromGitter<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:11FromGitter<kaushalmodi> @Vindaar The source is already Org, just install ox-hugo and you have a blog ;-)
21:38:23FromGitter<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:41clyybberrayman22201: 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:23rayman22201I'm running out of ideas
21:46:52rayman22201I'm still curious about your valgrind results too....
21:47:14rayman22201Is it actually leaking, or is the count just broken?
21:51:06FromDiscord<krab4t> so this how you invert colors ` toHex(0 or not int(rgb), 6) `
21:51:37rayman22201side 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:41rayman22201But I guess it doesn't matter anyway since src should be destroyed right afterwards anyway...
21:52:59FromDiscord<krab4t> https://play.nim-lang.org/#ix=21e3
21:55:01clyybberrayman22201: 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:06clyybberrayman22201: 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:16clyybberand then we check if it *really* leaks
21:58:04rayman22201lol
21:58:30rayman22201My concern with that, is what if there are other leaks from independent things
21:58:45rayman22201(I don't trust nim code I didn't write to not leak :-P)
22:05:34FromGitter<mratsim> @Vindaar you forgot the flags that remove the cfi directives in your investigation
22:09:12FromGitter<mratsim> @narimiran looking
22:09:30FromGitter<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:21FromGitter<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:14clyybberrayman22201: 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:16Araqlqdev[m]: it is substantial, avoid it
22:21:01rayman22201putting some printf tracing shows that the `=` variant allocs 6 buffers but only frees 3
22:21:20rayman22201the assign variant allocs 2 and frees 2
22:21:30rayman22201something is wrong with the `=` code
22:21:31lqdev[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:50lqdev[m]open a github issue with a stack trace, or some other useful info.
22:22:41rayman22201That's for clyybber (and maybe araq)
22:22:44Araqthere are native ways to get a stack trace but it depends on your OS
22:23:12clyybberrayman22201: Hmm
22:23:27*adeohluwa joined #nim
22:23:33clyybberAraq: Where do we assign types to int literals?
22:23:58clyybberBecause 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:23Araqmagicsys.getIntLitType
22:30:26*crem quit (Ping timeout: 276 seconds)
22:33:04*solitudesf quit (Ping timeout: 264 seconds)
22:33:15clyybberThanks, 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:43clyybberI think it was the =move PR or one ofthe injectdestructors refactorings.. can't remember
22:34:04clyybberBut 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:37FromGitter<Vindaar> @mratsim "forgot" implies I knew of their existence..! Thanks, I'll take a look tomorrow. ⏎ and now, good night everyone :)
22:52:04FromDiscord<krab4t> lqdev[m] im pretty sure you need debug symbols for that, and that magic from google's breakpad
22:52:52rayman22201https://www.irccloud.com/pastebin/LUMG2sZG/
22:54:03rayman22201https://www.irccloud.com/pastebin/GCj6WfcX/
22:54:26rayman22201the `=` version produces a lot of intermediate allocs
22:58:11*MarderIII quit (Quit: Leaving)
22:58:59clyybberWhich shouldn't be a problem unless they produce copies on the heap, might be worth counting those.
22:59:01clyybberbbl
22:59:03clyybbergn8
22:59:04*clyybber quit (Quit: WeeChat 2.6)
22:59:14rayman22201gn
23:06:30*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:21:51FromDiscord<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:24enthus1astany idea why a runningExamples block with `discard waitFor socket.recvFrom(MSG_LEN)` blocks forever?
23:50:17enthus1astor another way i could write this that does not block :)
23:51:31enthus1astmh asyncCheck but then the example is not so good ...
23:56:54*jjido joined #nim