<< 10-10-2019 >>

00:41:19*rockcavera joined #nim
01:24:47*lritter joined #nim
01:29:57*Hideki_ joined #nim
01:30:04*Hideki_ quit (Remote host closed the connection)
01:52:46*Traviss joined #nim
01:53:46*Traviss quit (Client Quit)
01:55:09*traviss joined #nim
01:56:11*Traviss__ quit (Ping timeout: 250 seconds)
02:03:15*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
02:03:33*pbb joined #nim
02:04:27*pbb quit (Client Quit)
02:06:21*pbb joined #nim
02:06:56*a_b_m quit (Quit: Leaving)
02:07:01*pbb quit (Client Quit)
02:07:17*pbb joined #nim
02:07:47*pbb quit (Client Quit)
02:08:01*pbb joined #nim
02:12:07*pbb quit (Client Quit)
02:12:21*pbb joined #nim
02:12:59*pbb quit (Client Quit)
02:13:17*pbb joined #nim
02:16:00ball2q
02:17:13*ball2 quit (Quit: WeeChat 1.9.1)
02:28:23FromGitter<iffy> Is this error an indication of running out of memory? http://ix.io/1Ycm
02:30:19FromGitter<iffy> @theretromaniac also check out https://nimble.directory/pkg/argparse
02:31:22FromGitter<dawkot> (https://files.gitter.im/nim-lang/Nim/3Mrn/image.png)
02:31:23FromGitter<dawkot> How do I prevent this? (VSCode)
02:31:35disruptekwhen i've run out of memory, i get an "Out of memory" error.
02:31:51disruptekadmittedly, it doesn't happen often on 64gig...
02:34:47disrupteki made an error and it doesn't matter, but i can't figure out how this line compiles successfully: https://github.com/disruptek/golden/blob/master/src/golden/running.nim#L59
02:39:13*traviss quit (Quit: Leaving)
02:54:58*theelous3_ joined #nim
02:58:54*lritter quit (Ping timeout: 265 seconds)
02:59:14*lritter joined #nim
03:24:30*laaron joined #nim
03:35:46*traviss joined #nim
03:36:18*laaron quit (Quit: ZNC 1.7.4 - https://znc.in)
03:37:40*laaron joined #nim
03:37:52*gmpreussner quit (Read error: Connection reset by peer)
03:38:09*gmpreussner joined #nim
03:42:08*chemist69 quit (Ping timeout: 276 seconds)
03:43:34*chemist69 joined #nim
03:46:17FromGitter<gogolxdong> if body[i].kind == xnText and body[i].innerText != " ":
03:46:57FromGitter<gogolxdong> to filter the empty text element of XmlNode traverse
03:54:44leorizeI wouldn't count of checking for "one space"
03:55:02leorizeuse stripWhitespace() to deal with such cases
03:55:19leorizethen you can check for "not empty"
03:57:33*onionhammer quit (Quit: WeeChat 1.9.1)
04:00:31*onionhammer joined #nim
04:09:05*rockcavera quit (Remote host closed the connection)
04:15:33*Danny59 joined #nim
04:16:26FromGitter<gogolxdong> yes, good tip.
04:17:04*Danny59 is now known as danny_su
04:24:30*danny_su68 joined #nim
04:25:02*hades joined #nim
04:25:24*hades is now known as Guest97553
04:25:41*Guest97553 is now known as fichtl
04:28:44*danny_su68 quit (Remote host closed the connection)
04:29:06*danny_su quit (Remote host closed the connection)
04:50:51*nsf joined #nim
05:05:25*dddddd quit (Remote host closed the connection)
05:14:59*radsoc joined #nim
05:16:56*traviss quit (Quit: Leaving)
05:36:06*navinmistry joined #nim
05:41:27*skoude joined #nim
05:54:05*narimiran joined #nim
05:56:29*nc-x joined #nim
05:56:58*navinmistry quit (Remote host closed the connection)
05:58:09nc-x@dawkot: https://github.com/nim-lang/Nim/issues/11679#issuecomment-518188355 this might fix the issue. Or a PR to nim-vscode plugin so that it does not spawn nimsuggest for every file would work. which would be easier if leorize fulfills his promise of improving nimsuggest project detection :)
06:00:14*navinmistry joined #nim
06:01:42*radsoc quit (Quit: radsoc)
06:04:16*navinmistry quit (Ping timeout: 240 seconds)
06:06:02*skoude quit (Ping timeout: 240 seconds)
06:06:22*skoude joined #nim
06:09:36*solitudesf joined #nim
06:10:31*nc-x quit (Ping timeout: 260 seconds)
06:12:44minierollswhat would be the cleanest way to implement a hardcoded string lookup table? I need to define lots of small string lookup tables manually
06:14:02Araqwrite a macro that produces a 'case' statement on strings
06:14:24Araqthe codegen produces optimized code for it
06:21:29minierollsooo ok
06:22:03minierollsis there a way to find the number of values in an enum? trying to write macro to produce array of size (length of enum)
06:22:59Araqyeah but it's guesswork for me, something about getTypeImpl and iteration
06:23:10*PMunch joined #nim
06:26:14*laaron quit (Quit: ZNC 1.7.4 - https://znc.in)
06:27:00*laaron joined #nim
06:28:35minierollsah i see
06:28:45minierollsig ill just use sequences
06:29:17Araqor use set[MyEnum]
06:29:42*NicQ joined #nim
06:29:52minierollsoo that seems great! thanks
06:32:15*navinmistry joined #nim
06:41:13minierollshm any idea what problem i might have if i cant compile any files with an import to the standard library
06:41:25minierollseg Error: cannot open file: macros
06:45:03*nif quit (Quit: ...)
06:45:04*NicQ quit (Read error: Connection reset by peer)
06:45:12*nif joined #nim
06:47:49*theelous3_ quit (Ping timeout: 250 seconds)
06:48:21*theelous3 joined #nim
06:49:03*NicQ joined #nim
06:50:27leorizenc-x: I can improve it but it's still up to the plugin devs to make use of it :P
06:50:55leorizenarimiran: does the project finding code work well enough for you?
06:51:44leorizeminierolls: how did you install Nim?
06:52:13narimiranleorize: well i use it only on nim repo, and there it worked fine.
06:52:52minierolls@leorize I used snapd
06:52:55*laaron quit (Quit: ZNC 1.7.4 - https://znc.in)
06:53:59FromGitter<gogolxdong> How to change continuous spaces to one space?
06:53:59leorizemy guess is that they configured Nim incorrectly
06:54:16minierollsoof yea, looks like i cant even compile a nim file with no imports
06:54:29minierollsfails due to missing limits.h error o.o
06:54:49leorizeI don't have too much hope in snap :P
06:54:51minierollsig i wont use the snapd version
06:54:55lqdev[m]minierolls: don't bother with snap, it sucks. use choosenim to install Nim
06:55:03leorizeyou're on ubuntu, right?
06:55:05*laaron joined #nim
06:55:11minierollso im on fedora 30
06:55:14*laaron quit (Client Quit)
06:55:25lqdev[m]why do you use snap on fedora in the first place
06:55:37lqdev[m]we have flatpak and it's 100x better
06:55:42minierollshmm
06:55:45minierollsi am a linux nub
06:55:57minierolls@lqdev oo ok! thanks for the heads up about choosenim
06:55:57leorizeflatpak is more desktop-oriented
06:56:00minierollsdidnt know that was a thing
06:56:11minierollsah alright ig ill replace all my snaps with flatpaks lol
06:56:13FromDiscord<Corax> Hi guys, I have a hopefully simple question that is stumping me a bit 🙂 it's in this code block: https://play.nim-lang.org/#ix=1Ydb . I get a "Can raise an unlisted exception: Exception" coming from asyncmacro.nim(56, 9). Using try/except instead of defer doesn't solve it. Am I missing something? Is it because the future isn't consumed?
06:56:27*laaron joined #nim
06:56:40leorizeit's a known bug with async transformation
06:57:40*skoude quit (Ping timeout: 265 seconds)
06:57:49FromDiscord<Corax> Ah I see. Is it a bug in the sense that it wrongly reports the raise? Or should I still use the defer/trycatch? I want to ensure my module doesn't raise anything
06:58:06leorizehttps://github.com/nim-lang/Nim/issues/66639
06:58:09leorizehttps://github.com/nim-lang/Nim/issues/6639
06:58:23leorizeasync can raise internally
06:58:31leorizesince OS primitives can and does fail
06:59:14FromGitter<alehander42> ok Araq i rebased and removed some not-needed stuff from not nil
06:59:21FromGitter<alehander42> the previous not nil approach*
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:59*laaron quit (Remote host closed the connection)
07:01:49Araqalehander42: link?
07:01:54Araqhttps://www.codeproject.com/Articles/5247782/The-Cost-of-Waiting-for-Feedback-in-Software-Devel
07:02:21Araq"This study measured how much longer it takes a developer to fix a bug detected 3 weeks later instead of on the same day.
07:02:21AraqNow, how much longer do you think it takes?
07:02:21AraqAbout twenty-four times as much, no matter if the task is big or small."
07:03:25*navinmistry quit (Ping timeout: 250 seconds)
07:05:14*skoude joined #nim
07:05:21*gmpreussner joined #nim
07:05:40*NicQ quit (Read error: Connection reset by peer)
07:05:46*krux02 joined #nim
07:07:30minierolls@lqdev btw thanks for the choosenim suggestion! I used it to install nim and most of my compile errors are gone now
07:07:39minierollsjust one last problem with include macros though
07:07:43minierolls/.choosenim/toolchains/nim-1.0.0/lib/core/macros.nim(550, 31) Error: 'untyped' is only allowed in templates and macros
07:07:46FromDiscord<Corax> I think I don't understand the raises pragma 😦 shouldn't this fail to compile? https://play.nim-lang.org/#ix=1Yde
07:07:54minierollsany idea how to solve?
07:08:05FromDiscord<Corax> (since there is a chance it may raise IndexError)
07:10:01leorizeminierolls: can we have your code?
07:10:17*skoude quit (Ping timeout: 268 seconds)
07:10:24leorize@Corax: it ignores exceptions of type "Defect" IIRC
07:10:33leorizebugs are not protected by this
07:11:34minierolls@leorize https://play.nim-lang.org/#ix=1Ydf
07:11:42FromDiscord<Corax> kk that makes sense. Is there any way to statically guarantee all possible exceptions (even defects) are handled?
07:11:52leorizealso once you compile with -d:danger it will stop doing bound checks, etc
07:12:09leorizeso Defects won't be raised anymore
07:12:34FromDiscord<Corax> oh right, yeah in that case I should not take the easy route, I don't want UB at the end of the day 😉
07:13:48leorizeminierolls: it's `import` that you should be using
07:13:50leorizenot `include`
07:13:59leorizeNim is not C :P
07:14:11minierollsooo! oops sorry haha
07:14:33minierollsyea that fixed everything >.<
07:14:52minierollson an unrelated note, is it normal for nimpretty not to do anything
07:15:02leorizeyes
07:15:03FromGitter<alehander42> Araq https://github.com/alehander42/Nim/commit/aeea7b665335c7ef7a4e705e20a4934e39ab08f5
07:15:11minierollsahh i see
07:15:19minierollsthanks for answering all my stupid questions
07:15:26FromGitter<alehander42> and also Araq https://github.com/nim-lang/Nim/commit/6ad5c25bb76ab4888c507693af0b264a1ac1eee0
07:15:31FromGitter<alehander42> but this one is still WIP
07:15:37Araqcommits? how about a PR?
07:16:04narimiranminierolls: if your code is already nicely formatted: yep
07:18:38FromGitter<alehander42> https://github.com/nim-lang/Nim/pull/12401
07:18:48FromGitter<alehander42> its mostly very wip still i wanted to see
07:18:54FromGitter<alehander42> if the previous code can just be adapted
07:18:56FromGitter<alehander42> for that
07:18:59FromGitter<alehander42> but i have some problems
07:19:04FromGitter<alehander42> with default not nil
07:19:44FromGitter<alehander42> not sure if the places i touched are enough, and also i start to get some "fields not initialized" which are not obvious to me yet
07:21:51*couven92 joined #nim
07:22:31*Yardanico joined #nim
07:22:34PMunchHmm, why isn't "koch install" in the --help for koch?
07:23:57FromGitter<gogolxdong> I'm not sure why htmlparser doesn't parse tags with suffix />, like ⏎ <col class="docinfo-name" />
07:23:59leorizeprobably someone forgot to document it when they first added it to Nim
07:24:04*skoude joined #nim
07:24:09FromDiscord<Corax> is there no async recvFrom for sockets?
07:24:19leorizeuse asyncnet
07:24:39leorizeif you want to do async on sockets you need asyncsockets
07:24:46FromDiscord<Corax> I'm using it, but I can't find recvFrom in it particularly
07:24:50FromDiscord<Corax> or any variation
07:25:04FromDiscord<Corax> I need to receive UDP and store the address of the sender
07:25:45*traviss joined #nim
07:26:12*traviss quit (Client Quit)
07:26:26FromDiscord<Corax> I see there is an old deprecated recvFromAsync, but it looks like it didn't carry over to the asyncnet module, unless I'm very blind (also possible)
07:26:32FromGitter<gogolxdong> like <input type="text" id="searchInput" onkeyup="search()" /> and <br />
07:27:19leorize@Corax: seems like that it's not there
07:27:34leorizegogolxdong: I guess htmlparser wasn't meant for parsing xhtml
07:28:13FromGitter<gogolxdong> How to change ?
07:28:39FromDiscord<Corax> hmm that's a shame :/ I really needed async udp, but I guess that's something I could try and contribute with 🙂
07:30:22AraqCorax: I know others use async udp but I don't know what patches it required to the stdlib
07:30:32Araqnor whether these patches made it back into Nim :P
07:30:54AraqI've been told though "it was easy..."
07:31:03FromGitter<gogolxdong> It's nim generated html document.
07:32:47FromDiscord<Corax> I can probably just hack it an reach in through getAddrString after a successful recv
07:32:55FromDiscord<Corax> thanks for the pointers though 🙂
07:33:00leorize@gogolxdong it does work
07:33:20leorize!eval import htmlparser, xmltree; echo parseHtml"<br/>".htmlTag
07:33:25NimBottagBr
07:35:23FromGitter<gogolxdong> I'm not sure, I'm using htmlparser to parse tut1.html which is generated by nim rst2html command, <input type="text" id="searchInput" onkeyup="search()" /> ⏎ <br /> and <col class="docinfo-name" /> are missing.
07:35:52FromDiscord<ZeeQyu> Is the nimbot limited in what it can do, or are we relying on the good manners of the users?
07:36:05Araqalehander42: I like it, clean patch so far
07:36:08FromDiscord<Corax> nvm I'm dumb, it's all in AsyncDispatch
07:36:27Araqnot sure you need all these lookup tables in 'NilMap', but we can optimize it later
07:37:35narimiran@ZeeQyu you can try to break https://play.nim-lang.org/ privately (this is what nimbot uses), PMunch did some safety measures after it was broken the first time by Zevv
07:38:28FromGitter<gogolxdong> @leorize http://ix.io/1Ydj
07:38:55Araqgogolxdong: I had fixes for htmlparser I couldn't merge back yet
07:39:07FromDiscord<ZeeQyu> Yeah, I won't try to break the one that's here for everyone's convenience. That'd be rude.
07:39:46leorizeit's better to be broken than someone abusing the system while we wasn't looking :P
07:40:48FromGitter<gogolxdong> Do you mind sharing with me first for a testing?
07:42:15FromGitter<gogolxdong> I'm writing a static HTML parser to Karax . Indentation level is tricky.
07:42:52PMunchZeeQyu, to answer your question, it is pretty limited
07:43:03FromGitter<Vindaar> LTTP but congrats and yays to everyone (and especially Araq) on the 1.0 release! :) :) :)
07:43:19PMunchIt can only run for a certain length of time, with a limit on CPU usage and RAM usage. And it has no network
07:43:35PMunchAnd of course the whole thing runs in a container that is deleted as soon as it is done
07:43:36narimiran@Vindaar oh look, it is Internet Explorer! :D
07:43:57FromGitter<Vindaar> what? :D
07:44:07PMunchVindaar, oh man I think we're all out of cake at this point..
07:44:20PMunchMight be some crusty leftover in the fridge though :)
07:44:30narimiran@Vindaar you know all the comics where IE responds way too late?
07:44:56Araq@Vindaar: thanks!
07:45:19FromGitter<Vindaar> @narimiran: actually no, but I think I avoid certain places on the web, haha. ⏎ @PMunch: oh well, it's fine. I had so much delicious food on vacation, I'm happy for the time being
07:45:47narimiranah, you ruined my joke :P
07:45:58FromGitter<Vindaar> I'm sorry (;
07:47:46*broth joined #nim
07:47:51PMunchVindaar: https://pbs.twimg.com/media/BMbnM6fCUAE1Vwu.jpg
07:48:22FromGitter<Vindaar> hahaha
07:48:28FromGitter<gogolxdong> I'm not good at handling this kind recursive parser and indentation level, can anyone spare some time to help me?
07:48:28PMunchHmm, vacation sounds nice though..
07:48:44FromGitter<Vindaar> oh yes. can recommend
07:49:45FromGitter<gogolxdong> http://ix.io/1Ydj
07:51:16FromDiscord<ZeeQyu> PMunch, yeah I assumed that was the case. I'll try to probe play.nim-lang.org and tell you if I find something there. Is the chat bot more limited than that site, or are they at parity?
07:52:30FromGitter<mratsim> AFAIK it uses the playground as a backend
07:52:41FromGitter<mratsim> If you break the playground you will break the bot
07:53:04FromGitter<mratsim> But you might only break the IRC layer and not the playground if you attack the bot
07:53:23FromGitter<alehander42> thanks God, a new day .
07:53:46*navinmistry joined #nim
07:53:46FromGitter<alehander42> hello mamy
07:53:49PMunchZeeQyu, both the bot and the playground uses the same server
07:53:50FromGitter<alehander42> Araq, i still
07:54:16FromGitter<alehander42> wonder about the fields thing, it seems it happens for TNimType which is even not ref
07:54:18FromGitter<alehander42> ill debug it
07:54:29PMunchYou can of course use the same calls as they use if you want to send things directly to the playground without using the site
07:54:49*floppydh joined #nim
07:56:56*solitudesf quit (Ping timeout: 276 seconds)
08:01:36*skoude quit (Ping timeout: 240 seconds)
08:01:55euantorAraq: I think there's some confusion about this PR: https://github.com/nim-lang/Nim/pull/12390#issuecomment-540449835
08:02:26euantorI don't think a `when defined(openbsd)` is needed at all, but can understand how it could be confused based upon reading the comments
08:02:47euantorI'm not suggesting changing `findExe` except perhaps the part where it resolves symlinks
08:08:34*shomodj joined #nim
08:14:51*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:17:08FromGitter<me7> Hi, I want to help fix this open issue https://github.com/nim-lang/Nim/issues/12319
08:17:42FromGitter<me7> but I don't know where is the source of finish.exe that's delete nim path after install twice
08:17:57FromGitter<me7> Could someone give a clue on this?
08:19:17euantor@me7: Check ehre for `finish.nim`: https://github.com/nim-lang/Nim/blob/devel/tools/finish.nim
08:20:07FromGitter<me7> Thank you, will check it
08:24:47*navinmistry quit (Remote host closed the connection)
08:24:54*navinmistry joined #nim
08:27:37*shomodj joined #nim
08:29:34FromDiscord<ZeeQyu> mratsim, PMunch: alright.
08:30:23*skoude joined #nim
08:30:25*NicQ joined #nim
08:30:29FromDiscord<ZeeQyu> Is there a nim equivalent to pythons import sys; sys.version and sys.version_info? That is, a way to check the current nim version from inside a program.
08:30:33*asymptotically joined #nim
08:32:21FromDiscord<ZeeQyu> Sorry, found it myself. NimVersion, defined in system.nim
08:35:16*traviss joined #nim
08:35:23*skoude quit (Ping timeout: 268 seconds)
08:36:16Araqeuantor, this stuff is fragile and openbsd specific changes should be under 'when defined(openbsd)'
08:36:20Araqthat's all I'm saying
08:36:37*theelous3 quit (Ping timeout: 268 seconds)
08:36:48Araqand don't change the other stuff, it works well and at the same time it's not covered by CIs
08:45:39*navinmistry quit (Remote host closed the connection)
08:46:35*navinmistry joined #nim
08:46:38*ng0 joined #nim
08:47:37*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
08:47:52*pbb joined #nim
08:49:18*skoude joined #nim
08:54:42*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
08:54:57*pbb joined #nim
08:57:06PMunchZeeQyu, note that since these are known at compile-time you can use `when` instead of `if` to check against the version. This would mean that the decision is made on compile-time and will remove all the code you potentially don't need
08:57:49*skoude quit (Ping timeout: 250 seconds)
09:02:16euantorAraq: Fair enough, I'll make the change then
09:07:43*skoude joined #nim
09:12:23*skoude quit (Ping timeout: 268 seconds)
09:15:25*actuallybatman quit (Ping timeout: 265 seconds)
09:17:28*navinmistry quit (Ping timeout: 264 seconds)
09:18:16PMunchStarted typing up an idea I had yesterday and realised it would be way to long over IRC: https://peterme.net/scraps/web-frameworks-in-nim.html
09:23:17Zevvwho is in charge of the nimforum site these days?
09:24:47Zevvit has no favicon!
09:25:01PMunchOh the horrors!
09:25:25PMunchSuch a silly mistake to make as well..
09:26:34*skoude joined #nim
09:27:33PMunchHmm, what is the best way to deal with things like this? https://forum.nim-lang.org/t/5321
09:28:03PMunchI mean, I cheated when I was playing around with my work-stealer and just said --gc:boehm
09:28:06Zevvexcellent question
09:28:23PMunchBut I feel like there should be a better way of dealing with things like this..
09:28:32*stefantalpalaru joined #nim
09:28:35Zevvthat has been an open question for some time
09:28:59Zevvthere's sharedtables and some other niche solutions, but the overall story is still hard
09:29:23PMunchJust thinking out loud here, but would it be possible to have a global GC for a global heap, that would require some special global context?
09:29:42Zevvthat's kind of your boehm, right
09:30:29ZevvI guess a lot of things *can* be done, but there is no easy solution for these kind of things at this time
09:30:57ZevvWhen I needed this I fell back to manual memory management
09:31:01Zevvand locking
09:31:04Zevvthat works, but is not fun
09:31:09PMunchWell not quite, I was more thinking that each thread still have their own heap, so no stop the world GC. But if you want to access the global heap you acquire a lock for the global context, then you can do stuff there, potentially triggering it to garbage collect only the global heap.
09:31:23PMunchYeah, that isn't great
09:31:38PMunchI guess what I want is more control over the garbage collector instances
09:31:55Zevvthis is where araqsgc and newruntime should shine, IIUC
09:32:04PMunchSo I could e.g. transfer a block of memory from one garbage collector to another
09:32:27PMunchTell Nim which garbage collector context I'm currently in
09:32:39Zevvbut what if you're referencing from more then one thread
09:32:47PMunchAnd of course be able to create new garbage collector instances manually
09:34:00PMunchWell that is the thing, with this kind of control you could write a library that would allow you to have a "shared heap" it would have its own GC instance, and to access it you would need to grab a lock, and then change to that context. Now everything you do while in that context is only registered with that GC, and the only GC you can trigger when in that context is that one.
09:34:56*skoude quit (Ping timeout: 240 seconds)
09:37:27Araqfor reasons not obvious to me Boehm GC wins on most benchmarks I've looked at
09:37:40PMunchBut it is stop-the-world right?
09:37:44Araqincluding the Nim compiler itself when you use it
09:37:55Araq(koch boot -d:release --gc:boehm)
09:38:02PMunchHuh, so I should compile Nim with that then?
09:38:14Araqif you want a faster Nim, it's an option
09:38:50*LargeEpsilon joined #nim
09:38:51Araqbut my point is that "what are the thread local heaps for then?"
09:38:53PMunchHow much faster?
09:39:17Araqdepends on your OS, just give it a try
09:39:41Araq3% over --gc:markAndSweep (which isn't the default either...)
09:40:41Araqbut if boehm uses a shared heap, conceptually, this means the "thread local heaps" doesn't help performance much
09:43:45PMunchHmm, that's a good point
09:43:54PMunchBut throughput != latency
09:44:05PMunchI guess thread local heaps should be better for worst case scenario latency
09:44:16PMunchWhile potentially worse for overall throughput
09:44:24PMunchDepending on overall workload of course
09:46:40Araqthe evidence that we have so far suggests thread local heaps aren't worth it and if "shared heap" is the new default, we don't have this split
09:48:04AraqI'm talking about "heap per thread" vs "single heap" only
09:49:08PMunchWould be interesting to run some tests on a machine with e.g. the new Ryzen chips with loads of physical cores
09:49:29PMunchTo see if the lock-the-world phenomenon is more pronounced there.
09:49:36Araqoh make no mistake, the usual 'malloc' implementation is "thread local" too
09:50:08Araqthere is an if statement like "if currentThreadID == page.owner: <fast path here>"
09:50:28Araqit's done at runtime
09:50:39Araqand don't burden the type system of the language
09:53:02Araqand now I should probably explain "araqsgc" to you...
09:53:52Araqgah all my Visual Studios say "license invalid"
09:54:39*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
09:54:46FromDiscord<Rika> time for renewal
09:54:56*pbb joined #nim
09:55:23FromDiscord<Rika> i like how jetbrains include the license expiry date on the startup splashes of their IDEs
09:56:33PMunchhttps://play.nim-lang.org/#ix=1YdM
09:56:43PMunchWoop woop, nimble packgaes now "available" for the playground
09:57:07*pbb quit (Client Quit)
09:57:23*pbb joined #nim
09:59:41Araqnice
10:02:49*skoude joined #nim
10:04:14AraqPMunch, the idea is to support Boehm's GC and araqsgc which is a hybrid, it supports manual freeing to give us "gradual" memory management. if you care about latency, add manual free calls until the GC never has to run. it's the only thing that really works well IMO having studied this problem for a decade now.
10:06:36*broth quit (Ping timeout: 240 seconds)
10:12:21*NicQ quit (Read error: Connection reset by peer)
10:12:37*NicQ joined #nim
10:12:49*skoude quit (Ping timeout: 268 seconds)
10:15:53stefantalpalaruHow about having a stabilisation period, like the Linux kernel, instead of cherry-picking commits from "devel" into "version-1-0" before tagging a release?
10:16:22stefantalpalaruIt should simplify things for you.
10:20:27stefantalpalaru(and avoid bugs introduced by newer commits depending on code in those older commits you're skipping)
10:21:42leorizeat one point you will have to get back to backporting
10:22:06*adeohluwa joined #nim
10:23:18*broth joined #nim
10:24:00stefantalpalaruFor bugfix releases between stabilisation periods? Those will probably involve much fewer commits than the current scheme.
10:25:57PMunchAraq, how does araqsgc compare to boehm and the native one?
10:26:35PMunchBy the way, trying to add --gc:boehm to the Nim build in a docker image gave me an error about libgc.so.1 missing, is there some package I need to install?
10:27:03narimiranstefantalpalaru: what do you mean by "stabilization period"? a period where there are no new commits/cherrypicks to a branch, and it is in the test phase?
10:29:02stefantalpalaruNo new features. It would work like this: 2 weeks feature frenzy when contributors go crazy, followed by 2 weeks of stabilisation where there are no new features, just bug fixes. At the end, you have a stable "devel" that you can tag and release.
10:29:19stefantalpalaruRinse, repeat.
10:30:02stefantalpalaruPMunch, look for a package named "beohm-gc" or similar.
10:30:14stefantalpalaru*boehm-gc
10:30:31FromDiscord<Rika> PMunch, TIL termstyle, thanks
10:30:50PMunchRika, haha yeah it was the simplest package I could think of :P
10:31:01PMunchBut it's suprisingly useful
10:31:36PMunchI often colour code my log statements if I'm logging a lot, makes it waaay easier to see the flow of a program
10:32:01narimiranstefantalpalaru: something like that is happening on our backport branch for v1.0.2
10:32:41stefantalpalaruNo. That's cherry-picking and it's dangerous.
10:33:06*nif quit (Quit: ...)
10:33:07stefantalpalaruCommits are not atomic. They might depend on some of those commits you're skipping.
10:33:11narimiranbugfixing can also be dangerous
10:33:16*nif joined #nim
10:33:40stefantalpalaruಠ_ಠ
10:34:21*LargeEpsilon quit (Ping timeout: 246 seconds)
10:34:25FromGitter<me7> dear @Araq, for issue https://github.com/nim-lang/Nim/issues/12319 that tag for hacktoberfest
10:34:36PMunchstefantalpalaru, apparently it's only called "gc" on Alpine :)
10:34:47stefantalpalaruWeird.
10:34:51*NicQ quit (Ping timeout: 240 seconds)
10:34:57FromGitter<me7> I've checkout devel branch and test. Found that it's already fixed duplicate paht
10:34:59*NicQ joined #nim
10:35:08FromGitter<me7> maybe you can close it?
10:35:43FromGitter<me7> I tested on my windows machine
10:35:44*NicQ quit (Read error: Connection reset by peer)
10:36:01*NicQ joined #nim
10:36:36narimiran@me7 write that as a comment there. tell OP to re-test it with the latest devel
10:37:02FromGitter<me7> Ok, thank
10:37:40narimirani'm guessing this is the commit that fixed it: https://github.com/nim-lang/Nim/commit/657e09e79deabe6304ead7759a4fdcfeb5fd022b
10:38:02narimiranif you want, you can revert it and see if you can then reproduce the reported bug
10:38:31narimiranand if that's the case, we can then confidently close that issue
10:39:54*skoude joined #nim
10:42:15*NicQ quit (Ping timeout: 250 seconds)
10:43:01*NicQ joined #nim
10:43:44*NicQ quit (Read error: Connection reset by peer)
10:43:54*NicQ joined #nim
10:47:49*NicQ quit (Read error: Connection reset by peer)
10:48:07*lritter quit (Remote host closed the connection)
10:48:34*NicQ joined #nim
10:49:14*skoude quit (Ping timeout: 240 seconds)
10:51:09*solitudesf joined #nim
10:52:20*NicQ quit (Read error: Connection reset by peer)
10:53:04*NicQ joined #nim
10:53:45*NicQ quit (Read error: Connection reset by peer)
10:53:53*NicQ joined #nim
10:57:18leorizeAraq, nc-x: https://github.com/nim-lang/Nim/pull/12404
10:57:59*r3c quit (Ping timeout: 260 seconds)
10:58:49*NicQ is now known as noxious
10:58:57*skoude joined #nim
10:59:57*ng0 quit (Remote host closed the connection)
11:00:07*noxious is now known as noxiousnic
11:00:29*asymptotically2 joined #nim
11:00:32*asymptotically is now known as Guest37136
11:00:32*asymptotically2 is now known as asymptotically
11:00:43*noxiousnic is now known as NicQ
11:00:47*Guest37136 quit (Remote host closed the connection)
11:04:13leorizewhile the algorithm has been improved, this alone is not enough for usage by nimsuggest users yet
11:04:39*LargeEpsilon joined #nim
11:04:47leorizenimsuggest needs to be able to communicate the project file used, so that plugin writers know what project is covered by nimsuggest
11:05:29PMunchHmm, what do you think is the best approach to the packages on the playground. I'm not trying to install all the packages in the important_packages list, but I see that there are a lot of things there which aren't really useful to have in the playground
11:05:32leorizeand optionally a switch to "attempt" detection should be there so that plugin writers don't have to launch nimsuggest twice if it couldn't find the project file
11:06:48leorizePMunch: the PR above is what you'd want for nimlsp :)
11:08:14*NicQ quit (Quit: Quit)
11:08:56*skoude quit (Ping timeout: 268 seconds)
11:09:13*NicQ joined #nim
11:16:19*ng0 joined #nim
11:18:29*madpata joined #nim
11:20:24madpataIs it possible to use the httpclient module when compiling to JS? I get an error from nativesockets.nim when importing the module
11:23:16*ng0_ joined #nim
11:24:00lqdev[m]I think the only way is to use XMLHttpRequests
11:24:10lqdev[m]dunno if there's a wrapper in the stdlib
11:24:23*ng0 is now known as Guest59160
11:24:23*ng0_ is now known as ng0
11:26:08*Guest59160 quit (Ping timeout: 260 seconds)
11:28:35madpataThere is a nimble package 'ajax'. I'll give that a shot.
11:31:56Araqleorize, why? that's what 'known' is for
11:32:13Araqyou can ask nimsuggest if the .nim file is part of the project already (if it is "known")
11:34:25*adeohluwa left #nim (#nim)
11:34:38*adeohluwa joined #nim
11:34:41*adeohluwa quit (Remote host closed the connection)
11:35:24FromGitter<alehander42> stefantalpalaur
11:35:37FromGitter<alehander42> stefantalpalaru's idea for freezing period
11:35:40FromGitter<alehander42> sounds good
11:37:12*rockcavera joined #nim
11:37:38leorize[m]if i use 3 nimsuggest instances it would mean that I have to iterate through them and wait for the reply before I can decide if I want to launch a new instance
11:37:56leorize[m]also, it won't work for new files
11:40:33*skoude joined #nim
11:41:03FromDiscord<Rika> do openarrays work any differently as a return parameter vs a seq?
11:42:21ZevvAm I stupid? https://play.nim-lang.org/#ix=1Ye5
11:43:45FromDiscord<Rika> wtf
11:43:53Araqalehander42: it doesn't work well, so we stop for 2 weeks merging PRs. our PR queue and feedback cycle is already discouraging
11:44:12Araqand what do we gain? nothing
11:44:36Araqpeople try 1.1.0 or 1.0.2 and report regressions just like today.
11:44:53*shomodj_ joined #nim
11:45:15*skoude quit (Ping timeout: 265 seconds)
11:45:33FromGitter<alehander42> the point is to not merge new features in the 1.0.2 i guess, like "those are all the features in 1.0.2, others go into 1.0.4"
11:45:39FromGitter<alehander42> or maybe i am not understanding it
11:45:46FromDiscord<Rika> Zevv, https://play.nim-lang.org/#ix=1Ye6
11:45:51Araqwe don't merge features to 1.0.2
11:47:30*shomodj quit (Ping timeout: 246 seconds)
11:52:11jkenIs there a syntax in nim for testing if all elements of a hashmap are also keys in a table|
11:52:47jkens/hashmap/hashset
11:58:05AraqallIt(for v in values(mymap): v in it)
11:58:31Araqbut it requires some for-loop macro extension
11:58:56Araqiirc alehander42 had some nice package for it?
12:08:56Zevvooh again the static thing, d**n, I knew that
12:16:00leorize@Rika: they are different in that you can't return an openarray :P
12:16:18FromDiscord<Rika> i see a lot of procs with openarray return types though
12:16:31FromDiscord<Rika> perhaps theyre all magics?
12:17:01FromDiscord<Rika> ah yeah theyre just toOpenArray procs
12:23:33*madpata quit (Ping timeout: 268 seconds)
12:29:27PMunchleorize, which one?
12:29:48leorizehttps://github.com/nim-lang/Nim/pull/12404
12:35:20*dddddd joined #nim
12:37:42PMunchThe playground will be down for a little while
12:40:09PMunchleorize, aha so I can skip this then: https://github.com/PMunch/nimlsp/blob/master/src/nimlsp.nim#L115-L138
12:42:10*skoude joined #nim
12:54:54*shomodj_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:56:38*Vladar joined #nim
12:59:17*shomodj joined #nim
12:59:26PMunchThere, the playground is back up, and with many more packages: https://play.nim-lang.org/#ix=1Yem
13:07:59PMunchHmm, we have our call for participation for FOSDEM ready. Would it be possibly to do a blog-post with it for visibility? Or should I stick to posting it on the forums/reddit/link it here?
13:10:04PMunchDamn it, the syntax of procedures is impossible to recreate for other things
13:10:34PMunchLike I can't create something that allows me to create a new thing alongside proc/func/macro/template
13:12:51PMunchhttps://play.nim-lang.org/#ix=1Yeq
13:25:50*skoude quit (Ping timeout: 268 seconds)
13:27:47*xace quit (Ping timeout: 250 seconds)
13:35:39PMunchHmm, what are the rules for when doc-comments enter the AST?
13:37:03ZevvI believe they must be first thing in a proc, if that is what you mean?
13:38:01PMunchYeah, you can have them for procs, types, and vars
13:38:19FromDiscord<kodkuce> yey reached half exercism done
13:38:23PMunchI wanted to play with doc comments for routes in jester..
13:38:41FromGitter<alehander42> PMunch
13:38:47FromGitter<alehander42> good idea about the jester thing
13:39:12PMunchYeah, but it appears like it will be hard to implement the way I thought..
13:39:12FromGitter<alehander42> i think you should look at other REST-api self-documenting or similar things
13:39:24FromGitter<alehander42> i wanted to write something like that for REST or graphql
13:39:37FromGitter<alehander42> like, a simple definition with type checked routes and endpoints
13:39:41FromGitter<alehander42> but not sure if its similar
13:39:53FromGitter<alehander42> the `explanation` thing is more interesting
13:40:13FromGitter<alehander42> maybe one can just autocheck the comments somehow, at least for your example
13:40:15PMunchThis thing? https://github.com/PMunch/explanations
13:40:31FromGitter<alehander42> it seems that one can infer that the numbers just change and generate a warning
13:40:32FromGitter<alehander42> yes
13:40:55PMunchThat the numbers change?
13:41:20PMunchOh, I just thought of the ugliest hack to lift doc comments into the code :P
13:42:03PMunchUse the "which line is this statement from" feature to see if lines are missing at the start. Then read the original source file and grab those lines from the file :P
13:42:12PMunchThen check if they have ## and take them
13:42:57FromGitter<alehander42> well
13:43:01FromGitter<alehander42> you write your comment in english
13:43:20FromGitter<alehander42> and then a macro can detect
13:43:31FromGitter<alehander42> you use different numbers in it than in the code
13:43:35FromGitter<alehander42> without any syntax
13:43:50FromGitter<alehander42> #for a < 100 stuff otherwise for a < 1000 stuff ⏎ ⏎ if a < 102: ⏎ .. [https://gitter.im/nim-lang/Nim?at=5d9f3595203e42147381c682]
13:44:05PMunchOh wait, doc comments get there if it's the first thing in a StmtList as well
13:44:13PMunchThat makes it easier
13:44:49FromGitter<alehander42> otherwise for REST you might also like the typestate pattern
13:44:59FromGitter<alehander42> but i am not sure it actually applies in this case
13:45:08PMunchEch, that sounds hard to get right..
13:45:32jkenAraq, what benefit does the `allit` example you posted have over using all() like this? https://play.nim-lang.org/#ix=1Yev
13:45:42jkenDoes it avoid the conversion from HashSet to seq?
13:51:09leorizejken: allIt avoids the creation of a closure
13:51:16leorizeinstead it inlines everything
13:52:21jkenAre closures considered expensive?
13:57:01FromGitter<alehander42> depends on the usecase i guess
13:57:23FromGitter<alehander42> i'd say one should profile his code and not use them only if its bottleneck
13:57:49FromGitter<alehander42> i'd say they are slightly more expensive, but should be fine for many projects
14:05:58*madpata joined #nim
14:09:50*asymptotically quit (Quit: Leaving)
14:10:27*Kaivo quit (Ping timeout: 240 seconds)
14:11:12*Kaivo joined #nim
14:14:03PMunchWho's up for an ungly hack?
14:14:24*NimBot joined #nim
14:14:55PMunchalehander42, this is what I was thinking of when I was talking about an ugly hack to read doc comments that didn't make it into the AST: https://play.nim-lang.org/#ix=1YeA
14:15:07PMunchBut just typing out that code made me feel dirty inside
14:15:57PMunchNimBot, you okay?
14:16:03PMunch!eval echo "Yes :)"
14:16:06NimBotYes :)
14:16:11PMunchYay :)
14:17:36FromGitter<alehander42> nothing dirty
14:17:39FromGitter<alehander42> ok but
14:17:45FromGitter<alehander42> i dont understand how it is applied?
14:18:12FromGitter<alehander42> like, e.g. i write a block describing all my endpoints and it autogenerates doc
14:19:17PMunchWell the idea was to have a doc-comment for the route, that would explain what it did, and the inputs it takes (this is similar to how regular doc comments work today for procedures)
14:19:57PMunchThen it would use something similar to explanations to annotate all the responses and errors it could create, which would also be put into the documentation
14:20:40FromGitter<alehander42> great idea
14:21:06FromGitter<alehander42> really, id like to see it
14:21:16FromGitter<alehander42> but i'd suggest to still try to move
14:21:21PMunchAnd with a combination of the return type, the .raises. information (create custom exceptions for each HTTP error), and the documentation comments you would get a pretty good overview of your API.
14:21:22FromGitter<alehander42> whataver's possible in types
14:21:28FromGitter<alehander42> and use expl only for edge cases
14:21:41PMunchHmm, what do you mean
14:21:51FromGitter<alehander42> for your example with explanation
14:22:28FromGitter<alehander42> e.g. i can imagine using range types
14:22:50FromGitter<alehander42> but not sure if its easy to do
14:23:25FromGitter<alehander42> but in any case, my point is mostly this: to think of ways that most usual inputs/output relationships can be decoded directly as types
14:24:34FromGitter<alehander42> and of course when this is too hard, then to use expl
14:25:18FromGitter<alehander42> but i agree that with comments
14:25:29FromGitter<alehander42> your `explanations` would look better
14:25:51FromGitter<alehander42> you can do of low(int) .. 100 # with lower limit of $1
14:26:06*broth quit (Quit: Leaving)
14:26:12FromGitter<alehander42> and dont even repeat anything in documentation: autoadding the values from the code to the docs
14:27:23FromGitter<alehander42> right? if thats what you intended to do the whole time, sorry : )
14:27:44FromDiscord<Rika> okay last time i asked this i was confused; is the pure pragma still functional for enums?
14:28:22PMunchalehander42, oh that might be possible..
14:28:47PMunchToo bad I need this ugly hack to read those doc-comments though..
14:29:25PMunchIt's pretty brittle as well..
14:29:57FromGitter<alehander42> but you dont?
14:30:06PMunchDon't what?
14:30:08FromGitter<alehander42> i mean, what is the hack
14:30:15PMunchDidn't you see the paste?
14:30:15FromGitter<alehander42> you need a macro of course
14:30:24FromGitter<alehander42> mate i love macros
14:30:37PMunchDid you read the macro?
14:31:09FromGitter<alehander42> well, it works
14:31:12FromGitter<alehander42> so its not ugly
14:31:14FromGitter<alehander42> but i think
14:31:17FromGitter<alehander42> this is not needed indeed
14:31:30PMunchIt takes the line info from the line it's looking at, then opens the file its in, goes to that line. Then steps over the repr of the statement and the contents of the file until the repr is completed. Then it looks for ## and if it finds it extracts its conten..
14:31:31FromGitter<alehander42> i am sure docstrings and comments were supposed to be
14:31:33FromGitter<alehander42> in the nodes
14:31:41FromGitter<alehander42> because krux02 was working
14:31:44FromGitter<alehander42> on something like that
14:31:54PMunchYeah, apparently that only aplies to certain parts of the code..
14:32:03FromGitter<alehander42> function-level?
14:32:13PMunchLike if you have loose comments in a StmtList they seem to work
14:32:27krux02yea docstrings are a bit nasty.
14:32:52FromGitter<alehander42> hmm so are only `##` supported
14:32:55krux02as long as doc strings are in their own line, they become a comment statemnt
14:33:12PMunchYeah
14:33:25krux02but if they are attached to something else, they are stored in a hidden field of the nim node.
14:33:33krux02this was just a lazy implementation
14:33:40FromGitter<alehander42> but can it be accessed
14:34:05*Kaivo quit (Ping timeout: 276 seconds)
14:34:11krux02it totally destroys the memory smallness of nimnodes
14:34:23PMunchExample: https://play.nim-lang.org/#ix=1YeF
14:34:43PMunchWait, they are stored in a hidden field?
14:34:47krux02there was the ambition to properly design this, but nothing can be done that would be backwards compatible
14:34:54FromGitter<alehander42> `.comment`
14:35:09FromGitter<alehander42> ok, so is it supposed to be exposed with macros
14:35:25FromGitter<alehander42> or its still unstable
14:35:34krux02no not exposed with macros, the idea was to expose then as separate, visible nodes in the ast
14:35:43krux02but where to put them?
14:35:50krux02there is no space for them
14:35:51FromGitter<alehander42> hm, well cant we have an accessor
14:36:00FromGitter<alehander42> to the node that has the `.comment` field anyway
14:36:27FromGitter<alehander42> otherwise i guess after the node?
14:36:41FromGitter<alehander42> if they are before the node, they are either on new line, so they have a node
14:37:04FromGitter<alehander42> or are after a previous node, so they're probably comment for previous
14:37:56jkenWhat does "Error: cannot evaluate at compile time: systemCount" mean?
14:38:01*Kaivo joined #nim
14:38:10jkenIts refering to me calling inc() on a var systemCount: int
14:38:16FromGitter<alehander42> it's not const
14:38:31FromGitter<alehander42> and you're using it in static context
14:38:55FromGitter<alehander42> you can have var a {.compileTime.}: int iirc (is this still)
14:39:05PMunchYeah, that's right
14:39:12PMunchBut about the NimNodes and comments
14:39:23PMunchAs long as I can grab the comment I'm fine with it
14:41:07PMunchAh, NimNodes are a magic..
14:41:43FromGitter<alehander42> but this is not a problem i think
14:41:49*nsf quit (Quit: WeeChat 2.5)
14:42:11FromGitter<alehander42> i think the problem is they still want to not have .comment
14:42:24PMunchWhy?
14:42:28krux02PMunch: you should discuss this with Araq. I think we should give up the idea that some day we can remove the comment field of the NimNode that extends every Node by 8 bytes even though most nodes don't have a comment at all.
14:42:32PMunchThat is exactly the thing I would want for this..
14:43:16PMunchYeah while that is not a great situation if I can't even access the comment then it's just waste..
14:43:24PMunchBut if I can access it then I'm good
14:43:28FromGitter<alehander42> so the problem is that new comment nodes would break existing macros?
14:43:33PMunchThat would be exactly the thing I need to implement this
14:43:45krux02yes new comment nodes would break existing macros.
14:43:46PMunchYeah that would likely be a bad time
14:43:59krux02you cannot suddenly put nodes into the ast that were never there before.
14:44:06PMunchBut I don't think a lot of macro calls have stray doc comments lying around..
14:44:20krux02I worked on a branch where I tried to have minimal breaking change
14:44:59FromGitter<alehander42> well if .comment remains, it can be still exposed
14:45:04krux02instead of nnkPostFix nodes for the export marker, have an nnkExportDoc nods that containst the symbol and a comment field
14:45:34krux02this would still break macros, but it would break them in a way that would be straight forward to fix.
14:46:41*couven92 quit (Quit: Client disconnecting)
14:46:54PMunchBut is it possible to get the comment of a node?
14:47:05PMunchFrom the hidden field?
14:47:12PMunchOr is that information just, gone?
14:47:12krux02no it isn't
14:47:16PMunchWhy?
14:47:40PMunchAdding a .comment accessor to NimNodes wouldn't break anything, and it would expose the comments
14:47:50krux02the information isn't gone it is just not exposed to the macros. and the hope was to keep it as an implementation detail that can be removed later.
14:48:29krux02but just discuss it with Araq nicely.
14:48:36PMunchYeah I will :)
14:48:53krux02I have to go now
14:49:05PMunchBecause if I had access to the comments I could do some cool stuff with auto-generation of documentation :)
14:49:07PMunchSame
14:49:10PMunchBye
14:49:12*PMunch quit (Remote host closed the connection)
14:49:16Araqmeh
14:49:56shashlick@Araq thanks for sharing that article on the cost of waiting
14:50:14shashlickWish it had a real solution though, article wasn't too useful at that
14:50:36shashlickCause getting quick feedback means interrupting the flow of the reviewer as well
15:06:48*fanta1 joined #nim
15:11:37*NicQ quit (Ping timeout: 240 seconds)
15:12:30*NicQ joined #nim
15:12:35*floppydh quit (Quit: WeeChat 2.6)
15:19:16shashlick@disruptek, @leorize - nimterop now creates all artifacts in nimcache and is capable of searching for standard libs before falling back on git/tgz
15:20:38*NicQ quit (Read error: Connection reset by peer)
15:21:19*NicQ joined #nim
15:21:45FromGitter<alehander42> pmunch cool about the packages on playground tho
15:22:18*fanta1 quit (Quit: fanta1)
15:39:49*matlock joined #nim
15:41:11*matlock quit (Client Quit)
15:43:29*NicQ quit (Read error: Connection reset by peer)
15:43:45*NicQ joined #nim
15:46:36*Trustable joined #nim
15:51:23*matlock joined #nim
16:02:36*NicQ quit (Read error: Connection reset by peer)
16:03:20*NicQ joined #nim
16:09:19*nif quit (Quit: ...)
16:09:31*nif_ joined #nim
16:10:00*LargeEpsilon quit (Ping timeout: 246 seconds)
16:18:10*adeohluwa joined #nim
16:18:23*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:23:34*actuallybatman joined #nim
16:24:30*Trustable quit (Remote host closed the connection)
16:25:28*Trustable joined #nim
16:25:37*NicQ quit (Read error: Connection reset by peer)
16:26:26*NicQ joined #nim
16:40:57ZevvWoohoo!
16:41:05ZevvPmuch coool stuff
16:44:19Zevvand why these 115 packages?
16:50:49shashlick@PMunch any chance of adding nimterop to playground?
16:51:19Zevvthere you go :)
16:52:10*NicQ quit (Read error: Connection reset by peer)
16:53:00*NicQ joined #nim
16:56:10*matlock quit (Read error: Connection reset by peer)
16:57:50*NicQ quit (Read error: Connection reset by peer)
16:58:01*NicQ joined #nim
16:59:06adeohluwai want to contribute .....
17:01:05*NicQ quit (Client Quit)
17:02:23adeohluwahttps://github.com/nim-lang/needed-libraries/issues/90
17:02:53adeohluwahttps://github.com/nim-lang/needed-libraries/issues/101
17:09:57*nsf joined #nim
17:10:03*adeohluwa quit (Ping timeout: 240 seconds)
17:11:24jkenDo tables have an addOrUpdate type method?
17:11:39jkenDocs say add can result in duplicate keys
17:11:51zedeusjust use `[]`
17:12:01zedeus`table["key"] = value` will "add or update"
17:12:10jkenoh, duh,
17:12:15jkenthanks zedeus
17:15:40Zevvadeohluwa: please do!
17:16:03Zevvnote that #90 is actively under development by disruptek
17:16:06Araqbtw I'll be offline tomorrow until Tuesday
17:16:23Zevvbusiness or pleasure?
17:16:38Zevvif the latter, happy holidays!
17:16:58Araqpleasure :-)
17:17:02Araqthanks
17:17:35disrupteki just pushed a google api update last night.
17:22:25Araqnice, does that imply GCE support?
17:22:53disruptekall 172 apis/versions, yes.
17:23:00Araq:O
17:23:06AraqLookupError: unknown encoding: cp65001
17:23:21Araq^ Python is good at Unicode, always remember :P
17:25:20*adeohluwa joined #nim
17:30:40*adeohluwa quit (Remote host closed the connection)
17:42:30*skoude joined #nim
17:45:00*adeohluwa joined #nim
17:46:55*skoude quit (Ping timeout: 250 seconds)
17:48:31FromGitter<Kiloneie> What a day, no internet... -, -
18:02:21*crem quit (Ping timeout: 246 seconds)
18:02:52FromDiscord<juan_carlos> Can I explicitly convert a `tuple` into `varargs`?.
18:04:26FromDiscord<juan_carlos> Like I have a `proc` that expect `varargs` and I have a `tuple`, if I pass the `tuple` it fails.
18:06:26*adeohluwa quit (Ping timeout: 240 seconds)
18:24:15*rockcavera quit (Remote host closed the connection)
18:28:41Araqusually you should have used array[N, T] to begin with and not a tuple
18:29:00*sagax quit (Remote host closed the connection)
18:31:04FromDiscord<juan_carlos> Mixed types.
18:31:33Araqthen you cannot convert it to 'varargs' at all (unless it's a macro)
18:31:52FromDiscord<juan_carlos> Ok
18:32:03Araqwe could have macros.unpackTuple
18:32:14Araqbut we don't... :-(
18:33:02FromDiscord<juan_carlos> No drama lama
18:39:17*xace joined #nim
18:42:56*sagax joined #nim
18:55:58*r3c joined #nim
18:56:06*ng0 quit (Quit: Alexa, when is the end of world?)
18:58:13*dddddd quit (Ping timeout: 268 seconds)
18:59:25*dddddd joined #nim
19:29:36*couven92 joined #nim
19:43:52*rockcavera joined #nim
19:45:06*PMunch joined #nim
19:48:02PMunchAraq, you on vacation already?
19:49:51*doesntgolf joined #nim
19:50:45PMunchAnd Zevv and shashlick, about the playground. The packages are from important_packages file, it was just to have a selection really :P And to add a new one simply make a PR to the list :)
19:58:01FromDiscord<juan_carlos> So `$toStrLit` is like the reverse of `newLit`, interestin' 😅
20:04:09PMunchjuan_carlos, did you see that I added nimpy to the playground? :)
20:06:22FromDiscord<juan_carlos> Ye, I 💚 on the Bug.
20:06:52shashlick@PMunch - ya need to add nimterop to the important packages
20:07:02shashlick@narimiran tried a while ago and ran into issues
20:07:14PMunchshashlick, you need to add it :) Just add a PR
20:07:28shashlickconcern is that nimterop uses gorge a lot, not sure if you block that
20:10:01PMunchNope
20:10:16PMunchIt runs in a container and is allowed to do pretty much what it wants :)
20:10:26PMunchWhat is it gorging?
20:10:27shashlickwell then it is party time
20:10:59shashlickit can run configure/cmake/make, followed by toast/c2nim to convert h => nim
20:11:21shashlickanything you'd do manually for wrappers, nimterop aims to automate
20:12:08PMunchAh..
20:12:18PMunchSo it's running on a super minimal alpine base
20:12:29PMunchSo it doesn't have make IIRC
20:12:33PMunchOr c2nim
20:12:42PMunchOr cmake
20:13:02PMunchPossible not toast either, not sure what that is
20:13:08shashlickthose are optional
20:13:30shashlicktoast is the binary in nimterop that does the wrapping, similar to c2nim but uses tree-sitter to do the C => AST
20:13:49shashlickbut ya, might be a long shot to run the full wrapper process on each run
20:14:16PMunchYeah you're pretty limited on time and CPU speed..
20:14:21PMunchSo it might just time out every time
20:14:41PMunchYou could try though..
20:14:54PMunchBuilding the docker image is easy
20:15:03shashlickdo you clean up everything after each call
20:15:19PMunchYup, the container is purged
20:15:38shashlickso if i run a script, edit a line and run again, it is a new container?
20:15:45PMunchYes
20:16:00shashlickok seems quite heavy but probably necessary
20:16:23PMunchI mean the image is always the same
20:17:17PMunchIt maps a folder in /tmp into the container, then it starts a container from the image and runs the code. When the container is completed or times out it is deleted and the logs are read from the directory
20:17:22PMunchThen that directory is deleted
20:18:24shashlickcool
20:18:49shashlicki guess nimterop is pointless unless we install some ready wrappers
20:21:48PMunchYeah I'm not sure what you'd use it for :P
20:24:25PMunchnimterop failed to install: gcc: error trying to exec 'cc1plus': execvp: No such file or directory
20:24:38PMunchProbably the minimal alpine container missing something
20:28:39r3cHi, any suggestions how to start new backend from the existing JS backend?
20:28:56r3cHow do you debug the compiler?
20:29:16*madpata quit (Quit: Lost terminal)
20:29:23*rayman22201 joined #nim
20:31:07rayman22201@narimiran or any nim CI people around? I'm not sure where to go with my PR here: https://github.com/nim-lang/Nim/pull/12371
20:32:03shashlick@PMunch - not sure about that
20:32:18shashlickseems like g++ is not installed
20:32:50*PMunch quit (Remote host closed the connection)
20:33:12*PMunch joined #nim
20:33:15shashlick@rayman22201 - do you think it is a ulimit issue?
20:34:28rayman22201not any more. I lowered the number of FD's significantly in my last commit.
20:34:53rayman22201It was a ulimit issue for Azure, as soon as I lowered it, Azure passes.
20:35:39*narimiran quit (Ping timeout: 268 seconds)
20:35:45rayman22201As soon as Azure passed, AppVeyor failed.
20:37:06rayman22201Can I convince somebody with the appropriate powers to force another CI run? just to see if I'm crazy, the test is flakey, or the CI environment is flakey...
20:37:33Araqr3c, https://nim-lang.org/docs/intern.html#debugging-the-compiler
20:39:49ZevvPMunch: how does the playground keep packages up to date?
20:40:24r3cAraq thats it
20:40:53PMunchZevv, it doesn't
20:41:06Zevvok :)
20:41:07PMunchOr rather I'd have to manually do it
20:41:29PMunchBut it will update all the packages when Nim gets a new tag
20:43:21shashlick@rayman22201 - I don't have appveyor access
20:44:08rayman22201maybe @Araq does? poke? :-P
20:48:10Araqnever found the button to do that, for appveyor you need to close&reopen the PR which I just did
20:48:46rayman22201Awful UI.... Thanks @Araq
20:48:48*r3c quit (Remote host closed the connection)
20:49:08shashlickthere is a rebuild commit button for jobs or a specific job
20:49:26*nsf quit (Quit: WeeChat 2.5)
20:50:54PMunchOh Araq, thoughts on exposing the comments field in Nim nodes?
20:51:47PMunchI could probably implement it, but I don't want to spend the time if it's never going to get accepted
20:53:07Araqdunno
20:53:26AraqIMO all of macros.nim needs to be replaced with ir.nim
20:53:59Araqbut ir.nim is not even in the prototyping stage, it's only an idea in my head
20:55:06PMunchHaha, so in the meantime, could I expose the comment field of the NimNodes?
20:56:09Araqyeah, ok
20:56:19AraqI'll tell you about the restrictions in your PR
21:00:08PMunchRestrictions?
21:00:36Araqyeah, it shall only be valid for nkIdentDefs and maybe nkEnumDef
21:00:46PMunchWhy?
21:01:12Araqto ensure it's future proof
21:01:29PMunchYou can throw doc comments in anywhere, and if they are being stored anyways, why not make them accesible?
21:02:07Araqbecause it sucks
21:02:29Araqwe still want to be able to change this design of Nim's AST
21:02:31PMunchWell then it's worthless to me..
21:02:38Araqhow so?
21:02:43PMunchEssentially what I wanted to do was this https://github.com/pmunch/explanations
21:03:00PMunchBut without the expl(0, "docstring here that's actually a string")
21:03:21PMunchAnd instead just do `return 0 ## Explanation for why we return 0`
21:04:00PMunchIt's part of my idea for creating documentation for routes in a web-framework
21:04:19Araqlooks like it
21:04:40AraqI like your expl(0, "...")
21:04:58PMunchWell, I don't really..
21:05:14PMunchIt feels a bit forced, and the string looks like it belongs in the code, which it really doesn't
21:05:17Araqnothing wrong with it IMO. I dislike reading code where I cannot even touch comments without knowing it won't change anything
21:05:36PMunchWell it's a doc comment, that is being put into documentation
21:05:56PMunchIt's not any different from the documentation comments we have today
21:06:20Araqreturn 0 ## there is no doc comment here really
21:06:24*solitudesf quit (Ping timeout: 265 seconds)
21:06:35Araqand ideally Nim wouldn't allow it
21:06:44Araqdoc comments are not in random places
21:07:03PMunchNo, they are at the point where we would return something
21:07:18PMunchSo that you remember to update them when you change the behaviour
21:07:29PMunchThe alternative is to do something like this: https://play.nim-lang.org/#ix=1YeA
21:07:35PMunchBut I'd really rather not..
21:07:55PMunchIt's brittle, and just typing that snippet out made me feel filthy
21:08:39Araqit's late and I don't really undertand your 'expl'
21:09:01PMunch(By the way, if it isn't immediately obvious, that code reads the original source file and tries to manually extract the doc-comment)
21:09:09Araqas I wrote elsewhere, we should strive for verification, not for anything less
21:09:37PMunchWell expl is just rewritten to return the value, and the string there is put in a table in the documentation that's generated by nim doc
21:10:28PMunchThe whole point of it is to allow the documentation to be local to what it is describing
21:10:56PMunchSo that people don't forget to update it when they change something
21:11:16disrupteki think doc comments are super useful, particularly in generated code. i want to be able to have macros document creepy activities that might not be obvious.
21:11:45disruptekbecause they are zero-cost, i want to use them as a form of logging, too.
21:12:21PMunchA form of logging?
21:12:32PMunchYou can just have static: echo "something" you know?
21:12:51disrupteklogging of the code that is output, not runtime logging.
21:12:51PMunchTo print something out at compile-time
21:13:37disrupteklike, ## foo macro put this here because xyz and bifnab hasn't run yet
21:13:53PMunchAraq, my point is really that if the comments are already in the NimNodes just wasting space, at least let me use them
21:14:39PMunchOooh, so you just want to leave comments for the readers of expandMacro?
21:14:51PMunchYeah I can see how that would be useful
21:15:02AraqPMunch, and my point is that we will get rid of the waste
21:15:03PMunchBut I don't think doc-comment is the right thing for that..
21:15:10Araqbut if we expose them we cannot get rid of it
21:15:35PMunchHmm, I see, so the plan is to just get rid of them.. Guess I'll have to find another way of doing it then..
21:15:37Araq8 bytes for every PNode does add up and people enjoy a Nim compiler that takes less RAM
21:16:00disruptekopenapi generates many megabytes of code. amazon, google, azure are each over a million lines of nim. i want to shrink that and i also want to make the apis much more powerful. the whole point to writing the code out is that i want people to be able to make use of it. so, i want to be able to document it.
21:16:15PMunchI guess I'll just read any doc-comment that is immediately before a return statement then
21:16:24PMunchOr something like that
21:16:56PMunchOh well, time for bed
21:16:57*PMunch quit (Remote host closed the connection)
21:17:59Araqindeed
21:18:04disruptekazure is over 3 million lines of nim, actually.
21:18:44*couven92 quit (Read error: Connection reset by peer)
21:19:12*couven92 joined #nim
21:19:53Zevvwut
21:20:03*ljoonal quit (Ping timeout: 240 seconds)
21:20:39Zevv3M lines, how does the compiler chew that?
21:21:11disrupteki dunno; i haven't tried importing it all. it's almost 1800 imports.
21:21:30Zevvhaha
21:21:36disrupteki did do amazon's. that was about 1.2 million lines in 160 seconds.
21:22:02*ljoonal joined #nim
21:22:32Zevvpff. there should be some nice trick where you only generate this things when the are actually invoked somewhere
21:22:59disruptekyou can use openapi that way, but it's not as useful.
21:23:11rayman22201That is a pretty impressive benchmark actually. I wonder how much RAM it chewed up in the process? something to add to Golden maybe?
21:23:22disruptekit was about 2gig.
21:23:53disruptekjust building the ec2 api is ~30s. it's one of the benchmarks i test golden on.
21:24:12rayman22201makes sense. Seems like a good one to use.
21:25:32disruptekthe tables-in-vm-are-slow fix that zevv prompted sped it up from 108s to 30s or so.
21:25:45Zevvyw :)
21:25:50disruptek┌────────┬───────────┬───────────┬───────────┬──────────┐
21:25:53disruptek│ Runs │ Min │ Max │ Mean │ StdDev │
21:25:55disruptek├────────┼───────────┼───────────┼───────────┼──────────┤
21:25:58disruptek│ 2 │ 28.218435 │ 28.407528 │ 28.312981 │ 0.094547 │
21:26:01disruptek└────────┴───────────┴───────────┴───────────┴──────────┘
21:26:04disruptekyes, i flooded you, i'm not sorry.
21:26:18ZevvIt's after 11, no problem
21:26:25zedeusat least it looks pretty
21:30:26disruptekwe should be able to impl a macro in golden that is able to choose the fastest code (which also compiles) on the given machine and then insert it.
21:31:19*Vladar quit (Remote host closed the connection)
21:31:22disruptekthe output from the monster api list dropped by 5mb to 27mb, but it still doesn't run because... too many global variables. 🤪
21:35:39*doesntgolf quit (Ping timeout: 240 seconds)
21:39:02*skoude joined #nim
21:44:06*skoude quit (Ping timeout: 268 seconds)
22:05:11shashlick@disruptek - docs are up for nimgit2
22:05:15shashlickhttps://github.com/genotrance/nimgit2
22:05:20*couven92 quit (Quit: Client Disconnecting)
22:06:06disrupteksweet, but i need a tag and stuff so i can point my nimble at it.
22:06:21shashlick5 seconds
22:06:32disruptekwho has that kinda time?
22:08:13disruptekyou know it's not in nimble's tree, right?
22:08:25*couven92 joined #nim
22:09:24shashlickjust tagged and published
22:09:28shashlickwhew!
22:10:05*traviss quit (Quit: Leaving)
22:10:13disruptekyay, now we're in business. 😁
22:10:35shashlickmodule docs as well - https://genotrance.github.io/nimgit2/theindex.html
22:27:34*Trustable quit (Remote host closed the connection)
22:30:19rayman22201Now my PR is failing on Azure again... WTF...
22:30:23*shomodj joined #nim
22:30:42rayman22201I ran the same test on a loop on my Windows box, passes 100% of the time
22:31:56rayman22201any ideas on how to debug this? I can commit a bunch of print statements and spam the CI... but I feel like there has to be a better way.
22:32:01*shomodj quit (Client Quit)
22:32:32shashlickrayman22201 - you might want to setup your own account and debug that way
22:32:41shashlickso that you aren't gated by nim's queue
22:32:57shashlickcan also turn off all other tests and see if your test fails in isolation or when it is part of a whole
22:33:45rayman22201:/ yay. Setting up an Azure account and integration... High on my list of fun chores lol
22:33:59shashlickappveyor also has a self-hosted setup that you could use to debug locally
22:34:01shashlickhttps://www.appveyor.com/self-hosted/
22:34:07shashlicki appreciate your agony 100%
22:35:03rayman22201lol. thanks
22:37:14shashlickany local instance might not recreate the remote CI setup
22:37:24shashlicki've had good success with travis' docker setup on linux
22:37:37shashlickbut on win/osx, if i cannot recreate locally, all bets are off
22:38:24rayman22201unfortunately it's a windows failure
22:40:29rayman22201I'm a few more things locally first.
22:40:34rayman22201*Trying
22:42:06*krux02 quit (Remote host closed the connection)
22:43:06shashlickhttps://www.appveyor.com/docs/how-to/rdp-to-build-worker/
22:46:13*couven92 quit (Quit: Client Disconnecting)
22:46:30rayman22201If I had access, I would definitely do that :-P
22:46:52shashlickthat's why i'm saying setup your own instance
22:47:02shashlickall you have to do is go to appveyor and enable your fork
22:47:02rayman22201I'm trying to decide if it would be easier to setup appveyor or azure
22:47:23*shomodj joined #nim
22:47:25rayman22201both have shown the bug
22:48:06shashlickthere's really nothing to setup
22:48:11shashlickthe yml already exists
22:48:17shashlickyou just log in with your github account
22:48:26shashlickit will list your repos, just enable nim
22:48:35rayman22201I guess that's true
22:50:30shashlickazure might be easier but i've never used it
22:51:15shashlickThe gui is really cool tho
22:57:56rayman22201I got appveyor running, we'll see what happens. Azure definitely has a slick UI. I might try it as well.
23:08:09shashlickneat
23:20:11*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:20:54*shomodj joined #nim
23:30:52*vesper11 quit (Ping timeout: 252 seconds)
23:31:10*vesper11 joined #nim
23:34:37shashlicknimarchive also been bumped up to v0.3.0
23:40:30*stefantalpalaru quit (Quit: stefantalpalaru)
23:41:52shashlickand nimterop v0.2.0
23:48:26rayman22201my personal AppVeyor build passed 🤣
23:48:42rayman22201but I think I have a theory.
23:51:20*Jesin quit (Quit: Leaving)
23:59:31*Jesin joined #nim