<< 16-01-2021 >>

00:05:56*wontruefree[m] quit (*.net *.split)
00:06:32*wontruefree[m] joined #nim
00:16:42*xet7 joined #nim
00:25:59leorizedisruptek: also, can I have testes test for defects?
00:27:12leorizeI'm writing some behavioral verification tests and I would like to test if Defect is raised
00:38:56*wasted_youth quit (Read error: Connection reset by peer)
00:39:27*wasted_youth joined #nim
00:50:11Zoom[m]How about distatesful for a name? Fits perfectly
00:50:45Zoom[m]Do we have any currently maintained Postresql driver?
00:51:38Zoom[m]*distasteful
00:53:31Zoom[m]Wait, leorize do you redoing stdlib io for async or just redoing it? I'm out of the loop
00:54:00Zoom[m]*are you (sorry)
00:54:37leorizeI'm rewriting all of it
00:56:12Zoom[m]Cool. I'm currently trying to wet my feet with io and started with getTempDir, want to support transient (unlinked) tempfiles
00:56:55leorizebeware of windows
00:57:28Zoom[m]It has remove on exit option for files, but I'm not sure if it supports invisible files yet
00:57:51leorizeyes, on windows 10
00:57:59leorizebut it's a microsoft product, so I won't count on it
00:58:38leorizeyou have to open the file with FILE_SHARE_DELETE then you may delete it
00:59:21Zoom[m]Sorry, need to go, will get back to you later.
00:59:48leorizeo/
01:18:50*wasted_youth quit (Quit: Leaving)
01:20:36FromDiscord<that_dude> what is \c? I'm trying some things out and it keeps showing up. When I look it up I only get things about escape characters in the C and it wasn't there. https://media.discordapp.net/attachments/371759389889003532/799810298445037578/unknown.png
01:20:57FromDiscord<that_dude> https://media.discordapp.net/attachments/371759389889003532/799810388341555210/unknown.png
01:21:23FromDiscord<that_dude> Thanks in advance
01:22:10*adnan338 quit (Ping timeout: 256 seconds)
01:23:20leorize`\c` is CR in CR-LF
01:23:38Prestigethought that was /r
01:23:49leorizeit's `\c` in nim
01:23:52Prestigeah
01:24:00leorizewe support both actually :P
01:24:08leorize!eval echo '\c' == '\r'
01:24:12NimBottrue
01:40:06*adnan338 joined #nim
01:40:11*adnan338 quit (Client Quit)
01:40:25*adnan338 joined #nim
02:01:14FromDiscord<that_dude> ah I see, thanks
02:30:09leorizedisruptek: you renamed testes? it broke my ci :P
02:32:33FromDiscord<ElegantBeef> Leorize now has to find where disruptek relocated testes
02:36:51*^Q-Master^ joined #nim
02:37:17*Q-Master quit (Read error: Connection reset by peer)
02:42:13*adnan338 quit (Ping timeout: 264 seconds)
02:47:05*shirty quit (Quit: Going offline, see ya! (www.adiirc.com))
03:00:25disruptekleorize: i figured i could fix it before you noticed.
03:00:45*etothpiiminus1 joined #nim
03:00:47FromDiscord<iWonderAboutTuatara> !repo testes
03:00:49disbothttps://github.com/disruptek/balls -- 9balls: 11the unittest framework with balls πŸ”΄πŸŸ‘πŸŸ’ 15 25⭐ 1🍴 7& 29 more...
03:01:00FromDiscord<iWonderAboutTuatara> Nice
03:01:35disruptekbelieve me, it will break something like 30 CIs of mine.
03:03:13disruptekwhat did you do to clamp the version? you should always clamp to majors unless you are a nimbleton.
03:03:34leorizeI forgot that nimble is dumb dumb and didn't clamp it
03:03:42leorizefix that now though
03:03:46disruptekokay.
03:04:04disrupteki took the opportunity to make suite: the entry macro, but i guess you know that now.
03:06:25*etothpiiminus1 quit (Ping timeout: 240 seconds)
03:07:12leorizedisruptek: look at this stupid hack I devised to test Defect: https://github.com/alaviss/nim-sys/blob/master/tests/helpers/utils.nim#L14
03:09:00leorizetips for anyone using destructors: use arc or it won't work: https://github.com/alaviss/nim-sys/runs/1712416416?check_suite_focus=true#step:7:469
03:09:15leorizenow I have to go figure out what caused this
03:09:58disruptekthat word is `caught`, btw.
03:10:13leorize:P
03:10:24disruptekthat's cool though; why don't you put it in my balls?
03:10:25*lritter quit (Ping timeout: 264 seconds)
03:10:38leorizelaziness, really
03:10:44disruptekfair enough.
03:10:57leorizewas testing locally so just hacked something together fast
03:11:04disruptekokay, so there's a testes repo now. i will make sure it works and then archive it.
03:11:08*lritter joined #nim
03:12:21leorizeand now refc doesn't want my destructors
03:12:35leorizeand I thought destructors are supposed to be the stable by now...
03:12:49disruptekwell, that's silly.
03:13:13disruptekbut if you want concepts to work, i told araq i would test them.
03:13:39leorizeI'm pretty much doing the testing work for destructors here
03:14:46disruptekall the more reason.
03:17:35disruptekleorize: for synch operation, you don't need to use cps. you can, though; just don't offer a cpsMagic primitive for the operation, or write one but don't make it enqueue in the dispatcher, or make it enqueue but don't let the dispatcher reschedule it, or let the dispatcher schedule it but don't let it be prempted, or...
03:18:17*muffindrake quit (Ping timeout: 260 seconds)
03:19:48*muffindrake joined #nim
03:28:07*wasted_youth joined #nim
03:29:29*wasted_youth quit (Client Quit)
03:38:40FromDiscord<Avatarfighter> disruptek: congrats on balls
03:38:48FromDiscord<Avatarfighter> its a pretty huge library
03:39:43*adnan338 joined #nim
03:40:21*rockcavera quit (Remote host closed the connection)
03:40:25FromDiscord<Avatarfighter> disruptek: cps good btw I got my scraper working on it
03:40:30FromDiscord<Avatarfighter> sort of
03:40:50FromDiscord<Avatarfighter> ive got the POC working without http library atm
03:44:56*adnan338 quit (Read error: Connection reset by peer)
03:47:34disruptekavatarfighter: you like my balls?
03:47:39disruptekpretty suite, right?
03:47:55disruptekif you have something working with cps, you're the first.
03:52:57*lritter quit (Quit: Leaving)
03:53:01FromDiscord<Avatarfighter> well
03:53:14FromDiscord<Avatarfighter> working is a stretch, nimsuggest either stopped giving error or plain stopped working
03:53:23FromDiscord<Avatarfighter> either or I call it a success
03:53:44disruptekeh welcome to the elite.
03:53:53disruptekthe few,
03:53:53disruptekthe proud,
03:53:53disruptekthe completely lacking in syntax highlighting.
03:53:54FromDiscord<Avatarfighter> disruptek: I love your balls, its so life changing
03:54:09FromDiscord<Avatarfighter> the lack of highlighting is really sad
03:54:12FromDiscord<Avatarfighter> i feel naked
03:54:38FromGitter<gogolxdong> GUI crashes frequently with orc, while stand still with arc
03:56:21disruptekif you have something that compiles and runs with cps, well, that's something.
03:59:15disruptekcan you show some code?
03:59:23disruptektransforms, i mean.
03:59:39disrupteki don't think we have any typed stuff in the wild yet.
04:07:50FromDiscord<Avatarfighter> disruptek: my code?
04:07:54FromDiscord<Avatarfighter> im not even sure it works
04:08:01FromDiscord<Avatarfighter> i haven't actually hit compile lol
04:08:12FromDiscord<Avatarfighter> the errors just stopped so i assume i did something correct
04:08:13disruptekpffbt
04:08:21disruptekprobably nimsuggest crashed.
04:08:36FromDiscord<Avatarfighter> im not even joking when I say I assume I have something working based on the lack of nimsuggest complaints lmaooo
04:10:30disruptekwell, the race is on between you and leorize to make a thing work in real typed cps.
04:11:17disrupteknigel doesn't work due to concepts, as per usual, so i am out of the running. i can't remember if zevv's server works but i doubt it does.
04:11:36FromDiscord<Avatarfighter> lmao
04:11:45FromDiscord<Avatarfighter> i have suspicions leorize will win
04:12:01disrupteki can see his code, so that helps.
04:12:04FromDiscord<Avatarfighter> though I have learned a lot about cps and how to use your library in theory I haven't had success in practice
04:12:05FromDiscord<Avatarfighter> yeah
04:12:07FromDiscord<Avatarfighter> true
04:12:10FromDiscord<Avatarfighter> no need to rub it in
04:12:43disruptek/home/adavidoff/git/balls/balls.nim(328, 19) Error: node has no type
04:12:51disruptekthis is my current problem. buggy balls.
04:13:10disruptektyped macros ftw.
04:13:16FromDiscord<Avatarfighter> why are your balls so buggy
04:13:20FromDiscord<Avatarfighter> get some bug spray
04:17:52disruptekit's because some symbols don't have types. 😒
04:18:32*spiderstew_ joined #nim
04:20:10*spiderstew quit (Ping timeout: 246 seconds)
04:37:28FromDiscord<Avatarfighter> crying
04:47:44*abm quit (Read error: Connection reset by peer)
05:04:48leorizefiled #16732, then remove {.inline.} thinking that would fix it
05:04:54disbothttps://github.com/nim-lang/Nim/issues/16732 -- 3{.inline.} destructors don't compile under --gc:refc ; snippet at 12https://play.nim-lang.org/#ix=2Mak
05:05:06leorizeit compiles, but I can't get the destructor to trigger
05:05:11disruptekError: /home/runner/work/gittyup/gittyup/nim/lib/pure/os.nim(1363, 12) Error: cannot 'importc' variable at compile time; getcwd
05:05:31disruptekthis is what i'm on right now. refc, 1.4 (only).
05:05:35leorizedid a `while true: GC_fullCollect()` and it still don't trigger
05:05:58disruptekdoes it work in a block?
05:06:22leorizeit doesn't, the test originally was in nim-sys
05:06:29disruptekhmm.
05:06:40leorizeadded a block and nothing happens
05:06:49disruptekit's only the .inline. that breaks it?
05:06:54leorizebut I doubt this simple as hell code is not tested
05:07:53leorizedisruptek: inline makes it not compile, not having it makes it, uh, do nothing?
05:08:08disruptekmaybe it's a simple case of sigmatch error.
05:08:08leorizemaybe I gotta check the C code
05:08:22disrupteksigmatch is hairy, as we know.
05:08:52leorizemaybe, gotta check the C code
05:09:01leorizethis is what I'm testing if you wanna look at it: https://play.nim-lang.org/#ix=2Mal
05:09:11disruptek~bentley
05:09:11disbotbentley: 11https://imgur.com/gallery/yEXiWWG -- disruptek
05:09:11disbotbentley: 11a good boy
05:10:34leorizeC code shows that it is assigned as a finalizer
05:10:46leorizebut who knows how to get the finalizer to even trigger...
05:14:40FromDiscord<ElegantBeef> Any dog that has to put up with dist is a god in my books
05:14:53FromDiscord<ElegantBeef> (edit) "dist" => "dis"
05:14:55disruptektrue, true.
05:37:43*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
05:37:51*njoseph joined #nim
05:41:25leorizeI'm finding it hard to figure out a File API for use with CPS
05:41:41disruptekneat, what's the problem?
05:42:22leorizeyou need to `open()` file in non-blocking mode if you want async operations to be async
05:42:43leorize(or you use a thread pool to run operations, but that's the story for another time)
05:43:51leorizeso now if an user take a File and run them with CPS, async or not depends on whether that file was opened in async mode
05:44:13disruptekyou store that in the File?
05:45:08leorizeofc I can store it, but what I have to think of would be the user expectation
05:46:11*muffindrake quit (Quit: muffindrake)
05:46:18disruptekwell, to me, that's data.
05:46:33leorizewould they expect operations done via cps to be "magically" async?
05:46:52leorizeand forgot that they need to replace their `open` with `openAsync` for example?
05:47:06disruptekwell, that's the goal.
05:47:17disruptekwe're trying to get rid of color.
05:48:11leorizethe file still has to be opened in async mode
05:48:57disruptekyes, but it can be of an async type if so.
05:49:04*vicfred quit (Remote host closed the connection)
05:49:22*vicfred joined #nim
05:50:36*vicfred quit (Remote host closed the connection)
05:51:07disruptekyou feel me?
05:51:43leorizeyou mean I keep AsyncFile?
05:53:35disruptekcan't it just be a distinct File?
05:55:11leorizeit already is
05:56:31disruptekso open can do different things based upon its input, right?
05:58:34leorizeyes
05:58:48disruptekokay, what i am missing?
06:04:28leorizewhether I should remove AsyncFile
06:05:03disruptekwell, i've done this the other way, and i don't recommend it.
06:05:19disrupteki mean, statics+generics are two legs of hell's pentagram.
06:05:38disruptekor however many fucking sides it has these days.
06:06:06leorizeso if I remove AsyncFile, then to have operations done async, the user would have to use openAsync() or open(ffAsync)
06:06:30disruptekmaybe you should build it as openAsync and we can always change it once we have a pattern we can support.
06:09:23leorizesure, nim-sys is an experimental ground after all
06:11:25disruptekeach .cps. proc is really two procs. so there's already an easy way to colorize the calls. but, we haven't done this yet, so you'd have to do it yourself if you wanted to do it up-front.
06:12:54disruptek< leorize> so if I remove AsyncFile
06:12:59disruptekno, i wouldn't remove it, either.
06:13:26*MyMind quit (Ping timeout: 256 seconds)
06:14:22leorizeI gotta write a dispatcher first
06:14:46leorizea good thing with cps is that I don't need a general purpose dispatcher/selector like the one in the stdlib
06:14:55disruptekright.
06:15:09disruptekit will just have what you need and nothing else. easy to reason about.
06:15:42disruptekyou'll probably do your exception handling in there, for practically all exceptions.
06:15:58disruptekand that's about it. 😁
06:16:53leorizecan I mix-match continuation types?
06:17:04*waleee-cl quit (Quit: Connection closed for inactivity)
06:17:06leorizeI still don't understand how they work with the macro yet :P
06:17:40disruptekthey will all be the same type currently because mratsim doesn't want to merge his type eraser.
06:17:51disruptekbut that's not really a limitation.
06:18:43leorizesince its ref object I believe I can just add more fields via inheritance
06:18:47disrupteklike, Cont from eventqueue is a good demo -- it doesn't hold anything but fn in the normal case.
06:18:54disruptekyes, you can.
06:19:09leorizeI'm just thinking whether I should support cancellation
06:19:19disrupteklol there's no cancellation.
06:19:26leorizewhich would probably be implemented as a semaphore passed by the user
06:19:36disruptekyou just don't run your continuation and, poof, it's cancelled.
06:19:50leorizethen when they signal it I would just stop the next iteration
06:20:14leorizeI need to do some clean up too
06:20:20disruptekif you want to remove it from a queue or something, `proc cancel()` can do that.
06:20:37disruptekit doesn't need any cps-specific code.
06:20:59leorizeI can't just "abandon" the continuation, that is
06:21:22disruptekyou just remove it from memory.
06:21:47leorizeno I mean I have to run clean up code :P
06:21:53disruptekright.
06:22:52disruptekwhy do you need a semaphore? because you want tokens?
06:22:53FromDiscord<reilly> Hey, how do I do that `except as` thing? Either nimsaem.nimvscode is wrong or my intuition is.
06:23:25disruptektry: ... except Exception as e: echo e.msg
06:23:50disruptekwhat is saem doing, that chucklehead?
06:24:27leorizedisruptek: I need a way to signal my continuation to just stop the waiting and clean up the mess
06:24:47saemdisruptek: ruining things!
06:24:53leorizecould be useful for when I decide to offload async disk i/o to a thread pool
06:25:00FromDiscord<reilly> I assumed I could just `except as e` and Nim would intuit that I want to catch any exception that I haven't already caught. Still, this makes enough sense.
06:25:03saemugh, discord, no auto complete.
06:25:18leorizesaem: depends on your irc client
06:25:44saemleorize: I was using srain, and I can do those render/grep expressions, but currently using irccloud
06:25:56disruptekleorize: whatever you pass to cancel should be enough, right? a file would be enough to find the continuation in the queue and remove it, tear it down, destroy it, whatever... right?
06:26:48leorizeno, because people can do concurrent requests
06:27:10disruptekokay, i will wait for the code.
06:28:14saem@reilly it uses nimsuggest and nim check, so likely the compiler doesn't agree with you more than the extension, but who knows? Can you post some code?
06:29:13saemhmm, I never audited the snippets I wonder if some of those are stale and might be an issue.
06:29:35leorize!eval try: raise newException(CatchableError, "") except as e: echo e.msg
06:29:38NimBotCompile failed: /usercode/in.nim(1, 52) Error: undeclared identifier: 'as'
06:29:45leorize!eval try: raise newException(CatchableError, "") except CatchableError as e: echo e.msg
06:29:45FromDiscord<reilly> No, it's a solved problem. I assumed that Nim would intuit that by `except as e` I really meant `except Exception as e`, but that was throwing an error. I've been told nimsuggest isn't the most reliable thing on the planet, so it never hurts to consider that a point of failure.
06:29:49NimBot<no output>
06:30:12saemCool, that means I don't have to do anything to fix that.
06:30:26saemI suppose I should look at that other nimsuggest bug I've been ignoring.
06:30:29disrupteki love those bugs.
06:31:21saemHmm, I wonder if I can get the nimsuggest issue closing stick.
06:32:09disrupteki wonder how balls works for 1.0, 1.2, 1.5 but not 1.4.
06:32:24saema mystery for the ages
06:32:31disrupteki hope not.
06:32:37saeminscrutable
06:32:50disrupteksurely not.
06:32:56saemto know is to know madness.
06:33:05disruptekis inscrutable like inflammable?
06:33:19disruptekit shares its meaning with its antonym?
06:33:47disrupteki mean, there's no such thing as scrutable. it's inscrutable.
06:34:17saemLike, one can't simply scrute
06:34:26disruptekbelieve me, i've tried.
06:34:57disrupteki don't recommend it, though.
06:35:07disruptekhonestly, i think it might even be illegal in canada.
06:35:16saemnah, we legalized it with weed
06:36:19saemhmm, to try fixing this nimsuggest issue with macros and macrocache or try some easier ones and then come back to this?
06:36:48disruptekmacrocache may get disrupted by ic, so, yes, come back to it.
06:37:32saemCoooooool
06:37:44saemI'll give the other macro issue a whirl
06:38:31saemwho knows it might make CPS every so slightly easier to work on.
06:38:38saemBTW is it done?
06:38:40saemCan I have it?
06:38:45*disruptek cheers.
06:38:45saemhowboutnow
06:38:51disruptekopengl here?
06:38:59saemsigh
06:39:07saemI'm going to put opengl in nimsuggest, then you'll see
06:48:42disruptekit's about time we had a flight sim in nimsuggest.
06:50:17saemok forget this language thing, pivot to a flightsim.
06:50:26saemwe can sell virtual flights with bitcoins
06:50:35saemno one can fly during the pandemic, it'll be all escapist.
06:50:53disrupteki heard M$ is making a killing on their product.
06:50:58disruptekhow hard could it be?
06:50:58saemsrsly
06:51:22saemI mean, M$ is doing it so yeah
06:51:53saembet they need 90% of their staff just to make sure DX drivers don't keep crashing the computer.
06:52:09saemnow that's where opengl is needed.
06:52:40disruptekwe can probably save a few million lines of code right there.
06:52:58disrupteki feel like we're already making money.
06:53:11saembasically bootstrapped at this point.
06:54:58disruptek/home/adavidoff/nims/lib/pure/os.nim(1363, 12) Error: cannot 'importc' variable a
06:55:00disruptekt compile time; getcwd
06:55:39disrupteki think i'm rendering `dirExists ...` from a macro at compile-time, but it's intended to run, y'know, at runtime.
06:57:32disruptekoh, no. it's because i'm converting its path to a relative path. but shouldn't that fail on 1.0, 1.2, 1.5?
06:58:36*muffindrake joined #nim
07:01:12saemENOTENOUGHCONTEXT
07:01:44disruptekjust another buglet to workaround and forget about.
07:04:54FromDiscord<ElegantBeef> Wait did i miss the talk about opengl here?
07:05:17saemactually this time it was there
07:20:47FromDiscord<reilly> Someone please explain to me how `sleepAsync()` is supposed to be used, because it's not doing anything right now.
07:21:24disruptekit returns a future. await it.
07:21:36FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=2MaS
07:22:09FromDiscord<reilly> This is what I'm doing.
07:22:21FromDiscord<Rika> are you calling a properlly?
07:22:27disruptekit's a miracle.
07:22:40FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=2MaT
07:22:51FromDiscord<Rika> or await a() if youre in an async proc also
07:23:18FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=2MaV
07:23:21FromDiscord<reilly> I set it to 5 seconds to make it very, very obvious that it's not doing anything.
07:23:31FromDiscord<Rika> well it will do things since its awaiting
07:23:35FromDiscord<Rika> it will do other things
07:23:43FromDiscord<Rika> but not continue in the messageCreate proc
07:24:06FromDiscord<Rika> when 5 seconds pass it will continue the messageCreate proc
07:24:19FromDiscord<reilly> Well, there's only the messageCreate proc, and it sure is continuing.
07:25:07FromDiscord<Rika> are you sure? did you put an echo in both the start and end of the proc?
07:25:32disruptekrika: reilly said it sure is.
07:25:48FromDiscord<Rika> lmao
07:25:52disruptekdon't you trust reilly?
07:26:44FromDiscord<reilly> I mean, would you rather me send you the whole proc?
07:28:03saemNo more debugging tonight
07:28:15saemBrain is spent
07:28:16disruptekreilly: sorry, bud, we're closed.
07:28:26saemHahaha
07:28:40saemThat was a nonseqiutor
07:29:08disrupteki never do that.
07:30:05disruptekZevv: you have to take over for me with leorize; it's worth it to ensure that avatarfighter doesn't produce the first successful use of cps/typed.
07:45:11saemLoL
07:45:32saemWtf
07:46:19saemWhat did avatarfighter do?
07:46:35ForumUpdaterBotNew thread by Adnan: How to implement a RwLock lock , see https://forum.nim-lang.org/t/7392
08:31:58*letto quit (Ping timeout: 272 seconds)
08:33:14*letto joined #nim
08:37:36*letto quit (Ping timeout: 240 seconds)
08:49:30*Vladar joined #nim
08:52:18*muffindrake quit (Quit: muffindrake)
09:30:01ZevvI tried a few days ago, but the stuff is just to broken
09:32:04*notandinus joined #nim
10:08:40*hnOsmium0001 quit (Quit: Connection closed for inactivity)
10:11:31*wasted_youth joined #nim
10:11:55FromDiscord<no name fits> I've been trying to find tutorials on how to write commands in the nimble file, but I couldn't find anything on the official site, and my search engine shows me some Hewlett stuff called nimble, so if anyone could me point me to, how to set up build commands and such, that'd be awesome πŸ™‚
10:17:49FromDiscord<no name fits> It's just that so far I've only been compiling a single file, so I was wondering how to set it up for bigger projects
10:23:50FromDiscord<haxscramper> Nimble readme has list of built-in tasks like `build/test`, and for custom tasks you just do `task task_name, "Description": <nim code>`
10:24:04FromDiscord<ElegantBeef> @no name fits it's apart of the `nimscript` module https://nim-lang.org/docs/nimscript.html#task.t%2Cuntyped%2Cstring%2Cuntyped
10:25:04FromDiscord<no name fits> Thanks so much guys. I'm sorry for the dumb questions, I'm still really new, but I'm enjoying Nim a lot so far!
10:27:03Oddmongeris it possible to add Β« dark mode Β» on index page of the website , please ?
10:27:17FromDiscord<no name fits> Are there any good projects you can recommend where I can see how they've set it up?
10:34:42FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2Mby
10:34:59FromDiscord<haxscramper> Nothing particularly interesting. Maybe you could look into curated packages
10:36:13FromDiscord<haxscramper> Something like this idk https://github.com/haxscramper/hmisc/blob/master/hmisc.nimble#L19
10:44:54FromDiscord<no name fits> thanks
11:17:09*Vladar quit (Quit: Leaving)
11:26:22*letto joined #nim
11:31:47*notandinus left #nim ("Killed buffer")
11:33:16*screens__ quit (Read error: Connection reset by peer)
11:34:21*screens_ joined #nim
11:58:23Zevvdisruptek: if you're up to it, we can do a few of those sessions again where I use CPS, see it is broken, whine about it, you fix it, and repeat
12:36:10*Torro joined #nim
13:06:34giacoas there's no bytestream object in std, and there's no byteseq to string conversion to use stringstream instead, what's the fastest/right-way to feed a stream of bytes to a proc accepting a "stream" object? I'm looping over byte seq to build a "char" seq currently
13:08:19*hmmm joined #nim
13:18:21giacooh, wait, found large old topic on the subject: https://github.com/nim-lang/Nim/issues/14810
13:18:29disbotβž₯ Add byte-array-to-string conversion to system module ; snippet at 12https://play.nim-lang.org/#ix=2Mcb
13:54:00*rockcavera joined #nim
14:26:37*al1ranger joined #nim
14:28:53Oddmongerrepr is so nice for debug
14:31:14*tane joined #nim
14:45:04*abm joined #nim
14:46:43*leorize quit (Ping timeout: 240 seconds)
14:47:36*leorize joined #nim
14:53:19ForumUpdaterBotNew thread by Alexeypetrushin: Call `result.new` automatically in `proc`?, see https://forum.nim-lang.org/t/7393
15:08:07FromDiscord<juliuskiesian> @mratsim QR decomposition test fails in arraymancer test suite.
15:08:34FromDiscord<juliuskiesian> some of the tensor elements are off by sign.
15:10:52FromDiscord<juliuskiesian> sent a code paste, see https://play.nim-lang.org/#ix=2Mdr
15:12:05*a_b_m joined #nim
15:12:30*rockcavera is now known as Guest65700
15:12:30*Guest65700 quit (Killed (orwell.freenode.net (Nickname regained by services)))
15:12:31*rockcavera joined #nim
15:14:11*clyybber joined #nim
15:15:24*abm quit (Ping timeout: 256 seconds)
15:16:19*al1ranger quit (Quit: Leaving)
15:24:46*hmmm quit (Quit: WeeChat 3.0)
15:26:28*Vladar joined #nim
15:33:25disruptekZevv: i wonder if it's the shim code.
15:34:48ZevvIt's the block in cps.nim:576 adding the spurious return
15:34:51disruptekhmm, it's not.
15:34:51Zevvbut I don't see why
15:35:05Zevvit says n.kind is in returner
15:35:23disruptekthat's how we pop the stack at the end of any control flow.
15:35:49disruptekis stmtlist really a returner?
15:36:18disrupteki feel like it's not.
15:36:30Zevvikr
15:36:34disruptekyeah, taking that out passes your tests.
15:36:40ZevvI know it does
15:36:58disruptekjust remove it and let's see if anyone notices.
15:37:32disruptekbtw, this is the sort of change that we've had to adapt to since switching to typed.
15:37:38disruptekthe ast is just that little bit different.
15:37:46Zevvmy standalone tcp server also was not allowd pushing to master
15:38:05disrupteki know, whatfer making the tests stay green when possible.
15:38:35disruptekyou may have noticed me making prs...
15:39:17*hmmm joined #nim
15:39:27disruptekso i fixed a while test yesterday and the test used to crash the compiler and now it simply passes.
15:39:36disruptekso that's... interesting.
15:40:07hmmmtek arewecpsyet?
15:40:16disrupteknaw dawg.
15:40:21hmmm:|
15:40:42disruptekbut two bigs fixed in two days is πŸ”₯
15:40:47disruptekbugs, too.
15:40:59Zevvdisruptek: anyway, tcp server now kind-of-works
15:41:11disrupteknice, let's put it into tests.
15:41:38Zevvno that's not good
15:41:41disruptekno?
15:41:49Zevvwell, you can test if it compiles, but not if it runs
15:41:55Zevvbecause network stuff
15:41:55disruptekyeah, that's fine.
15:42:19disrupteki lust for a large suite.
15:42:20Zevvbut why can't I push that? it doesn't fail the tests
15:42:43disruptekwhen it passes the checks you can merge it.
15:42:59Zevvbtw I still need cases like `var a: SocketHandle = bind()`, because SocketHandle is a `distinct int` and you can't instantiate that
15:43:03disruptekit's green right now.
15:43:09Zevvyeah merge, but not push to msaster
15:43:19disruptekyes.
15:43:29Zevvah right
15:43:47Zevvdone
15:44:01disruptekso what's the distinct int issue about?
15:44:53ZevvI'll make a test
15:45:21disruptekit sounds like something as simple as s/getType/getTypeImpl/ but who knows.
15:46:20disruptekomg i think that may have fixed /shadow mission impossible/ too.
15:46:20*hmmm quit (Quit: WeeChat 3.0)
15:46:27disruptekyou're a genius, zevv.
15:47:01Zevvalways have been, always will be
15:48:08Zevvsee https://github.com/disruptek/cps/pull/63 for the type problem
15:48:08disbotβž₯ Added test for type problem
15:50:34disruptekwell, push the fix for 60 please.
15:52:43Zevvdrop nnkStmtList} from returner?
15:54:15FromDiscord<Clyybber> Are you checking the node kinds to determine wether it will be an expression or not?
15:55:20disruptekZevv: yeah.
15:56:23disruptekclyybber: what's /it/ in that question?
15:56:35FromDiscord<Clyybber> the node
15:56:49FromDiscord<Clyybber> basically whats a returner?
15:56:57clyybberwhy am I using discord..
15:57:10disrupteka returner leaves a scope and requires that we pop the control-flow stack.
15:57:47clyybberso basically expr vs stmt?
15:59:11clyybberdisruptek ^
15:59:13disruptekreturner = {nnkBlockStmt, nnkElifBranch, nnkElse}
15:59:23Zevvyeah it's testing
15:59:30Zevvbut your tests are soo slooow
15:59:42disruptekthese are blocks that, when we exit, we need to jump.
15:59:52clyybberAh, I see
16:00:12disrupteki should comment this better.
16:00:16clyybberWhy is nnkIf not in there?
16:00:28disruptekbecause if wraps clauses in the ast.
16:00:35disruptekit's like a meta-node.
16:00:42disruptekit never gets processed by safen.
16:01:04clyybberso nnkCase also doesn't belong in there?
16:01:17disrupteka case clause probably does.
16:01:26disruptekwe don't have any tests for it. 😁
16:01:52clyybberWhy would you not jump from an nnkIf though?
16:02:17disruptekbecause we jump from the leaves.
16:02:27clyybberBut the first if branch is one leave
16:02:34clyybber*leaf
16:03:04disruptekno, it's (if (elif, elif, elif))
16:04:10clyybberoh, I get it now I think
16:04:19clyybberwhy is nnkBlock in there then though?
16:04:27disruptekbecause of break.
16:04:46clyybberAnd while loop breaks are handled elsewhere?
16:04:52disruptekyes.
16:05:40disruptekthere are subtleties to while loop breaks that make it simpler to just impl them alongside the loop itself.
16:06:33disruptekwe probably should add a test for case.
16:10:06giacodo you tend to write func instead of proc? How to do defensive programming in nim?
16:10:44disrupteknah, i'm the guy your mother said to defend against.
16:11:16FromDiscord<haxscramper> I try to use `func` when possible
16:11:28FromDiscord<haxscramper> And for defensive programming - just any other language?
16:11:39FromDiscord<haxscramper> There is no built-in design-by-contract or special asserts
16:12:05disruptek!repo contracts
16:12:06disbothttps://github.com/Udiknedormin/NimContracts -- 9NimContracts: 11Nim Language design by contract (DbC) library. 15 40⭐ 3🍴 7& 5 more...
16:12:13FromDiscord<haxscramper> We have experimental `not nil` and `drnim`
16:12:13Zevvreally disruptek. 15 mins and still going
16:12:16Zevvwhy the hell
16:12:45Zevvare you testing sleep(60) 15 times?!
16:12:47disruptekdon't ask me; i don't even work here.
16:13:44giacothanks for the feedback
16:14:38disruptekwe do --forceBuild on ci, which makes it slower.
16:15:12disruptekunfortunately, it is required to ensure that the compiler does not reuse assets. because the compiler is not always correct in that regard.
16:16:59disruptekso i guess it takes a long time because we have more test files now. we could move echo somewhere else.
16:17:10disruptekand tick.
16:17:30disruptekand you could merge ttypes and tzevv at least.
16:18:00Zevvsure
16:21:07*Vladar quit (Remote host closed the connection)
16:25:13giacois there any difference from nim-chronos and asyncdispatch?
16:25:32*hmmm joined #nim
16:25:37disruptekthat's a silly question, but the answer is `yes`.
16:26:11clyybberZevv: 15 minutes to compile?
16:26:29disruptekmy balls are exhausted.
16:26:30giacodisruptek: not if you ignore nim history
16:26:33disruptekexhaustive, rather.
16:26:46disruptekgiao: what does the readme for chronos say about it?
16:26:46Zevvclyybber: testing, 30 minutes
16:27:25clyybberah ok
16:27:37clyybberwas confused because disruptek mentioned --forceBUild
16:27:43giacodisruptek: that the diff list is 22 months old: https://github.com/status-im/nim-chronos/wiki/AsyncDispatch-comparison
16:28:01disruptekyou think they got more similar over time?
16:28:06giacoyeah
16:28:11disruptekinteresting.
16:33:08leorizedisruptek: cps 0.0.14 uses testes < 1.1.0 and your testes is currently 1.1.12
16:33:21disrupteki know.
16:33:55*Vladar joined #nim
16:34:58leorizeam I supposed to grab cps head now?
16:35:44disruptekyes.
16:35:53disruptekwe will cut a new patch.
16:36:28disrupteki mean, it won't change the use of tests<1.1.0.
16:36:35disruptekbut we can ensure you get the fixes.
16:37:06disruptekballs provokes a cps bug.
16:37:59leorizeso I guess I will have to downgrade my balls back to testes when I wanna test my impl?
16:38:22disruptekcps depends on testes, not balls.
16:38:39disruptekso, yes.
16:38:52leorizedisruptek: your testes doesn't have tag
16:39:05disruptekoh, good point.
16:39:15disruptekcps actually uses the noic branch.
16:39:52leorizeyes it does, but criterion also wants a testes
16:40:20disrupteki will fix that.
16:40:26disruptekokay, 1.1.12 and 1.0.1 tags exist now.
16:41:35leorize> Cannot satisfy the dependency on testes 1.1.12 and testes 1.0.1
16:41:46leorizebecause nimble is what it is, I have zero idea where 1.0.1 was pulled
16:42:23*letto quit (Read error: Connection reset by peer)
16:42:30*letto_ joined #nim
16:42:30disruptekuse nimph, of course.
16:43:09leorizenimph wants the compiler
16:43:16leorizeanything that imports the compiler = bad time
16:43:24disruptekdon't be such a baby.
16:43:46leorizeat least for my setup because we still haven't manage to standardize an installation layout
16:43:58leorize(for the compiler)
16:44:09disruptekAraq: you see what havoc my balls have wrought?
16:44:48disruptekleorize: well, get used to it. it's crazy to think that this language won't import from a 60k metaprogramming codebase.
16:44:49leorizeok I solved the issue by removing my nimble dir
16:45:31leorizeremind me to redo package management once I'm done with nim-sys
16:45:40disruptekπŸ‘
16:46:15disrupteki had to uninstall your nim ebuild a couple days ago.
16:46:22disruptekit was confusing my gitnim development.
16:46:36disruptekit was only 1.2, anyway.
16:47:30leorizethe compiler makes a ton of assumptions on locations of its assets
16:48:13leorizeit's terrible but I can't make it better (yet)
16:50:03leorizeI just read up on selectors design and everyone wanna makes windows completion notification works like unix readiness notifications...
16:50:56leorizeit's basically madness
16:51:10leorizegonna be fun when people try to make io_uring work like that
16:52:07*Gustavo6046_ joined #nim
16:52:09disrupteklol that will never happen.
16:52:46disruptekZevv: our tests take a long time because they pass arc and cpp.
16:52:56*Gustavo6046 quit (Ping timeout: 272 seconds)
16:52:57disruptekmost software fails there, so the test runs are shorter.
16:53:18disrupteki got them down to about 15mins tho.
16:54:19*Gustavo6046_ is now known as Gustavo6046
16:55:11*letto_ quit (Quit: Konversation terminated!)
16:55:39*letto joined #nim
16:56:44*leorize quit (Remote host closed the connection)
16:57:12*leorize joined #nim
16:57:27FromGitter<HJarausch_gitlab> How to display all exported names of a package? E.g. in Python, I can say ⏎ `` ⏎ import re ⏎ dir(re) ⏎ `` ... [https://gitter.im/nim-lang/Nim?at=60031af791e9b71badde1c77]
16:59:56disruptek~ninp
16:59:56disbotninp: 11nim is not python!!
17:00:05*clyybber quit (Quit: WeeChat 3.0)
17:00:36FromGitter<Technisha> Heya, quick question: How do i have a websocket constantly on
17:00:44FromGitter<Technisha> I'm making an mc server in Nim-
17:01:10FromDiscord<Rika> thats a big task
17:01:40Zoom[m]leorize (@freenode_leorize:matrix.org): are you still on matrix? which one (there's two accounts in the list here)?
17:02:21leorize[m]this one
17:02:29disruptekleorize: cps 0.0.15 is for you.
17:02:32leorizeI frequently hop into irc because of the sync lag
17:03:32Zoom[m]K, pinged you there already.
17:08:25saemMorning
17:09:07disruptekwhat is up my dude
17:10:15saemToday is the day I start figuring out a tiny bit more about how macros are handled in the compiler.
17:10:22disruptekoh no.
17:11:01saemI need to fix this nimsuggest test and I figure I might end up fixing bugs for you too, so double win?
17:11:31saemIf I time it right I can have avatarfighter use CPS first.
17:11:40FromGitter<haxscramper> @HJarausch_gitlab it is not possible IIRC, at least not without using compiler API
17:11:56FromGitter<haxscramper> Docgen does that in `exported` section, but it uses compiler
17:12:49FromGitter<haxscramper> And in general you can't have access to whole module AST at compile-time, only individual toplevel entries
17:13:29*rockcavera quit (Remote host closed the connection)
17:15:16*letto quit (Ping timeout: 240 seconds)
17:16:23*letto joined #nim
17:17:07disruptekit's possible without using the compiler, but we pretend it's not.
17:17:57leorizeavatarfigher will definitely win, they only has to do it on one platform :P
17:18:16FromDiscord<haxscramper> disruptek: how
17:18:26FromDiscord<haxscramper> Actually, no, don't tell me
17:18:35disruptekthe power is too great.
17:18:44disruptekyou need to be on irc for this.
17:18:48leorizedisruptek: saw it, thanks
17:18:56FromDiscord<Daniel> random question:↡Can nim work in GPU, instead of CPU?
17:19:01disruptekye.
17:19:03disrupteks
17:19:33FromDiscord<haxscramper> disruptek: It's good I'm on discord right now, or otherwise my mind would be corrupted beyond repair
17:19:40disruptekprobably.
17:19:55saemYou get used to it
17:19:58disruptekif you're wondering why you haven't see shashlick around in awhile... well... yeah.
17:20:06disruptek!last shashlick
17:20:06disbotshashlick spoke in 12#nim 3 weeks ago 12https://irclogs.nim-lang.org/22-12-2020.html#18:56:48
17:20:12FromDiscord<haxscramper> I will come to holy IRC land when I think I'm ready
17:20:21disruptekfair enough.
17:20:53disruptekmake sure your sword is sharp and your estate planning is up to date.
17:21:14FromDiscord<Daniel> How do i tell nim to do stuff in GPU instead of in CPU?
17:21:42leorizeyou do it like everyone else, write a gpgpu kernel
17:21:48leorizefor details I will have to ping mratsim
17:21:57FromDiscord<haxscramper> Well, IIRC you need to specifically design around this, it is not like you can move regular code to CPU magically
17:22:02leorizehe worked on this stuff for his arraymancer iirc
17:22:33saemOr just read up on arraymancer
17:25:30FromGitter<HJarausch_gitlab> @haxscramper Thanks though it's bad news.
17:26:26*waleee-cl joined #nim
17:28:08FromGitter<haxscramper> @HJarausch_gitlab what do you need exported symbols for?
17:29:23FromDiscord<Daniel> To me, as a total noob, its fascinating how graphic card actually has parts like whole computer PCB is basically motherboard with its own processing unit, ram, controllers, accelerators(audio)......its lacking long term storage like SSD, but in a sense its mini computer inside a normal computer.....so i am under impression its not even closely used to its potential....just my random thinking
17:29:36FromDiscord<Daniel> (edit) "To me, as a total noob, its fascinating how graphic card actually has parts like whole computer PCB is basically motherboard with its own processing unit, ram, controllers, accelerators(audio)......its lacking long term storage like SSD, but in a sense its mini computer inside a normal computer.....so i am under impression its not even closely used to its potential....just my random thinking ... " added "about technology"
17:30:27FromDiscord<treeform> Wait till you find out that there are more components like that.
17:31:04FromDiscord<Daniel> Yea, but graphics card most computational power, judging by the number of transistors silicon has.
17:31:12FromDiscord<Daniel> (edit) "Yea, but graphics card ... most" added "has"
17:32:05FromDiscord<Daniel> So i am still puzzled why isnt it used more often in computation, like when its needed to 7zip something.
17:32:28leorizebecause you have to move memory into the graphics card in order to perform computation there
17:32:45leorizewhich is very slow
17:33:03FromDiscord<treeform> And is not great at sequential algorithms
17:33:27leorizefor the case of 7zip, your bottleneck lies in disk I/O as well, and you can't do that in GPU efficiently
17:33:55leorizethere was the HSA architecture for making this fast and all
17:34:19leorizebut AMD seems to stopped development on it so it's dead now
17:35:42FromDiscord<Daniel> Oh right, I/O slows it down, i see....didnt think about that, i was assuming PCIE is very fast these days to feed the GPU quickly enough.
17:37:33FromDiscord<treeform> Gpu wins when you need a ton of compute and little IO.
17:37:52FromDiscord<treeform> Opposite of 7zip
17:39:49FromDiscord<VVX7> what's the best way to install nimble deps in a project (that's not a library)? Should I just include a .nimble file and run `nimble install`?
17:39:59Zevvdisruptek: any idea about the type thingy?
17:41:08FromDiscord<haxscramper> You can write `requires` section and do `nimble build` IIRC it will pull all necessary dependencies
17:44:56*Arrrrrrrr joined #nim
17:47:27saemIt's sad about HSA (and HSail?). But some lessons came across. IIUC AMD has a that new fast path for main memory access via the GPU, haven't dug in deep but it's not just for AMD CPU/GPU combos others can use it
17:50:03FromDiscord<Daniel> but if GPU has its own RAM, why does it need main RAM?
17:50:23FromDiscord<Daniel> isnt that just excess traffic moving around?
17:50:28saemIt doesn't. It's about performance.
17:50:46saemMoving data is slow
17:50:55saemBasically the slowest thing
17:54:22*Torro quit (Quit: bye)
18:01:24disruptekGPU is the next frontier for nim.
18:01:58disruptekZevv: i will look at it.
18:02:43saemOk, time to give this macro stuff a poke
18:02:57disruptekleorize: do you still have a requirements clash with criterion 0.2.7?
18:03:18FromDiscord<treeform> Running some algorithm on GPU and CPU, GPU does it 924.65 times faster!
18:03:38leorizedisruptek: it's fine now
18:03:42disruptekyeah, people really have no concept of how much power is in their gaming rig.
18:03:53FromDiscord<treeform> its hard to access
18:04:07disruptekwe will be able to support it.
18:04:26disrupteki mean, we do support it, to an extent.
18:04:36disruptekbut i think we'll be able to compile to GPU directly.
18:04:43*Vladar quit (Remote host closed the connection)
18:04:49FromDiscord<treeform> GPU - a different programming paradigm
18:04:59FromDiscord<treeform> who is the "we" you speak of?
18:05:16disruptekZevv: did you push a branch?
18:05:19Zevvmratsim, mostly :)
18:05:23disrupteki don't see anything typed.
18:05:51*Gustavo6046 quit (Read error: Connection reset by peer)
18:06:14disrupteki got it.
18:06:25*Vladar joined #nim
18:06:56Zevvdisruptek: yeah' typeproblem'
18:07:00Zevvjust rebased and repushed
18:07:28Zevvso cps properly deduces that foo returns a Thing which is a distinct int
18:07:28disruptekrebased it.
18:07:35disrupteklol
18:07:40Zevvbut then of course it tries to create a 'distinct int' in the env
18:07:54disruptekokay, so that should be easy.
18:07:55*Gustavo6046 joined #nim
18:07:56ZevvI tried all getTypeThisses and getTypeThats that I could find
18:08:04disruptekreally?
18:08:05Zevvbut didn't actually try to understand what I was doing
18:08:15Zevvprobably the wrong ones, still
18:08:17disruptekone of them unwraps all abstractions.
18:09:06disruptekgetTypeImpl is what we want.
18:09:14disruptekhttps://nim-lang.org/docs/macros.html#getTypeImpl%2CNimNode
18:09:23disruptekbut you say it doesn't work, and you're pretty smart, so... hmmm.
18:09:42leorizetreeform: my concerns is that loading the gpu up is a slow process
18:10:11leorizeiirc while json can be parsed plenty fast on a gpu, you still won't use it because of the memory access cost
18:10:23disruptekZevv: getTypeInst should give you the Thing that you want to put into the env.
18:10:42FromDiscord<treeform> yes it is, I loose 3ms transferring with read pixels and about 1.5ms transferring with off-screen buffers, for a 0.010ms algorithm its a deal breaker.
18:11:00leorizesimilar to how HPC people loves intel's AVX512 because it allowed them to skip the memory copies
18:11:36Zevvdisruptek: ah right, wrong file
18:13:08Zevvfixed, will merge one day if CI completes
18:13:22disrupteksweet.
18:13:39Zevvsoo, this is almost usable
18:13:44Zevvtime to call in PMunch
18:15:49kinkinkijkini forget, does nim have a fixed point type?
18:15:54disrupteknope.
18:16:00disruptek!repos fixed point
18:16:00disbothttps://github.com/zevv/fixedpoint -- 9fixedpoint: 11Fixed point math library 15 2⭐ 0🍴
18:16:03kinkinkijkinif not, how do i implement integral data types so i
18:16:05kinkinkijkinFUCK
18:16:20kinkinkijkinsomeone already did it, of course
18:16:24ZevvI wouldn't use that if I were you
18:16:33disrupteksome bozo, but at least you can copy their operator syntax.
18:16:50disruptekkinkinkijkin: where have you been? we haven't seen you around lately.
18:17:05Zevvkinkinkijkin: it kind of works, but it was more of an experiment to see if I could make it work with arbitrary length types and fractional sizes
18:17:12Zevvconclusion: yes, it can. now I'm bored.
18:17:44kinkinkijkindisruptek ive been working on things and having things happen to me
18:17:51disruptekZevv: be glad; most people don't emerge from statics+generics "bored"; they come out "dead".
18:18:15Zevvcongratulations to me then
18:18:34Zevvkinkinkijkin: but by all means, I think the underlying ideas are sane, it just needs growing and tests
18:18:46kinkinkijkini want to implement fixed point numbers as a type that can be passed to a fixed point unit
18:19:00*Gustavo6046 quit (Ping timeout: 256 seconds)
18:19:14Zevvif you need only one type of one size, that should be pretty simple.
18:19:16kinkinkijkinlike, implement "standard" fixed point numbers, not arbitrary scientific fixed point numbers
18:19:22Zevvright.
18:19:39Zevvmy lib tries to do funky stuff, like allowing multiplication of a 8.3 with a 16.8
18:19:53kinkinkijkinwell i want to do 8.8, 12.4, 4.12, 16.16, 24.8, 8.24, etc
18:20:09Zevvok, so that's quite a bunch already
18:20:22kinkinkijkinbasically all the fixed point numbers you can actually see in fixed point units on actual devices
18:20:41ZevvI've worked on a 17.8 once
18:20:53kinkinkijkinof most interest is the fixed point numbers available to the GC's variant of PPC
18:21:12kinkinkijkinso 16.16 is top priority
18:21:13Zevvyou could re-use the type, probably: https://github.com/zevv/fixedpoint/blob/master/src/fixedpoint.nim#L5
18:21:41Zevv(16.16 is called 32.16 here, first part is the underlying storage, 2nd part is the fractional size)
18:22:21kinkinkijkinthe hard thing is implementing fast fixed point math for stupid and dumb platforms that don't have built-in fixed point stuff like x86
18:22:43kinkinkijkini mean sure, just use them like integers most of the time
18:23:08Zevvkinkinkijkin: if you want all the fast things, you probably should just bind a proven C lib
18:23:23kinkinkijkinbut that's gonna be a task itself without pulling out ASM or binding C
18:24:21Zevvbinding C is trivial, you can even just ship the C code inside a Nim .nimble
18:24:36Zevvdoing native nim is way cooler of course, but it's a tedious job
18:25:04kinkinkijkinand the intended end result is interop between fixed and floating point numbers, to a degree
18:25:26leorize[m]if you wanna do it in native nim, the folks at #nim-science can give you a few pointers I believe
18:25:31kinkinkijkinso i can drop it into my game engine and have something for people to come to me to complain about making their game slow
18:29:08FromDiscord<exelotl> Zevv: your fixed point lib looks great but those procs definitely need to be {.inline.} or templates πŸ˜…
18:31:28Zevvoh sure
18:31:42Zevvbut maybe it first should all actually work and be completed to make it usable
18:31:52disruptekcrazy talk.
18:32:20kinkinkijkinwhat i was thinking of is a data-friendly fixed point lib, using as much native fixed point shenanigans as possible
18:33:00Zevvgo for it!
18:33:22kinkinkijkinactually wait does arm64 do fixeds natively
18:33:38Zevvdisruptek: when are you going to drop your eventqueue stuff from the CPS repo
18:33:52kinkinkijkini know x86_64 needs to treat them as ints
18:34:06*Gustavo6046 joined #nim
18:35:51leorizeZevv: but I like that eventqueue, it has Cont and trampoline :(
18:36:25FromDiscord<exelotl> For my fixed point lib I decided that supporting fixed Γ— int and int Γ— fixed (without needing to convert the int to fixed), and same for division, is basically essential to reduce the possibility of overflow.
18:36:31disruptekZevv: i think we can safely move it out now, right?
18:37:53FromDiscord<exelotl> and then it follows that all operations (+ - / += -= = /=) should all allow one fixed parameter and one int parameter, for consistency
18:38:54Zevvdisruptek: I bet it will speed up the tests.
18:39:08Zevvleorize: it should not live there. It should be in a different repo
18:39:19Zevvthat Cont and trampoline are not the ones you want or need
18:39:19disrupteknone of the tests use eventqueue.
18:39:23Zevvah ok cool
18:39:55Zevvmakes sense if we'd move cps.nim into cps/ and make cps.nim only do some imports?
18:40:00FromDiscord<exelotl> it's worked out fine so far, except my module only supports 24.8 fixed point. :/↡i definitely want it to support other sizes
18:40:10FromDiscord<exelotl> but that'll basically need a rewrite
18:40:14disruptekZevv: why?
18:40:36Zevvsymmetry and esthetics, I guess
18:40:43Zevvnah nevermind
18:40:43leorizewouldn't I need that because there can be only one continuation type rn?
18:41:02Zevvnope, there can be an infinite number of those
18:41:20disruptekyou can only have one continuation type per scheduler; and with inheritance, this isn't really an issue.
18:41:27Zevvthe type is a concept, and you as a "middlewere" implementer make it fit your problem domain
18:41:56disruptekbut poke mratsim and ask him again to pr his type erasure code.
18:42:06disruptekhe won't listen to me.
18:42:18leorizeah, ok, will move to my own continuations then
18:42:53Zevvleorize: if we want to do asyncy-things, I think we should make a simple repo that offers just that
18:42:54disruptekyes, you don't want eventqueue.
18:43:03Zevvit can (should?) lie on top of ioselectors probably
18:43:12leorizenot sure about that
18:43:26Zevvif you want portability
18:43:37disruptekif flywind ports timers into stdlib, it should be okay.
18:44:25Zevveh, there are timers in stdlib already, right?
18:44:33leorizein nim-sys I'm experimenting with skipping ioselectors and having primitives implemented in a platform-specific way
18:44:35disrupteknot for windows.
18:44:41Zevvwow
18:44:49leorizethis is mainly because of completion vs readiness notifications
18:45:19Zevvhm but there's registerTimer, does that now work on windows then?
18:45:36disruptekright, it does not.
18:45:44Zevvand it does not even say that in the docs
18:45:45Zevvwonderful
18:45:57disruptekthere's a readme here that explains this:
18:45:59disruptek!repo cps
18:46:00disbothttps://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim πŸ”— 15 55⭐ 2🍴
18:50:28FromDiscord<Zachary Carter> uhhh - does anyone know how to link a DLL using `vcc` on Windows? I'm trying everything but can't figure out how to do it...
18:52:23leorizeyou don't link a dll
18:52:29leorizeyou link with a .lib file
18:53:55FromDiscord<Daniel> i dont understand this?...does it mean it will be available in nim 1.5? https://media.discordapp.net/attachments/371759389889003532/800075373596508160/unknown.png
18:53:58FromDiscord<Zachary Carter> how do I tell the compiler that these symbols are contained in this dll?
18:55:07leorize@Zachary by linking with a .lib file :)
18:55:08*^Q-Master^ quit (Ping timeout: 260 seconds)
18:55:18leorizein short, you don't
18:55:25disruptekdaniel: it means it requires the devel branch.
18:55:41FromDiscord<Zachary Carter> wtf
18:55:42FromDiscord<Zachary Carter> okay
18:55:56disruptekthe d in dll stands for dynamic.
18:56:00FromDiscord<Daniel> oh i see, makes sense i guess, thank you for the explanation
18:56:07leorize@Zachary the .lib teels the linker what symbol the library it associates with provides
18:56:47leorizeit will also tells the linker what dll it is
18:57:06leorizeand when you start your program that dll will be searched in PATH
18:57:08FromDiscord<Zachary Carter> right okay I think I'm just getting confused - I need to tell Nim via the cimport pragma what dynamic library to load the symbol from
18:57:20FromDiscord<Zachary Carter> if I don't want to statically link
18:57:44leorizeI would link with a .lib tbh
18:57:48leorizemuch less overhead
18:58:06FromDiscord<Zachary Carter> yeah
18:58:16leorizeand you get Windows default error box as well
18:58:39FromDiscord<Avatarfighter> Disruptek: hey lol
19:01:10*Jesin quit (Quit: Leaving)
19:03:24disruptekwhat up fighter
19:07:10*Jesin joined #nim
19:09:44giacohow would you push events from external thread to async loop thread?
19:11:27*hnOsmium0001 joined #nim
19:11:55*grobe0ba_ joined #nim
19:12:34*Cthalupa quit (Ping timeout: 256 seconds)
19:12:34*grobe0ba quit (Ping timeout: 256 seconds)
19:12:34*revere quit (Ping timeout: 256 seconds)
19:12:34*oz quit (Ping timeout: 256 seconds)
19:12:38*reveres joined #nim
19:13:02*reveres is now known as revere
19:13:04*Cthalupa joined #nim
19:13:14*oz joined #nim
19:14:55disruptekgiaco: i would ask dom96.
19:15:04FromDiscord<Anuke> Is this a bug? https://play.nim-lang.org/#ix=2MeH
19:15:54giacodisruptek: thanks
19:15:56FromDiscord<dom96> giaco: either channels or just use a socket if you don't mind serialising it
19:16:59giacodom96: channels! I was on the right path. Do channels have async constructs?
19:17:45FromDiscord<dom96> unfortunately not right now, but you can use async events to signal their readiness
19:18:16giacogood. Thanks a lot for the quick feedback
19:20:36FromDiscord<dom96> no problem, happy to help πŸ™‚
19:22:08Zevvdisruptek:
19:22:28disruptekwut
19:22:37Zevvwhich dependencies can we drop from cps
19:23:10Zevvnone I guess?
19:23:22disruptekdepends on whether you feel like fixing foreign bindsym.
19:23:46disruptekyou can remove criterion if you don't care about running the benchmark.
19:25:25Zevvnah it's fine for now, but you know how I feel about deps
19:25:42Zevvnot that it matters, it's *your* repo after all :)
19:26:29disruptekwell, grow out of it or replace them with your own code.
19:27:07disrupteki personally don't want to maintain test running for every project, but i'm happy to let you do it if you want.
19:27:47ZevvI guess I'll grow out of it then, right
19:28:00*Q-Master joined #nim
19:28:13disruptekcriterion says our performance is pretty dismal.
19:29:06Zevvhow come
19:29:37FromDiscord<Rika> @Anuke no, multiline comments start with #[ and end with ]#, add a space
19:29:50FromDiscord<Rika> misread
19:29:59FromDiscord<Rika> but thats another bug lol
19:31:18disruptekZevv: i dunno if it's the object conversion tests or what.
19:31:31disruptekwe are missing a move, too.
19:31:32FromDiscord<Anuke> are you saying the `#[` without a corresponding `]#` being accepted by the compiler is a bug as well?
19:31:39FromDiscord<Rika> no
19:31:53FromDiscord<Rika> it didnt compile when i tried so i assumed the bug was about that
19:32:11Zevvdisruptek: can we enforce that?
19:32:16disruptekmy case statement test produces an infinite loop at compile-time. 😒
19:32:35Zevvthat'll significantly slow down the CI pipe
19:32:40disruptekZevv: i started on it with --define:cpsMoves but it's not finished.
19:32:46Zevvcool
19:32:47FromDiscord<Anuke> my bad, I forgot to test it with the comments - remove them and you'll see what I meant
19:32:58*Q-Master quit (Ping timeout: 246 seconds)
19:33:23FromDiscord<Rika> i see the issue now, the array is constant so arr[1] is folded intp proc() but arr[i] cannot exist
19:33:30FromDiscord<Rika> wait no
19:33:31disruptekomg it's not infinite.
19:33:32FromDiscord<Rika> okay
19:33:34FromDiscord<Rika> this is kinda funky
19:34:03FromDiscord<Anuke> I'm trying to work around this bug right now and pretty much every variant I try either gives invalid codegen or puts `nil`s everywhere
19:34:05disruptekcase statements take 1.5mins to compile.
19:34:44Zevvit's testes
19:34:50Zevvor isn't it
19:35:12disruptekif you have a problem with my balls, just come out and say it.
19:35:17ZevvI just did
19:35:23disruptekoh, right.
19:35:34FromDiscord<Rika> holy shit im getting errors in the C file now
19:35:36Zevv35k lines of C for tzevv is pretty funny
19:35:44FromDiscord<Rika> anuke what have you done
19:35:51disruptekit's not about the length; it's about the girth.
19:35:59FromDiscord<Anuke> it breaks even when I use seqs/vars/lets
19:36:26FromDiscord<Rika> i assume the issue is not seqs, its the proc type and const
19:37:37Zevvdisruptek: one optimization we should make soon is not splitting when not needed
19:37:49disruptekmake a test.
19:39:13Zevvbecause that'll kill performnace
19:39:23Zevvall these extra trampoline jumps
19:39:44disruptek#59 removed some extra jumps.
19:39:56Zevvyeah, but we need logic to only transform if a block has a cps call
19:40:13disruptekstart with a test.
19:40:17Zevvdude
19:40:21Zevvyou sound like my manager
19:40:34disruptekwell, we'd get alone great, i'm sure.
19:40:35ZevvI just decided this week to start quitting that job
19:40:41disrupteklol
19:41:07disruptekour test suite is starting to be useful.
19:42:33*Q-Master joined #nim
19:42:46leorizewhy won't WaitForMultipleObjects accept IOCP? :(
19:43:14leorizeso I will still have to spawn threads, because Windows
19:47:36*Gustavo6046 quit (Ping timeout: 246 seconds)
19:49:05disruptekonly on windows, though, right?
19:51:14Zevvdisruptek: added a test. tyranny
19:55:26Zevvdid we ever decided if we want to run the first iteration of a contiuation when calling the booty?
19:55:38Zevvbecause the head of the cps proc can be moved into the booty, saving one call
19:55:58disruptekpremature opt.
19:56:05ZevvI'm full of those
19:56:12Zevvif you need any, call me
19:56:16disruptekyou're full of something, alright.
19:56:33ZevvI remember when you said clyybber is full of bs one day
19:57:14leorize[m]disruptek: yea, it's annoying, but luckily windows have a built-in threadpool for that
19:57:23Zevvwow
20:04:59disruptekhmm, look at tzevv now.
20:05:10disruptekit didn't even occur to me to run the tests.
20:05:58FromDiscord<lqdev> Zevv: using npeg for a lexer i'm whipping up, so far so good
20:06:20FromDiscord<lqdev> gonna see how that openArray[T] parsing works in a sec
20:09:19Zevvlqdev: pretty much uncharted territory you're going
20:09:41Zevvthe good thing is that I needed to change *very* little to make npeg parse anything seq'ish
20:10:11Zevvso I'm pretty confident it should work out. Basically all I did was make it generic, and isolate one or two cases where explicit string things were happening
20:11:16Zevvdisruptek: messy error from cps.nim: ps.nim(514, 9) Error: expression [20 lines of nim here] s of type 'NimNode' and has to be used (or discarded);
20:11:27disrupteki know, it's nuts.
20:12:55disruptekit's the kind of error that makes me check `nim --version`. 🀣
20:16:45*lritter joined #nim
20:19:09*npgm_ quit ()
20:19:42*npgm joined #nim
20:21:06FromDiscord<lqdev> Zevv: do you have any examples on simple AST building?
20:26:52disruptekZevv: you ruined everything.
20:29:15Zevvlqdev: look for my mathpipe repo
20:29:31Zevvor the rod parser which is in misc or contrib somewhere in npeg
20:30:21FromDiscord<lqdev> oh yeah missed that one
20:35:50disruptekZevv: seems like we're creating an extra done() proc sometimes. it's never actually called.
20:39:41*screens_ quit (Quit: screens_)
20:44:58FromDiscord<lqdev> Zevv: why did you add the ^ 0 to parenExp here? trying to wrap my head around your precedence climbing shenanigans https://github.com/zevv/npeg/blob/master/misc/rod.nim#L179
20:45:10*a_chou joined #nim
20:48:26FromDiscord<lqdev> alr think i found it
20:48:32FromDiscord<lqdev> P ^ 0: resets the current precedence to 0 and continues parsing. This main use case for this is parsing sub-expressions in parentheses.
20:50:03FromDiscord<lqdev> but wait
20:50:18FromDiscord<lqdev> it only resets the precedence for P, right?
20:54:08Zevvlqdev: so, you are building AST, parsing openarray[T] and now you want to do precedence operators as well?!
20:54:29Zevvyeah, only for P
20:54:40FromDiscord<lqdev> are you saying none of the three things you just mentioned were tested?
20:54:50Zevvby me I guess :)
20:55:01FromDiscord<lqdev> well, now it's gonna be two people.
20:55:21Zevvbut for the good news: the number of actual bugs reported on npeg is ridiculously low
20:55:22disruptekwho's the other person?
20:55:36Zevvso either it has no users, or the code is rock solid
20:58:00FromDiscord<lqdev> disruptek: yours truly.
20:58:31disruptekthat makes one.
20:59:42*Arrrrrrrr quit (Ping timeout: 256 seconds)
21:03:00*a_chou quit (Remote host closed the connection)
21:04:02*vicfred joined #nim
21:19:20FromDiscord<Anuke> How would I declare and initialize a seq/array of procs without making the procs variables/consts? This doesn't work: https://play.nim-lang.org/#ix=2Mg0
21:20:09FromDiscord<lqdev> @Anuke that's because proc types have the {.closure.} convention by default
21:20:26FromDiscord<lqdev> you need to add {.nimcall.} to it, like so: `type ProcType = proc(b: int) {.nimcall.}`
21:21:26miprihttps://play.nim-lang.org/#ix=2Mg3
21:22:52FromDiscord<lqdev> or that. implicit conversions in arrays and tuples are a bit fiddly
21:24:40FromDiscord<Anuke> Thanks, converting to the proc type explicitly fixed it.↡@lqdev Your advice fixed the example, but lead to a `lock levels differ` error in my actual code (possibly due to macro usage)
21:25:10FromDiscord<lqdev> ah dang, lock levels
21:25:18FromDiscord<lqdev> neat in concept but annoying in practice.
21:26:17FromDiscord<Anuke> I'm not sure why they even exist when I don't have threads on
21:27:50FromDiscord<lqdev> Zevv: how would i handle something like a proc call, where the amount of arguments may vary, with the stack-based AST building approach?
21:28:10FromDiscord<lqdev> would i need something like a sentinel value in that case, to know when to stop popping from the stack, or is there a better way?
21:29:14disruptekyou make an arg list type that has length, no?
21:29:55FromDiscord<lqdev> well yes, but that's not what i'm asking about
21:30:22FromDiscord<lqdev> https://github.com/zevv/npeg/blob/master/misc/rod.nim doesn't handle this case probably because it was written before i implemented calls into my lang
21:30:33FromDiscord<lqdev> but it does the stack-based AST building thing
21:48:21FromDiscord<apollo> so i can use the system.hostOS to write completley different code for the 3 seperate operating systems?
21:52:05*pbb quit (Remote host closed the connection)
21:53:19*pbb joined #nim
21:53:56Zevvlqdev: mathpipe does that
22:01:11FromDiscord<lqdev> @apollo or better yet, use `defined(windows)`, `defined(linux)`, `defined(macosx)`, or `defined(posix)`
22:02:18FromDiscord<apollo> havent gotten or learnt that yet πŸ˜…
22:02:24FromDiscord<lqdev> Zevv: ah, so something similar to what i'm doing
22:03:00FromDiscord<lqdev> @apollo i'm not surprised, i think i first encountered it in the wild when reading some stdlib code
22:03:53FromDiscord<apollo> well im glad nim has these options :))
22:05:25FromDiscord<lqdev> why wouldn't it :p
22:05:48FromDiscord<lqdev> it's a low-level language, it's quite an essential feature to be able to detect the OS at compile time
22:05:54disruptekrude.
22:08:57*Gustavo6046 joined #nim
22:10:24Zevvhttps://github.com/zevv/mathpipe/blob/master/mp.nim#L60
22:13:06FromDiscord<lqdev> yeah found it already
22:25:51*grobe0ba_ is now known as grobe0ba
22:26:44*Vladar quit (Quit: Leaving)
22:29:17disruptekZevv: man, i think blocks are really broken.
22:29:47Zevvthats a *blocking* bug then
22:37:02*Hexeratops joined #nim
22:37:46*Hexeratops quit (Client Quit)
22:49:21FromDiscord<lqdev> lol -d:npegTrace causes a codegen bug
22:49:45FromDiscord<lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2MgF
22:50:02FromDiscord<lqdev> and two more similar errors
22:51:33FromDiscord<lqdev> Zevv: ping
22:52:01FromDiscord<lqdev> it's probably related to that openArray[T] parsing
22:52:21Zevvyeah nice
22:52:23FromDiscord<lqdev> 'cos lexer.nim compiles successfully
22:52:30Zevvminimize away
22:52:52Zevvbah
22:53:30Zevvdo you have something reproducable?
22:53:32Zevvyou can share
22:57:03Zevvwell, I'm off for a nap anyway.
22:57:08Zevvif you suspect a bug, lemme know
22:57:10FromDiscord<lqdev> yeah i think i got a minimal example
22:57:16FromDiscord<lqdev> hold on
22:57:17ZevvI'll buy you a beer if it's in npeg
22:57:36FromDiscord<lqdev> http://ix.io/2MgH
22:57:51FromDiscord<lqdev> it's probably not npeg
22:57:56FromDiscord<lqdev> that set comparison triggers it
22:58:01Zevvthen I'll drink the beer
22:58:24FromDiscord<lqdev> yeah i'm underage so that's probably better
22:58:34Zevvpff said no on ever
22:58:42Zevvcompiles fine for me?
22:58:52FromDiscord<lqdev> -d:npegTrace
22:59:05Zevvah sorry
22:59:07FromDiscord<lqdev> nim 1.4.2
22:59:11Zevvboom
22:59:13FromDiscord<lqdev> will try devel tho
22:59:36Zevvsolution: use js instead of c :)
22:59:40Zevvdevel does boom
23:00:36FromDiscord<lqdev> alright, now onto blindly inserting `echo` everywhere and hoping for the best
23:00:40FromDiscord<lqdev> because npegTrace doesn't work
23:01:09Zevvbah
23:03:52*krux02 joined #nim
23:04:39Zevvyeah but you're doing funny stuff with the == for a set and one element
23:04:42Zevvyou know that, of course
23:04:49Zevvno reason for nim to barf like that, of course
23:05:36Zevvyou say you are passing a Token
23:05:45Zevvbut actually you are passing a set[Token]
23:06:54Zevvwhy don't you just [tokA] * ([TokA] | [TokB]) * [TokC]
23:07:00Zevvno need for the nasty set fiddling and lying
23:07:48ZevvI can also make npeg parse [tokA] * {[TokA], [TokB]} * [TokC]
23:07:55Zevvwhich would make sense, as that also works for char
23:09:43FromDiscord<lqdev> that would be nice
23:10:07Zevvlet me see if I can make that work
23:10:09*vicfred quit (Quit: Leaving)
23:10:10FromDiscord<lqdev> i was just testing whether the feature holds up as advertised :p
23:10:31FromDiscord<lqdev> y'know, letting the user supply any arbitrary expression in []
23:10:40FromDiscord<lqdev> and, to a degree, it works
23:10:46Zevvyeah, but you should pass 1 type
23:10:47Zevvnot 2
23:10:57ZevvI guess
23:11:05Zevvbecause the type gets passed to echo in npegTrace
23:11:15Zevvand something is creeping past nims defences I guess
23:11:25FromDiscord<lqdev> hm
23:11:50Zevvhm the curly does not fit simply
23:12:01Zevvbut using choice (|) should be enough for what you are trying to do
23:12:14FromDiscord<lqdev> oh totally
23:12:23FromDiscord<lqdev> well, i'll be logging off for the night. @ me if you got any updates
23:12:25Zevvcurlies and choice is equivalent, and actually gets compiled to the same parser (for chars)
23:12:33Zevvsame here, time for ZzZ
23:13:22Zevvnighty
23:51:57FromDiscord<ITR> either the vscode is borking the debugger, or my program somehow gets a segfault before it runs :/
23:56:41FromDiscord<shadow.> disruptek: why the name change?
23:56:46FromDiscord<shadow.> testes kinda fit with tests and still had the joke
23:56:50FromDiscord<shadow.> balls feels too unrelated and forced
23:56:59disruptekask araq.
23:57:04FromDiscord<shadow.> did he not like it?
23:57:19disruptekhow is it unrelated?
23:57:23disruptek!repo disruptek/balls
23:57:23disbothttps://github.com/disruptek/balls -- 9balls: 11the unittest framework with balls πŸ”΄πŸŸ‘πŸŸ’ 15 29⭐ 1🍴
23:57:31FromDiscord<shadow.> how does it relate to tests lol
23:58:03saemwelp no screwing around with macros today... spent time dicking around with fans in my case instead
23:58:10FromDiscord<shadow.> unfortunate
23:58:29disruptekair cooling is for chumps.
23:58:39saemwater cooling is pain.
23:59:06disruptekthe kits make it painless now.
23:59:36saemyeah
23:59:59saemI decided to vote with my dollars and gave system76 money