<< 23-12-2020 >>

00:02:43FromDiscord<Quibono> Ahh gotcha gotcha
00:03:58*vsantana_ joined #nim
00:07:28*vsantana quit (Ping timeout: 272 seconds)
00:09:03*vsantana joined #nim
00:09:08*vsantana_ quit (Ping timeout: 260 seconds)
00:29:12FromDiscord<Quibono> Similar question, how much work would it take to use net to recreate httpclient sort of but with binary return data?
00:33:17FromDiscord<ElegantBeef> idk what you mean it already has binary return data
00:33:36FromDiscord<Quibono> It returns things as strings I believe
00:34:15FromDiscord<ElegantBeef> Strings are binary
00:35:23FromDiscord<Quibono> Sorry if I’m being obtuse, but isn’t there some overhead to convert them to like an array of uint8?
00:36:06FromDiscord<ElegantBeef> Strings are a sequence of chars, chars are just uint8s that can be converted to printable characters
00:39:13FromDiscord<ElegantBeef> What you can do is get the string the make a newStringStream and read the data from it as you which
00:40:51FromDiscord<Quibono> So that’d be the lowest cost way to get int into an array of chars?
00:41:57FromDiscord<Quibono> it
00:42:03FromDiscord<ElegantBeef> The lowest cost would be to leave it as a string
00:43:04FromDiscord<Quibono> My naΓ―ve understanding from reading was that you wanted to avoid objects on the heap for high performance stuffs
00:44:24FromDiscord<ElegantBeef> I dont think that's an issue for sequential values but idk
01:10:14*Tanger joined #nim
01:13:48FromDiscord<shadow.> @Quibono you're comparing uint8's right
01:13:55FromDiscord<shadow.> bc byte / uint8 / char is all the same data
01:14:08FromDiscord<shadow.> so why not just compare the char s
01:14:09FromDiscord<shadow.> (edit) "char s" => "chars"
01:14:13FromDiscord<Quibono> Yes I see now
01:14:16FromDiscord<shadow.> it should be just as fast as comparing the bytes
01:14:16FromDiscord<shadow.> ye
01:19:19FromDiscord<Quibono> I also need to make procs for indexing start and end of word and then just copying that into an array
01:24:17FromDiscord<ElegantBeef> @Quibono what do you mean?
01:25:14FromDiscord<Quibono> Like finding the index of a substring to copy it
01:25:18ForumUpdaterBotNew thread by Guzba: Zippy update: Zip archive and tarball support + much closer to zlib performance, see https://forum.nim-lang.org/t/7281
01:27:00FromDiscord<ElegantBeef> @guzba shit you work quick, nice zip archives
01:28:01FromDiscord<guzba> haha yeah, after doing tarballs zip turned out to be really not bad
01:28:07*lum quit (Quit: Lum: Bye!)
01:29:09FromDiscord<guzba> phew ok i think im going to step away from compressed file formats for at least 2 minutes lol
01:29:28FromDiscord<ElegantBeef> do the archives work in the VM?
01:30:02FromDiscord<guzba> aw you had to ask. zippy compress and uncompress does, tarballs may? i know archives do not just yet
01:30:12FromDiscord<guzba> its the whole string vs uint stuff i hate hate hate
01:30:18FromDiscord<guzba> i cant cast in vm
01:30:23FromDiscord<flywind> Wow it looks good to me, it should be added to important-packages I think.
01:30:24FromDiscord<ElegantBeef> Yea i know
01:30:28FromDiscord<guzba> but i readfile as string
01:30:31FromDiscord<guzba> so its like welllllllll
01:30:47FromDiscord<guzba> thanks flywind!
01:30:56FromDiscord<ElegantBeef> Yea i know the VM isnt overly sophisticated when it comes to bits πŸ˜„
01:31:04FromDiscord<guzba> to be clear the vm is amazing
01:31:08FromDiscord<guzba> im just whining
01:31:33FromDiscord<flywind> Could you specify a nimble task to test your files?
01:31:56FromDiscord<ElegantBeef> I mean i had to do what i consider as a bodge for the Nim <-> Nimscript interop i've made
01:32:26FromDiscord<guzba> @flywind nimble test is what i use now, does a specific task need to be created? if so does it need a specific name to play nicely?
01:32:45FromDiscord<guzba> (edit) "nimble test" => "`nimble test`"
01:32:48FromDiscord<ElegantBeef> I believe they mean make a test to run examples
01:32:55FromDiscord<shadow.> @ElegantBeef what's your github again?
01:32:55FromDiscord<flywind> For example I use
01:33:00FromDiscord<flywind> task tests, "Run all tests":↡ exec "testament all"
01:33:10FromDiscord<shadow.> nvm found it
01:33:15FromDiscord<ElegantBeef> That's redundant with `nimble test`
01:33:39FromDiscord<ElegantBeef> although it only runs files that start with `t`
01:34:12FromDiscord<flywind> If you use `nimble test`, that's ok
01:34:50FromDiscord<ElegantBeef> Why'd you want my github account anywho?
01:34:55FromDiscord<guzba> nimble test runs for my github actions and i ensure they cover everything each commit should be checked against. i have other verification and benchmarking but that is kind of for me
01:34:58FromDiscord<ElegantBeef> I've got nothing cool there
01:35:15FromDiscord<guzba> (edit) "nimble test runs for my github actions and i ensure they cover everything each commit should be checked against. i have other verification and benchmarking ... but" added "in the tests/ dir"
01:36:41*lum joined #nim
01:37:26FromDiscord<shadow.> nimscripter
01:37:30*lum quit (Client Quit)
01:37:40FromDiscord<shadow.> you've mentioned it quite a bit so i just thought i'd take a look lol
01:37:58*Tlangir joined #nim
01:38:21FromDiscord<ElegantBeef> ah
01:40:39*Tanger quit (Ping timeout: 256 seconds)
01:40:58FromDiscord<ElegantBeef> It's pretty useful if you want to easily work with a scripted language
01:41:09FromDiscord<flywind> done https://github.com/nim-lang/Nim/pull/16442
01:41:10disbotβž₯ add zippy to important packages
01:43:03FromDiscord<guzba> oo cool!
01:47:15FromDiscord<ElegantBeef> Flywind you going to add it to awesome-nim aswell? πŸ˜„
01:48:04FromDiscord<flywind> PR is welcome
01:48:18FromDiscord<ElegantBeef> Sounds like work πŸ˜›
01:50:51FromDiscord<Cohjellah> sent a long message, see http://ix.io/2Jd0
01:51:10FromDiscord<Rika> they use an intermediate server
01:51:33FromDiscord<Rika> port forwarding is needed for peer to peer (which is why torrenting needs it usually)
01:52:05FromDiscord<ElegantBeef> Only the server needs to port forward, so if you host it you portforward
01:52:24FromDiscord<Rika> ~~in the case of torrenting, everyone is a server~~
01:52:37FromDiscord<ElegantBeef> Yea
01:59:23FromDiscord<Cohjellah> Ohhhh
01:59:33FromDiscord<Cohjellah> Makes more sense.
01:59:57FromDiscord<Cohjellah> Now I get It
02:01:32*a_chou joined #nim
02:02:54FromDiscord<Cohjellah> Do I have to change other settings such as my IP, because it's currently just localhost for both the client and server. Or will this automatically use your local IP when connecting to a server that's not on a LAN?
02:04:45FromDiscord<shadow.> i mean
02:04:51FromDiscord<shadow.> you can do a localhost tunnel instead if that's easier
02:04:54FromDiscord<shadow.> @Cohjellah like ngrok
02:05:16FromDiscord<shadow.> just do `ngrok tcp <port>` and then send the link to your friend
02:05:51*a_chou quit (Remote host closed the connection)
02:06:23FromDiscord<Cohjellah> What exactly is the link though?
02:06:39FromDiscord<Cohjellah> Also I've already got a server setup that is utilising a port
02:07:49FromDiscord<Cohjellah> Will ngrok just make it so I don't need to port forward?
02:14:51*lum joined #nim
02:17:04*lum quit (Client Quit)
02:28:05disruptekyay, github fixed !requires.
02:41:14*lum joined #nim
03:00:23disruptekah, i'm wrong. it's fixed for very small query limits. 🀨
03:01:59disruptekah, i'm wrong. it doesn't fucking work at all.
03:02:26*abm quit (Quit: Leaving)
03:07:15FromDiscord<Rika> lol
03:36:31disruptekso weird.
03:39:11*vikfret joined #nim
03:39:16*klaufir_ quit (Ping timeout: 240 seconds)
03:59:09*muffindrake quit (Ping timeout: 272 seconds)
04:01:09*muffindrake joined #nim
04:37:51ForumUpdaterBotNew thread by Jasonfi: Client-side JS with Nim, see https://forum.nim-lang.org/t/7282
04:50:42*spiderstew_ joined #nim
04:52:21*spiderstew quit (Ping timeout: 272 seconds)
04:54:44*narimiran joined #nim
05:01:52*superbia1 joined #nim
05:05:01*superbia quit (Ping timeout: 272 seconds)
05:48:37*ex_nihilo joined #nim
06:02:44ex_nihilodom96: looking at Nim in Action Listing 4.26, the httpclient example, there is something I don't understand; the book code shows:
06:03:03ex_nihilolet response = waitFor client.get("http://nim-lang.org")
06:03:12ex_nihiloecho(response.version)
06:03:20ex_nihiloecho(waitFor response.body) # Why is waitFor used here?
06:03:27ex_nihiloFrom the Nim docs I thought that `response` is an `AsyncResponse`, and that `response.body` is a string. I thought that `waitFor` needed a `Future[T]`, e.g., a `Future[string]`. There is no `waitFor` used with `response.version`; what am I missing?
06:03:56disruptekthe body is a future, or perhaps it was.
06:04:06disruptekhave you consulted the errata?
06:04:26ex_nihilodisruptek: I have looked, but I may have missed something
06:04:33disrupteklemme check.
06:05:18disruptekman i'd kill for some bandwidth.
06:05:19FromDiscord<Rika> AsyncResponse has Future[string] for body
06:05:28FromDiscord<Rika> I distinctly remember it
06:05:47disruptekit's called bodyStream.
06:05:52disruptekbody is a string.
06:06:01disruptekhttps://nim-lang.org/docs/httpclient.html#AsyncResponse
06:06:19disruptekex_nihilo: it was probably changed. don't sweat it.
06:08:10FromDiscord<Rika> Oh really? Odd, might have been changed indeed
06:08:17FromDiscord<Rika> Since I do remember body being the Future
06:10:16FromDiscord<myphs> How come `--gc:none` makes my binary bigger than with GC e.g. `--gc:boehm`?
06:11:00disruptekno one took the garbage out.
06:13:07FromDiscord<myphs> I'm genuinely interested. I used `--opt:speed -d:danger` and `--gc` and found this disturbing to see
06:14:26disruptekit's different code. different code compiles to different sizes.
06:16:39FromDiscord<myphs> Yeah, but one would imagine that binaries with GC enabled must be bigger, right?
06:17:24disruptekwhy?
06:17:37FromDiscord<Rika> More code doesn’t mean bigger all the time
06:17:54disruptek--gc:arc is essentially a garbage-free garbage collector. see how large it is.
06:17:56FromDiscord<myphs> I thought I could run the program until my memory runs out. So it would just allocate and never free
06:18:03disruptekindeed, it will.
06:18:11FromDiscord<Rika> And it would , yes
06:18:14disruptekhow large the binary is has nothing to do with that.
06:18:24Araq--gc:none still includes our allocator
06:18:36FromDiscord<myphs> I see
06:18:39Araqand --gc:boehm doesn't. simple as that
06:18:44FromDiscord<Rika> Oh yeah that makes more sense now
06:19:03Araqyou can use -d:useMalloc
06:22:39FromDiscord<myphs> That indeed makes more sense. Thanks
06:26:22FromDiscord<ElegantBeef> So when i get around to adding a `\n` after each mismatch, what should the option be for disabling that feature? D:
06:26:24FromDiscord<ElegantBeef> (edit) "D:" => "πŸ˜„"
06:27:18disruptekjust bundle grep with the compiler.
06:27:43FromDiscord<ElegantBeef> I dont get the joke
06:27:43*habamax joined #nim
06:27:50disrupteki finally found a proper bug in nimph.
06:28:22disruptekhttps://github.com/disruptek/nimph/issues/145
06:28:23disbotβž₯ case insensitive github urls are exploited by nimpletons
06:30:42disruptekbeef: nim c foo.nim | grep .
06:31:00disruptekwell, not really proper, but it's a bug. i don't get many.
06:31:04FromDiscord<ElegantBeef> Seems like a fantastically bad idiea
06:31:12FromDiscord<ElegantBeef> Yea less a bug and more an issue with github
06:33:59disrupteki'm sure they have their reasons... but yeah, it's annoying simply because it provokes oversights like this.
06:39:58ex_nihilodisruptek: I think I figured it out-- `body` is not exported from `AsyncResponse`, so `response.body` is actually calling `body(response)`, which does return `Future[string]`
06:40:03ex_nihilohttps://nim-lang.org/docs/theindex.html#body
06:40:15disrupteknice!
06:40:27disruptekshows how long its been since i was working on my startup.
06:40:36ex_nihiloI feel a bit better now ;)
06:40:59disruptekAraq: why zippy and not supersnappy?
06:41:13Araqah...
06:41:13disrupteknevermind, i don't want to know.
06:41:39disruptekit's best that i forget my time in the compiler.
06:42:35FromDiscord<ElegantBeef> You can never forget it
06:42:40AraqI'm an idiot
06:42:55Araqconfused zippy with snupersnappy :-(
06:43:05Araqwell it's early in the morning
06:43:15disruptekeh, i'm sure ryan appreciates the sentiment nonetheless.
06:43:20disruptekwhat do you think of dist?
06:43:23disruptek!repo disruptek/dist
06:43:24disbothttps://github.com/disruptek/dist -- 9dist: 11a nim distribution 15 2⭐ 0🍴
06:43:35Araqbeats me
06:43:52AraqI don't understand how it works
06:44:23*leorize quit (Ping timeout: 240 seconds)
06:44:52disruptekwhat would help?
06:45:05disruptekc-blake... "aboriginal nimble authors" 🀣
06:46:55*leorize joined #nim
06:48:03FromDiscord<ElegantBeef> Ya know, i should probably make a forum post for nimscripter and actually add it to nimble
06:48:23disruptekare you an aboriginal canuck?
06:48:29FromDiscord<ElegantBeef> Nope
06:48:40disrupteki knew there was a reason i didn't like you.
06:48:53FromDiscord<ElegantBeef> Lol
06:49:03FromDiscord<ElegantBeef> We've spoke before so i'd imagine that'd be enough reason
06:59:00disruptekah, yeah, that's probably what it is.
07:06:57*letto quit (Read error: Connection reset by peer)
07:10:16FromDiscord<himu> sent a code paste, see https://play.nim-lang.org/#ix=2Jei
07:12:05ForumUpdaterBotNew thread by ElegantBeef: Nimscripter - Easy Nimscript-Nim interop, see https://forum.nim-lang.org/t/7283
07:14:58FromDiscord<ElegantBeef> Maybe checkout the unicode module, idk πŸ˜„
07:16:24*leorize quit (Remote host closed the connection)
07:18:50FromDiscord<himu> sure. Even C fails to get it correct. unicode is difficult it seems to parse. SMH
07:19:13FromDiscord<himu> (edit) "correct." => "correct or I don't know what I am doing wrong."
07:20:12*leorize joined #nim
07:58:46FromDiscord<mratsim> sent a long message, see http://ix.io/2Jey
07:58:48FromDiscord<mratsim> There is no 2.
08:02:18*PMunch joined #nim
08:02:54disruptekto me this isn't "we introduced flexiblity" it's "we can't abstract it".
08:03:44disruptekjust think about how elegant cps is.
08:04:27disruptekit's never any more or less complex than this.
08:04:48disruptekand yet it's the basis for all the control-flow we might want.
08:05:27disruptekand it synergizes with arc as if it were designed to be passed between threads on a multicore cpu from 1970.
08:06:39disruptekin no case does your continuation need to know anything at all about the scheduler.
08:08:21voltistIs there a way to use Nim's threads so wrong that it isn't actually multithreading? I'm spawning threads with `spawn` but it doesn't seem to give nearly as much of a speed increase as it should (each individual process takes a good few seconds to run, so it should be almost 1/4 the time on my CPU with 4 cores, right?)
08:08:51disruptekyou won't get 100% utilization from each core.
08:10:05voltistI'm thinking it should still be more than this; the improvement is about the length of one of the operations i'm multithreading, so I can't even be sure it's not just random noise
08:10:13disruptekwhat does `time` say?
08:10:27FromDiscord<mratsim> @voltist, there are plenty of way to use threads so wrong that you slowdown by N100% where n is your number of cores.
08:10:49disruptekit sounds like simple process spawns, though.
08:10:55voltistWell at least it's not slowing down :)
08:11:09FromDiscord<mratsim> false sharing can occur with simple spawn
08:11:19voltistI'm using channels as well if that makes a difference
08:11:26FromDiscord<mratsim> you jjust need 4 threads to put data in a non padded array[4, bool]
08:11:27disrupteklol
08:12:16FromDiscord<mratsim> I can't tell you without seeing the code
08:12:32disrupteki think i'd rather be asleep right now.
08:12:42FromDiscord<mratsim> and even if I see it, sometimes it takes me a while to understand perf bugs especially multithreading
08:13:18voltistIs it possible that channels is hindering it?
08:13:18disruptekyou're sending process output to the dispatching thread?
08:13:21voltistCode is here: https://github.com/dizzyliam/astroNimy/blob/master/src/astroNimy/detect.nim
08:13:26disruptekyes, it is possible.
08:13:27voltistAt bottom of file
08:14:39voltistMy apologies for the lack of comments
08:14:40FromDiscord<mratsim> what's the "Image" type?
08:14:51FromDiscord<mratsim> how big is it?
08:15:04voltisthttps://github.com/dizzyliam/astroNimy/blob/master/src/astroNimy/dataTypes.nim
08:15:30disruptekhmm.
08:15:31voltistIt can be very big because it holds FITS images
08:15:36FromDiscord<mratsim> yeah so you have a Table, a seq inside
08:15:51FromDiscord<mratsim> and if you use arraymancer from before last week, a full tensor
08:16:11FromDiscord<mratsim> what you should do instead is pass ownership in the channel (so a pointer)
08:16:26FromDiscord<mratsim> but with the default GC you're likely to break refcounting and collect memory in the wrong GC
08:17:00FromDiscord<mratsim> ultimately for computational physics it's probably better to use Weave.
08:17:21voltistActually I've just realized that the detectStars proc only modifies one part of the Image object (and it's not the tensor!), so I could just make it return that only over the channel
08:17:39disruptekespecially if you plan to publish. 😁
08:18:29voltistYay new things to learn
08:18:30FromDiscord<mratsim> does detectStars need to resize the sequence?
08:19:33voltistYes, but I think I'll do the actual modification of the Image objects outside of the spawned threads
08:19:41voltistOnce the channel has returned a resized seq
08:20:03FromDiscord<mratsim> because if you don't, I would pass just ptr UncheckedArray of the seq to thread directly and avoid channels here
08:20:26FromDiscord<mratsim> for numerical computing you especially want to avoid Nim channels
08:21:57FromDiscord<mratsim> basically, channels simplify synchronization, you don't have ordering to worry about
08:22:33FromDiscord<mratsim> but in scientific computing, often you work on patches/different part of the problem, for example independant part of an image or a tensor
08:22:39FromDiscord<mratsim> that's called data parallel.
08:22:59FromDiscord<mratsim> in that case, you don't need synchronization via a channel, because you just don't have such constraint.
08:23:45FromDiscord<mratsim> so just use threadpool and gives different part of the image to each thread.
08:24:24FromDiscord<mratsim> and if you can, pre-dimension everything and just pass raw ptr UncheckedArray via spawn to avoid deep copies.
08:25:45voltistI
08:25:50voltistOopd
08:25:54voltistOops
08:26:05voltistI'll try to stick to that in future
08:26:22FromDiscord<mratsim> also not sure if relevant: https://github.com/HugoGranstrom/nimbody
08:27:02FromDiscord<mratsim> don't worry, multithreading is something hard to get right, both as an implementer and a user.
08:27:12ldleworkamen
08:27:40FromDiscord<mratsim> just like in traditional computer science, a big part of solving the problem is choosing your data structure. For multithreading it's choosing how to partition work.
08:29:02FromDiscord<mratsim> Also you will here a lot about "don't communicate by sharing, share by communicating" as a slogan for message-passing (for Go or Rust for example).↡This is about concurrency, but you likely have a parallelism problem.
08:29:29FromDiscord<mratsim> anyway, don't hesitate to ask or ping me here or in the science channel in doubt.
08:30:05FromDiscord<mratsim> Also I can probably add your example to Weave benchmarks, it seems quite self contained: https://github.com/mratsim/weave/tree/master/benchmarks
08:30:14FromDiscord<mratsim> (edit) also not sure if relevant: https://github.com/HugoGranstrom/nimbody
08:32:09voltistAwesome, thanks for your help
08:36:53*superbia1 is now known as superbia
08:44:31PMunchdisruptek, I saw you added me to your dist repo :) Anything in particular you wanted me to do there?
08:48:46FromDiscord<lqdev> ^
08:54:14*letto joined #nim
09:00:06*jonjitsu[m] quit (Quit: Idle for 30+ days)
09:00:55*wowi42 quit (Remote host closed the connection)
09:01:40*wowi42 joined #nim
09:32:48*klaufir_ joined #nim
09:37:19*Arrrrrrrr joined #nim
09:51:38FromDiscord<mratsim> Forum is down?
09:52:00PMunchAppears like it
09:52:20narimiran@dom96 ^
09:55:44FromDiscord<mratsim> https://blog.johnnovak.net/2020/12/21/nim-apocrypha-vol1/ top 15 of HN
09:56:43*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:56:56PMunchOh, good to see that John Novak is still writing about Nim
09:57:22PMunchStill the largest post on my site by far is the time when I replied to his UI thing :P
10:04:58PMunchHaha, I like his first (and only) bookmark :P
10:05:07PMunchs/bookmark/footnote
10:05:27*letto quit (Quit: Konversation terminated!)
10:05:53*letto joined #nim
10:05:56FromDiscord<lqdev> nim website is down
10:07:11PMunchIt's up for me
10:07:14PMunchBut the forums are down
10:07:39superbiawebsite is up, forum is down for me
10:07:42FromDiscord<pointystick> Both the main website and the forums are working
10:08:01PrestigeI can't get to the docs or forum
10:08:21PMunchDocs are up for me
10:08:22superbiacorrection, forum just got back online
10:11:43narimiranTIL about `dump`
10:13:05FromDiscord<lqdev> oh really?
10:13:07*Tlangir quit (Remote host closed the connection)
10:13:43PrestigeThat was a pretty great read
10:17:06Zevv"Speaking of the system module, it’s full of useful stuff that’s not mentioned anywhere in the documentation. Make sure to go through the function list once in a while, I’ll guarantee you’ll find something of interest every time"
10:24:40FromDiscord<Yardanico> is nim-lang.org down?
10:24:46FromDiscord<Yardanico> 522
10:26:09FromDiscord<lqdev> yes.
10:26:13FromDiscord<Yardanico> F
10:26:51PMunchOh, now the main site is down for me as well
10:27:09PMunchPlayground and IRC logs are still up though
10:27:38superbia$ halt
10:27:55PMunch@dom96 is the only one I know who has access to those servers
10:28:11PMunchLet's hope he hasn't taken Christmas vacation just yet
10:28:28FromDiscord<lqdev> it's still quite early in the morning in England tho so maybe he's just asleep
10:28:35FromDiscord<lqdev> or eating breakfast
10:29:31FromDiscord<lzoz> it's back online
10:39:21PMunchHoorah!
10:51:15FromDiscord<mratsim> @Zevv, @disruptek, btw if CPS work you can publish a paper on it, because it would make it very easy to implement a "continuation-stealing" scheduler. To understand how big of a deal it is http://www.open-std.org/Jtc1/sc22/wg21/docs/papers/2014/n3872.pdf
10:52:13FromDiscord<mratsim> In practice: that would make Weave have less tasks in flight at any point in time, bounded by the number of processors instead of unbounded.
10:52:19PMunchHmm, is this when I should mention that I did write a work-stealing algorithm that stole closure iterators across threads by using one of the threadsafe GCs?
10:52:25FromDiscord<mratsim> so way less stress on the memory manager
10:52:50FromDiscord<mratsim> and maybe I can remove the memory pool from Weave altogether
10:52:57FromDiscord<mratsim> I have to think about it.
10:53:45FromDiscord<mratsim> I.e. instead of a memory pool, I can just have 1 scratchspace on each thread and tail-call continuations.
10:54:52FromDiscord<mratsim> @PMunch, tell me more?
10:55:31PMunchIt was just a little experiment I did
10:55:53PMunchNot even sure if I still have it around
10:57:40PMunchLet me see if I can find it
10:59:29PMunchHmm, can't find it, might be on my laptop or my work machine
11:00:04PMunchI saw it the other day while looking for something else
11:00:24*Vladar joined #nim
11:04:50ZevvPMunch: the irony is lost on him
11:05:18Zevvoh you were not being ironic :)
11:06:28PMunchHaha :P
11:07:06PMunchIt was just a silly little thing I wrote based on my recollection of the Cilk++ paper I read in Uni
11:09:55FromDiscord<mratsim> a simple work stealing scheduler just to handle spawn/sync isn't that hard
11:10:32FromDiscord<mratsim> instead of having a single queue in the Nim threadpool, you have an array of queues, each slot owned by a thread.
11:11:06FromDiscord<mratsim> on spawn, a thread enqueue the child function (or the continuation) in its queue
11:11:57FromDiscord<mratsim> the queue is actually a threadsafe dequeue, the owner enqueue and pop from one end, and the thieves when they have nothing in their own queue pop from the other end to limit synchronization conflict.
11:11:59FromDiscord<mratsim> and that's all.
11:13:57PMunchI remember doing some trickery around the queues and the stealing to make it thread safe though
11:14:55Zevvwhe needs mratsim when we have PMunch?!
11:15:00FromDiscord<mratsim> yep that's the hard part
11:15:03ZevvI don't even know what half of those words mean
11:15:19FromDiscord<dom96> PMunch: I'm still around
11:15:20FromDiscord<mratsim> but there are papers that give you the C code (instead of algorithm in strange math speak)
11:15:24FromDiscord<dom96> Guess cloudflare had a hiccup, maybe?
11:15:40PMunch@dom96, seems so, if you didn't do anything to fix it :P
11:15:51PMunchA bit strange though that the playground never went down
11:16:00PMunchIf it was a CF issue
11:16:14FromDiscord<mratsim> this is a threadsafe dequeue for work stealing: https://github.com/mratsim/weave/blob/v0.1.0/experiments/e01_staccato/task_deque.nim#L83-L137
11:16:26FromDiscord<dom96> https://www.cloudflarestatus.com/
11:16:34FromDiscord<dom96> yep, cloudflare issue
11:17:21FromDiscord<dom96> nim-lang.org officially has better uptime than cloudflare πŸ˜„
11:17:47FromDiscord<mratsim> In Weave I don't share the deque across threads which has interesting tradeoffs. You can block the runtime if you block in a thread, but you can do way better load balancing (and you should put blocking stuff in a blocking threadpool anyway, why use a HPC runtime for stdin read?).
11:30:10FromDiscord<mratsim> Oh, another realization for @dom96 , and @Zevv and @disruptek , if you have first continuations that you execute on a work-stealing threadpool you don't have to worry about blocking reads unless ALL your threads end up blocked.
11:30:32FromDiscord<mratsim> you make progress on your events even if one is blocked.
11:34:00FromDiscord<dom96> Yes, of course. But how many real threads can you realistically have?
11:37:39FromDiscord<mratsim> 10k πŸ˜‰
11:39:06FromDiscord<mratsim> if you have a work stealing threadpool without continuation, you have another issue, it's unbounded pending task growth: http://www.open-std.org/Jtc1/sc22/wg21/docs/papers/2014/n3872.pdf
11:39:33FromDiscord<mratsim> Weave solves that with memory pool, but that memory pool needs logic to return memory to the OS
11:40:08FromDiscord<mratsim> and it needs another layer of caching (a "look-side list") to be able to handle trillions of tasks
11:40:18FromDiscord<mratsim> in 100ms
11:40:26FromDiscord<mratsim> so billions of task per second
11:40:37FromDiscord<mratsim> milliseconds
11:41:34FromDiscord<mratsim> (not all are allocated, there is backpressure logic)
11:42:56FromDiscord<mratsim> anyway still thinking about this but there is high potential to further reduce Weave or any scheduler overhead in a novel way.
11:46:50FromDiscord<mratsim> This paper uses fibers: http://chaoran.me/assets/pdf/ws-spaa16.pdf which have higher overhead than continuations but apparently they reduce overhead by 3x to 8x compared to Intel Cilk and Intel TBB. I can reproduce.
11:47:12FromDiscord<mratsim> though only on toy bench like fib(40) (Weave can only do 1.5x and 6x)
12:01:17FromDiscord<zetashift> Oh sudden Nim on HN
12:01:31FromDiscord<zetashift> Also a lot of good stuff on the forum too
12:08:52FromDiscord<mratsim> Also found 2 killer apps for no allocation coroutines or continuations:↡- writing kernel-mode drivers.↡- writing cryptographic handshake like TLS.
12:09:46FromDiscord<mratsim> They both involve complex state machines, that need to be paused/resume to interleave with waiting for a reply.
12:10:08FromDiscord<mratsim> and heap alloc is more than strongly discouraged.
12:15:47ZevvI wonder, is HN just a small a group of people hanging around in the same bubble?
12:16:43FromDiscord<dom96> oh cool, Nim on HN. Nice.
12:20:50FromDiscord<Recruit_main707> Would it be too hard/break too much stuff to allow threads to have multiple arguments? Or at least, extend the {.thread.} pragma so that it takes care of this for you?
12:22:31FromDiscord<dom96> probably not, you can definitely write a quick macro to do this at least
12:24:00FromDiscord<mratsim> pass a tuple
12:24:13FromDiscord<mratsim> same with multiple return values
12:24:14FromDiscord<Recruit_main707> Would a PR that added this be welcome? (note that I am not considering doing it in a close future, but maybe once I am more familiar with macros...)
12:24:50FromDiscord<mratsim> just use an overload that varargs into tuple.
12:25:18FromDiscord<Recruit_main707> Yeah, it adds an unnecessary complexity to the function body
12:25:35FromDiscord<mratsim> I don't think it's worth it though
12:26:20FromDiscord<mratsim> project that use raw threads are likely to want to customize many things and adding a 2 line function to pack args in a tuple is something they can do.
12:26:52FromDiscord<mratsim> createThread((a, b)) and done even
12:27:04FromDiscord<mratsim> instead of createThread(a, b)
12:28:16FromDiscord<Recruit_main707> I think I’ll write an rfc, although having the god of multithreading against the idea might make things harder :p
12:34:50*NimBot joined #nim
12:35:02FromDiscord<mratsim> it's not multithreading though, it it's more similar to adding an overload for `proc add[T, U](s: var seq[(T, U)], a: T, b: U)`
12:35:49FromDiscord<mratsim> so allowing s.add(a, b) instead of s.add((a, b)) for sequence of tuples.
12:44:58FromDiscord<Recruit_main707> its not about how you call the function, its about how you write it, with a tuple, its just dumb having to add an `args.actualArgument` to use stuff
12:51:56FromDiscord<ArkarMinMyat> I installed nim v.1.2. from choosenim and set path in ~/.profile. but nim -v only work on installed console https://media.discordapp.net/attachments/371759389889003532/791286971104100362/Screen_Shot_2020-12-23_at_19.19.21.png
12:52:26FromDiscord<ArkarMinMyat> (edit) "v.1.2." => "v.1.2.6" | "console" => "console. Any Idea?"
12:55:48FromDiscord<Recruit_main707> did you op
12:56:02FromDiscord<Recruit_main707> en the console before installing nim?
12:56:08PMunchHmm, for point 5 here, is there a way to override `echo` so that you can specify e.g. file logging? https://blog.johnnovak.net/2020/12/21/nim-apocrypha-vol1/
12:56:46FromDiscord<ArkarMinMyat> Yes I closed and try in another console not work!
12:57:06FromDiscord<mratsim> I would have to see an example in the RFC
13:00:34FromDiscord<Recruit_main707> @ArkarMinMyat maybe you need to restart the pc, but i dont know
13:03:56FromDiscord<ArkarMinMyat> not work! even restart!
13:04:59FromDiscord<ArkarMinMyat> It is possible to downgrade nim v.1.4.2 to v.1.2.6?
13:05:05PMunchYes
13:05:16PMunchWith choosenim simply do `choosenim 1.2.6`
13:05:52PMunchIt's just a matter of setting the PATH correctly for both of your terminals
13:05:58PMunchHow they set this depends on the terminal
13:12:39FromDiscord<ArkarMinMyat> When I installed nim from homebrew and installed choosenim from nimble package. But choosenim command not found!!!!! https://media.discordapp.net/attachments/371759389889003532/791292183453237258/Screen_Shot_2020-12-23_at_19.41.03.png
13:13:25FromDiscord<mratsim> you need to add $HOME/.nimble/bin to your path or something like that
13:13:51FromDiscord<mratsim> @dom96 ^ a reminder when nimble installs binaries?
13:17:57PMunch@ArkyarMinMyat, note, when installing Nim from homebrew and later using choosenim you should uninstall the version from homebrew. Homebrew packages typically have precedence so you'd end up in a situation where `choosenim` would install Nim and put it in your path but your shell will find the homebrew version first and use that.
13:18:27FromDiscord<flywind> !eval import fenv; echo epsilon(float64)
13:18:30NimBot2.220446049250313e-16
13:19:49FromDiscord<flywind> Is `epsilon(float64)` a good base for `almostEqual`?
13:20:11FromDiscord<lqdev> not at all
13:20:49FromDiscord<lqdev> the machine epsilon is only precise for the first few values a float can represent, so eg. 100 + epsilon(float64) is probably gonna be equal to 100
13:21:34FromDiscord<lqdev> you're much better off using a bigger epsilon like 0.001
13:22:00FromDiscord<flywind> Yeah I mean stdlib https://github.com/nim-lang/Nim/blob/b1c3dab2089bb4327627c2152a1148b299f1a930/lib/pure/math.nim#L213
13:23:52*lf_ joined #nim
13:24:43*superbia quit (Ping timeout: 246 seconds)
13:28:32*lf_ quit (Client Quit)
13:28:34*Q-Master quit (Ping timeout: 246 seconds)
13:29:14*lf_ joined #nim
13:33:48FromDiscord<flywind> I would prefer `almostEqualxxx(x, y, 1e-9)` instead of `almostEqual(x, y, 10000)` which I need to guess the real differences of these two numbers.
13:44:58*lf_ quit (Read error: Connection reset by peer)
13:45:21*lf_ joined #nim
13:46:56FromDiscord<Rika> you have to scale the epsilon to the size of the float or smth
13:47:45FromDiscord<Rika> i always refer to this, but i cant tell if its trustworthy
13:47:46FromDiscord<Rika> https://floating-point-gui.de/errors/comparison/
13:53:52FromDiscord<juan_carlos> @ElegantBeef People that dont know Nim do not understand the benefit on the video, they do not immediately understand part is compiled part is interpreted, it needs a non-Nim description, kinda like "This shows interoperability of Nim compiled and interpreted, would be similar to embed Lua on C++" something like that.
13:54:36FromDiscord<mratsim> @flywind depending on your application you as a dev need to decide if the relative difference (percentage) or the absolute difference (magnitude) is more important
13:55:17FromDiscord<mratsim> see relative_error and absolute_error here: https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/ml/metrics/common_error_functions.nim#L35-L66
13:55:42FromDiscord<mratsim> and you need to also choose the tolerance.
13:55:53Zevvyeah but people are not very tolerant these days, are they
13:56:02FromDiscord<mratsim> some applications need 1e-14 because errors get multiplied for example
13:56:36FromDiscord<mratsim> others use stochastic/random processes and so don't care about error much (like machine learning or Monte Carlo)
13:59:48*Q-Master joined #nim
14:00:38*habamax quit (Quit: leaving)
14:03:50FromDiscord<himu> sent a code paste, see https://play.nim-lang.org/#ix=2Jgt
14:05:06*Q-Master quit (Ping timeout: 256 seconds)
14:05:46FromDiscord<flywind> thanks
14:06:09FromDiscord<mratsim> echo "\u10000000"?
14:06:15FromDiscord<himu> yeah
14:07:36FromDiscord<himu> Sorry capital U
14:07:54*oddp joined #nim
14:07:54FromDiscord<mratsim> what's the capital U supposed to do?
14:08:03FromDiscord<flywind> !eval echo "\U10000000".repr
14:08:06NimBot0x55580dcad870"\225\128\1280000"
14:08:20FromDiscord<mratsim> https://play.nim-lang.org/#ix=2Jgu
14:08:28FromDiscord<mratsim> I do get unicode
14:11:50FromDiscord<mratsim> @zevv, @disruptek: everyone on the CPS bandwagon: https://www.joachim-breitner.de/blog/778-Don%E2%80%99t_think%2C_just_defunctionalize
14:13:02FromDiscord<himu> sent a code paste, see https://paste.rs/wDA
14:15:11Zevvyeah I saw that
14:15:34FromDiscord<himu> https://en.wikipedia.org/wiki/Escape_sequences_in_C. Refer to this
14:16:33FromDiscord<mratsim> probably no one used it so should be a feature request.
14:19:05FromDiscord<himu> Should I make a pull request on this one? Somehow it leads me to believe this will make nim future secured. I guess. I am writing a parser for a library of my own. I was exploring unicode support in languages. Nim has till `/u`.
14:21:25FromDiscord<mratsim> you can make a PR directly yes
14:22:00FromDiscord<mratsim> just make sure that you refer to the C escape code and maybe Python if they behave the same.
14:22:23FromDiscord<mratsim> I'm under the impression that strutils is more designed after Python.
14:23:37FromDiscord<himu> python3 supports it as well. try `print("\U00010000")`
14:28:33*narimiran quit (Ping timeout: 268 seconds)
14:28:39*narimiran_ joined #nim
14:29:03Fish-Faceis there a built in way to get the modulo operator which returns values in the range 0..n-1 rather than -n+1..n-1?
14:29:18narimiran_Fish-Face: we have `floorMod`
14:29:37Fish-Facethanks
14:29:58*lessismore joined #nim
14:30:19FromDiscord<flywind> see https://github.com/nim-lang/Nim/pull/16414
14:30:19disbotβž₯ add `euclDiv` and `euclMod` to `math`
14:31:00Fish-Facethat is... recent!
14:31:04*lessismore quit (Remote host closed the connection)
14:31:17*Arrrrrrrr1 joined #nim
14:31:52*Arrrrrrrr quit (Ping timeout: 260 seconds)
14:31:53Fish-Facewhat's the difference between `euclMod` and `floorMod`?
14:33:04FromDiscord<flywind> floorMod has same sign as b
14:33:12Fish-Faceah
14:33:18FromDiscord<flywind> euclMod: is non-negative
14:33:37Fish-Faceit has never occurred to me to use the operator with a negative b...
14:35:35FromDiscord<flywind> https://media.discordapp.net/attachments/371759389889003532/791313053387718656/unknown.png
14:36:03FromDiscord<flywind> rF is `floorMod` and rE is `euclMod`
14:36:13Fish-FaceI understood already but thanks
14:36:35FromDiscord<flywind> np
14:44:35*Q-Master joined #nim
14:48:49*Zevv quit (Ping timeout: 264 seconds)
14:55:07*Arrrrrrrr1 quit (Quit: Arrrrrrrr1)
15:03:59FromDiscord<krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=2Jh1
15:05:00*lf_ quit (Quit: lf_)
15:05:24*lf_ joined #nim
15:05:35*Zevv_ joined #nim
15:07:11*lf_ quit (Client Quit)
15:07:42*PMunch quit (Quit: leaving)
15:08:44*Arrrrrrrr joined #nim
15:20:01FromDiscord<himu> @mratsim So unicode is fully supported but we have to do `echo "\u{00010000}"` instead of the conventional approach of C and Python.
15:20:47*Zevv_ quit (Quit: leaving)
15:21:06*ico joined #nim
15:29:14*vikfret quit (Read error: Connection reset by peer)
15:43:37*lf_ joined #nim
15:53:54FromDiscord<jseb> i want to generate wasm from nim. So i've compiled my nim source wth -c option to get the source. I've found the source in the cache directory, and now ?
15:55:25FromDiscord<jseb> sent a code paste, see https://play.nim-lang.org/#ix=2Jhd
15:56:00FromDiscord<lqdev> don't forget to {.exportc.} the proc, otherwise it'll get mangled
15:57:10FromDiscord<jseb> and i think it's stripped because not used
15:57:46FromDiscord<jseb> i remember there is a switch for Β«no main()Β» , too…
15:58:52*rockcavera joined #nim
15:59:47FromDiscord<jseb> sent a code paste, see https://play.nim-lang.org/#ix=2Jhe
16:00:48FromDiscord<lqdev> yeah don't expect it to get any better
16:01:00FromDiscord<lqdev> Nim's C output isn't supposed to be human friendly
16:02:01FromDiscord<jseb> sent a code paste, see https://play.nim-lang.org/#ix=2Jhg
16:02:03FromDiscord<lqdev> ah well yeah
16:02:07FromDiscord<lqdev> -d:danger removes checks
16:02:52FromDiscord<jseb> i thought it would remove the first affectation, too
16:03:15FromDiscord<jseb> but it's probably removed by the c compiler, anyway
16:03:47FromDiscord<lqdev> Nim relies on the C compiler for simple optimizations like this
16:06:25FromDiscord<jseb> ok now i think it's a matter of sed/awk for generating missing declarations, before sending it to llvm compiler
16:07:00FromDiscord<mratsim> we have a repo generating wasm from Nim directly via nlvm
16:07:07FromDiscord<mratsim> and you can use emscripten
16:07:14FromDiscord<mratsim> or clang wasm switch
16:07:34FromDiscord<jseb> yes i was thinking using clang with wasm switch
16:08:09FromDiscord<jseb> i was wondering if it was useful to use emscripten , if i'm not interested in pre-wrapped libs like SDL
16:08:50FromDiscord<jseb> nlvm would may be prevent me for re-inventing the wheel
16:10:16*lf_ quit (Ping timeout: 240 seconds)
16:11:06ForumUpdaterBotNew post on r/nim by sigzero: Nim Apocrypha, Vol. I, see https://blog.johnnovak.net/2020/12/21/nim-apocrypha-vol1/
16:20:31*lf_ joined #nim
16:20:32FromDiscord<notchris> i wish i could access the camera on osx with nim
16:20:37FromDiscord<notchris> its been such a pain
16:20:54iconotchris: how would one do that from C or C++ then
16:21:39*ico is now known as Zevv
16:21:50FromDiscord<notchris> Good question, probably with the latest opencv or qt maybe
16:22:00Zevvif you can do it from C, you can do it from Nim
16:22:22Zevvbut honestly, I don't think opencv or qt will do anything for you
16:22:39notchrishmm
16:22:45Zevvthese might have some kidn of binding for accessing the cam, but it's not something that's offered by these libs
16:22:51notchrisyeah i tried the cv nim pkg and the qml one
16:23:15notchrisand i know on osx apps need a listing in their plist for camera access
16:23:18notchrisso its just super locked down
16:24:13Zevvyou need to find the native API on osx to do that
16:24:20Zevvthat's prbly what opencv and qt also use
16:25:21notchrisRight, they access AVFoundation
16:25:37notchrisBut i wouldnt know where to start in accessing the native api
16:25:44notchrislet alone granting camera access
16:25:50notchrisguess ill have to read a lot :)
16:26:24ZevvAnyway, your problem is not a Nim problem
16:26:49notchrishaha yeah that's fair
16:27:11notchrisif i figure it out, ill be sure to make the solution pub
16:27:26Zevvcool
16:28:37*lf_ quit (Quit: lf_)
16:30:59disrupteki had no trouble accessing your camera.
16:31:05disruptekregrets, yes, i have plenty of those.
16:33:07FromDiscord<notchris> Lol disruptek
16:33:18FromDiscord<notchris> Sorry if I’m lookin rough
16:34:40FromDiscord<mratsim> Don't look rough, disruptek will be jealous
16:36:16disrupteki'm pretty much the definition of `rough sleeper` in multiple languages and cultures.
16:37:13disruptekpmunch: i add people with numerous packages to try to coalesce ecosystems. you can offer tips to keep your stuff cooperating.
16:40:27Zevvtoday I have been working from the blanket ford. I should do that more often
16:55:20*azed joined #nim
17:00:21FromDiscord<mratsim> Zevv the blanket lord
17:02:42*lritter joined #nim
17:24:33*habamax joined #nim
17:28:32*xet7 quit (Ping timeout: 256 seconds)
17:30:17*lf_ joined #nim
17:39:19*ex_nihilo quit (Quit: Leaving)
17:47:37FromDiscord<Avatarfighter> blankets truly are heaven
17:47:44FromDiscord<Avatarfighter> they boost productivity
17:53:09ZevvIt makes me wonder
17:53:22Zevvwhy in modern houses people don't make these nooks and crannies anymore
17:53:26Zevvjust a little corner where you can hide
17:53:31Zevvwith a little bookshelf
17:54:31*superbia joined #nim
17:56:36Zevvso disruptek
17:56:36disruptekpeople don't understand the value of intimate accomodations.
17:56:49Zevvright. It's all about mΒ²
17:57:00disrupteki wanna build a house that is warren-like and dark, like my rv.
17:57:13Zevvlike an rv, but with proper insulation
17:57:15disruptekgimme 4 floors and i'll put 7 levels.
17:57:27disrupteklittle rooms. task lights.
17:57:41disrupteksomewhere designed for neckbeards to nest.
17:57:50Zevvi shaved
17:58:02disruptekall the rooms will smell like sex and contempt.
17:58:13disruptekyou shaved down there?
17:58:20Zevvdown there
17:58:23Zevvin the neck
17:58:30disruptekthe neck of the shaft?
17:58:46disrupteki had to shear myself yesterday. i couldn't take it anymore.
17:58:58ZevvI will now watch mratsims video
17:59:38Zevvto see if I can grasp this plan you two have been cooking up
18:00:00disrupteki'll tell you right now, it's a bad idea.
18:00:28disruptekit's very limited.
18:00:38Zevvthat was /my/ point
18:00:39Zevvremember
18:01:16disruptekyes, but if he wants to do it for his limited use-case, i'm fine with it.
18:01:28ZevvI was so ahead of my time. Going through mratsims list it looks like coros are really /the/ latest hype. I have been raving about them for over a decade and no one got it. They just didn't.
18:01:40Zevvok, so we agree this is not a good idea
18:01:54Zevvso I *did* understand perfectly right
18:02:01disruptekno. 😁
18:02:09disrupteklook, there are two approaches here:
18:02:30disruptekin the first, we use a ref. we can convert it around, return it, it holds the fn.
18:02:38disruptekyou're well-familiar with that method.
18:02:42Zevvright.
18:03:08disruptekin the second, we use an object. we mutate the object and return the fn. no memory access. all of cps can be rewritten as a fsm.
18:03:26disruptekreturning the fn is rewritten as returning the state.
18:03:34disruptekthe whole thing can live on the stack.
18:03:46Zevvwhats in "the object"
18:03:52Zevvthe locals, right, lifted just as they are now
18:04:02Zevvhow is that different from #1 where we don't put fn in the env object
18:04:22disruptekin #1 we /do/ put the fn.
18:04:30disrupteklike cps is now.
18:04:41Zevvthe problem for using a var object instead of a ref was the typing propagating into the trampoline, right?
18:04:48Zevvwe decided we can type-erase that
18:04:52Zevvand just ptr around
18:05:05Zevvfor generated code, that's perfectly acceptable imho
18:05:20disruptekif you use an object, what i call #2, you don't have a trampoline.
18:05:43disruptekand, really, you might not even need the object. you can use the scope itself as your object.
18:05:50disruptekit's good enough.
18:05:56Zevvno dude.
18:06:04disruptekyes.
18:06:35disruptekwhen you have vars that share scopes, they can share symbols.
18:06:41Zevvhttps://play.nim-lang.org/#ix=2Jbn where do the i's go
18:06:44ZevvI still don't understand
18:07:09Zevvdraw a circle around them in memory, with my little red crayon
18:07:36disruptekthe i's don't go anywhere.
18:07:59Zevvooh, the i's don't go anywhere. now it makes sense
18:08:09disruptekcounter disolves from a proc into inline code.
18:08:17Zevvthere is /state/
18:08:21disruptekdissolves? disolves?
18:08:31Zevvit has to be put somewhere. State has a location, place
18:08:33disruptektwo 's's.
18:08:49disruptekyes, inside the loop, the i's exist.
18:09:28Zevvyour earlier answer doesn't hold right? i_125143 and i_567456
18:09:33Zevvbecause there's now a random number of i's
18:10:13disruptekhmm.
18:10:23Zevvwhat kind of "hmm." is that
18:10:39disrupteki'm just thinking your example might not work.
18:10:46Zevvright.
18:10:59disruptekbut, look, the stack-based technique is inherently limited.
18:11:04disruptekit won't work all the time.
18:11:13Zevvno. but it will not work the most of the times for me
18:11:17Zevvbecause (wait, me is typing)
18:12:48Zevvhttps://play.nim-lang.org/#ix=2Jim
18:13:02Zevvreal world stuff. not making this up. this is what people do.
18:13:20Zevvsounds silly right? Like, waiting on a server socket and dynamically creating clients for each connection
18:13:35ZevvThat is what I ment with the "free floating" feeling of CPS
18:13:54disruptekyes but no; that's solved with a list of some sort. but here's the kicker that i didn't realize until i wrote the code: it's not just that the dispatcher is complicated, it's that you cannot return a continuation of a different type. that's a deal breaker for me.
18:14:10Zevvwe type erase
18:14:17Zevva continuation is a blob of bytes
18:14:34disruptektalk is cheap.
18:14:34Zevvif mratsim wants to do high-efficiency, he pools them and makes them fixed size on the stack
18:14:38disrupteki don't see how the code works.
18:14:45Zevvif I want to do this kind of stuff, I just alloc them as a ref
18:14:59disruptekyou have to be able to grow as well as shrink.
18:15:08disruptekand you cannot be limited to 400 bytes or some such bullshit.
18:15:13Zevvthat's mratsims problem
18:15:23disruptekyes, that's a #2 problem. a shitty problem.
18:15:25Zevvif you want to be dynamic, you go heap and you pay
18:15:28disrupteki don't want any part of it.
18:15:35Zevvif you want to be fast, you go mratsim an you pay something else
18:15:49Zevvbut the CPS transform /should not care shit about this/
18:15:54Zevvit's about what you build on top of it
18:15:56disruptekah, but it must.
18:16:16disruptekbecause the stack version elides the trampoline.
18:16:27ZevvI don't see that.
18:16:33disruptekand that means it's the same as the fsm, and that means it's a different rewrite.
18:16:36ZevvYou have an fn. You call it, and you get a new one, right?
18:16:40Zevvthat still holds
18:16:44disruptekno.
18:16:51Zevvthen I miss something
18:17:01disruptekthere's no reason to lambda lift because the env doesn't change.
18:17:10disruptekso you're just moving the bodies around.
18:17:35disrupteksince there's no proc pointer, there's no fn per se. there's a state variable. a static.
18:17:48Zevvok, that's the duff-device version, allright
18:17:49disrupteknow you can goto with no stack alloc.
18:18:14Zevvso you can have only one of something. or with nasty logic you cna have a fixed size maybe
18:18:31Zevvreally, write me an example of how this would look post-transform
18:18:36Zevvsomething trivial
18:18:41Zevvlike the random number of iterators
18:19:05Zevvif 'i' lives on the stack, the generated code will access that var at an address relative to the stack pointer
18:19:28Zevvevery time you come at that place, the stack pointer will be the same. So that 'i' can only reference one single memory location
18:19:31disruptekyou're going to know the value of random(10), so you alloca an array[10].
18:19:38disruptekor whatever it is.
18:19:38Zevvread the above lines
18:20:03disruptekyes, but each "stack" can live in the array.
18:20:14ZevvSo, we go messing about with the stack pointer?
18:20:21Zevvwe go poke arch-specific assembly?
18:20:25disruptekwhat? no.
18:20:49disruptekwe're talking about a for loop, right?
18:21:06Zevv /multiple instances/ of the same for loop acting on different data
18:21:08disruptekit's already an example of this.
18:21:20Zevv1 copy of the code. X copies of the data.
18:21:22Zevvagree?
18:21:47disruptekyes.
18:22:10ZevvOk. So this code boils down to some low level machine code doing relative addressing like mov r1, [sp-10]
18:22:54Zevvhow can that same code act on multiple instances of a thing?
18:22:54disruptekfor a for loop, yes; that's what inline iterators are afaik.
18:23:09Zevvinline iterators have *one instance* of a thing
18:23:16disruptekwhat thing?
18:23:18Zevvthat's the hole point. So do stackless coroutines
18:23:25ZevvA client, a counter, a whatever
18:23:29FromDiscord<exelotl> what's a good Nim library to generate a random salt for hashing passwords?
18:24:45disruptekexelotl: how much do you want to spend?
18:25:21Zevvdisruptek: does it make any sense what I'm rambling?
18:25:26disruptekyes.
18:25:30Zevvcool
18:25:46disruptekyou're right that for a `for` we probably want one piece of data.
18:26:04Zevvso here is what I think we can do to make both us and mratsim happy:
18:26:10disruptekbut for your `while true`, it needs to work differently.
18:26:12FromDiscord<exelotl> disruptek: you want me to commission you to write a library? x)
18:26:43disruptekexelotl: no, i mean you can get random numbers cheaply or at great expense depending on how clever you are and what you want to spend.
18:27:13FromDiscord<exelotl> oh right
18:27:13Zevv- we take CPS as we have it. We still generate an env, but it's an object, not a ref. It's also not a inheritence tree
18:27:22FromDiscord<exelotl> I'm just looking for a standard CSPRNG
18:27:31Zevv- the CPS functions take a pointer and cast to their right type. We mutate the data on the env.
18:27:34disruptekcan't you get that from stdlib?
18:27:55Zevv- The initial env is not allocated by the CPS bootstrap as we have now, but by the user
18:28:35Zevvso CPS still works as it does for us. We can just new() an env of a given type dynamically if we want X instances
18:28:42Zevvmratsim can make these things on the stack or in a pool or whatever
18:29:03ZevvThe code will now access 'i' not relative to the stack pointer, but relative to the pointer passed to the continuation functions
18:29:13ZevvWe can have 2. or 3. or n.
18:29:18Zevvfor a for loop, ok, we just have one
18:29:30FromDiscord<exelotl> std/random tells me "Do not use this module for cryptographic purposes!"
18:29:36FromDiscord<exelotl> there's the mersenne twister but that sux
18:29:41ZevvI do see that sp-relative code can be / will be much more efficient
18:29:45Zevvbecause that's how cpus work.
18:30:17Zevvexolotl: /dev/urandom is the way to go on linux, if that happens to be your only platform
18:30:18disruptekexelotl: i would look at nimcrypto if you think you need more than nim's PRNG.
18:31:30disruptekzevv: the problem is that i cannot return an env of a different type than that which i was passed.
18:31:36disruptekthis is a huge and novel constraint.
18:31:42ZevvAll envs are a fn and an opaque pointer
18:31:48Zevvtype-erased
18:31:52disruptekso what?
18:32:01disruptekyou're telling me i cannot perform env allocs.
18:32:13disruptekyou're telling me that the caller does this.
18:32:33Zevv /can/ do this
18:32:56Zevvthe CPS transformation can provide the info you need, which is just "how many bytes"
18:33:26disruptekoh, for the maximal size of a possible return type?
18:33:28*def- quit (Quit: -)
18:33:37ZevvFor this particular transformed CPS function, yes
18:33:50ZevvSo my little iterator will need an env of 8 bytes
18:33:51disruptekso if i just return an error, i'm still alloc'ing the entire payload.
18:34:10disrupteki think this is dumb.
18:34:12Zevvthat's what we have in current CPS as well
18:34:20Zevvwe still alloc the env.
18:34:26disruptekwe /elect/ this behavior.
18:34:37Zevvanyway, that's just my two cents.
18:34:40ZevvYou get my point, which was my point
18:34:46disrupteki do.
18:34:56Zevvone more remark: if we do type erasure, we have one pretty nasty effect
18:35:05Zevvis that we lose automatic life time memory management of closures
18:35:16Zevvbecause if we new() something but then just pass the pointer around
18:35:28disruptekyes, but it's worse than that.
18:35:29Zevvwho will take care of freeing up the stuff when the time has come
18:35:41disruptekiirc, we don't have /any/ cast in cps right now.
18:35:51*lf__ joined #nim
18:36:10ZevvHm wait, if we go casting about, do we lose JS ?
18:36:26Zevvor even VM?
18:36:34disruptekdunno, but i am going to proceed with the current ref-based technique.
18:36:41Zevvsame here
18:36:45Zevvnice.
18:36:46*def- joined #nim
18:36:54Zevvglad we have the same idea on this again
18:36:58Zevvthought I lost you buddy
18:37:11disruptekmratsim knows enough to impl it his way, but i frankly don't have a use for such an animal and i think it's a weak abstraction.
18:37:14Zevvcrazy talk you did there yesterday
18:37:48Zevvso, what I think we should/could/might try still, is to see if we can make this so that it is also usable for the mratsim use case
18:37:58*lf_ quit (Ping timeout: 246 seconds)
18:38:15disruptekwe can support objects, but beyond that, i think he's on his own.
18:38:18Zevvbut he's in a different league. He's perfectly fine with pointer casting data and doing all allocations manully for sake of performance
18:38:25disruptekand even supporting objects is going to be hard.
18:38:28Zevvdid you ever try weave?
18:38:34disruptekno.
18:38:51disrupteki don't care about CPU. i have CPU coming out of my ears.
18:39:08ZevvThis is how you get your data into weave: cast[ptr UncheckedArray[float32]](input[0].unsafeAddr)
18:39:14Zevvno other way
18:39:25Zevvand sure, I get that. why and how.
18:39:36disruptekthis is not abstraction.
18:39:41Zevvbut you don't want to sprinkle that burden around
18:39:43Zevvjust because
18:39:54Zevv"# We can't work with seq directly as it's managed by GC, take a ptr to the buffer"
18:40:13Zevvand if weave is done you go "let out = cast[ptr UncheckedArray[float32]](output[0].addr)"
18:40:24*krux02 joined #nim
18:40:57Zevvoh, no you also do that before :)
18:40:58Zevvnevermind
18:41:00Zevvyou get my .
18:41:15disruptekright.
18:41:45disruptekit's not that i care that much about js.
18:41:49disruptekit's that js keeps me honest.
18:42:00Zevvexactly
18:42:08Zevvif this can go 100% nim, that's a huge pro
18:42:38Zevvbut we also can't lose mratsim on this
18:42:44Zevvbut it's just that we totally speak a different language
18:43:39disruptekhe's approaching it from a different direction. we should be able to share a lot of work even if we cannot share the ultimate composition.
18:44:33Zevvright. and that's where we should aim at.
18:45:24Zevvso maybe CPS can just have this tiny little switch somewhere. Like, flag = enum xfrmDisruptek, xfrmMratsim
18:45:47disrupteklol no we'll just look at the type.
18:48:35Zevvso, you can tell him :)
18:48:41disruptekhaha
18:50:44disrupteki need to create two new libraries and i just don't wanna. one for package management and one for meta-programming.
18:52:27Zevvdont go there man
18:52:36Zevvtoo many libraries is just not good for you
18:54:10*azed quit (Ping timeout: 272 seconds)
18:54:32notchrisdisruptek: oo like getters/setters?
18:55:32*hnOsmium0001 joined #nim
18:56:24*azed joined #nim
18:57:25disruptekno, i'm an asshole, not an idiot.
18:57:41notchrisdisruptek: thats why im a fan
18:58:14disrupteki... what?
18:58:33notchrisdisruptek: idk but im following you now on gh
18:58:40disruptekalso it's time to add .dot output to gram.
18:58:44disruptekwhich sucks.
18:59:13disrupteknotchris: can you recommend other assholes to follow?
18:59:21notchrisdisruptek: did you follow me back? thats one
18:59:45disrupteklol
19:00:04notchrisi would put more effort into your request but i just ate a big sandwich
19:00:10notchrisin recovery
19:00:22disrupteki feel you.
19:00:57disruptekyou only have four repos pinned and none of them are nim.
19:01:06disruptekwhat a prick. take my follow.
19:01:10notchrisYES
19:01:15*lf__ quit (Quit: lf__)
19:01:54notchristhat's sad, i need to finish one of my nim projects
19:02:09notchrisbeen messing a lot with gintro last week
19:02:18notchriswanna try to get gtk4 working
19:02:27disruptekwhat's the holdup?
19:02:52notchrissome issue with brew iirc
19:02:55notchrisi have to look again
19:03:12notchrisim on osx so you know, things are twice as hard
19:03:48disrupteki ran gentoo prefix on osx back in the day, but it wouldn't have occurred to me to use brew and gtk4 in the same sentence.
19:04:18notchrisyeah a lot of times i have to just build manually
19:04:37notchrisi had to do that to get the qt/qml nim package working
19:05:03disruptekjust think about the cumulative amount of hours wasted on such shit.
19:05:31notchrisi try not to, its like looking back at how much time i spent in time at cvs
19:05:36notchrisin line
19:05:46notchrisbecause they havent figured out how to replace cashiers with robots
19:06:08disruptekoh, i was about to say... i thought i was the only person i knew who lived in a cvs.
19:06:23disruptekbaby diapers are incredibly comfortable.
19:06:35disrupteki'm sad i grew out of them.
19:06:57disruptekbut seriously, when the zombies invade, make for a cvs.
19:07:18notchrisCVS: A New Hope
19:08:35notchrisI found this recently
19:08:36notchrishttps://github.com/yglukhov/darwin
19:08:44notchrisit gave me hope i could access native osx apis
19:08:52notchrisbut never made progress with it
19:09:07disrupteki'd look into how python does it.
19:09:31notchrisYeah i mean im by no means a great programmer but
19:09:39notchrisi should at least be able to see where the connection happens
19:10:06disruptekwhy don't you just install a real os?
19:10:58notchrisI mean, i have windows and linux
19:11:11notchrisi like the osx gui the best
19:11:43notchrisand osx is more locked down, meaning less competition for the things i want to make
19:11:55disruptekthat's the most compelling argument right there.
19:12:03disruptekwhy not compile your nim to objc?
19:12:08notchrisvalid
19:12:19notchrisive heard that recommendation before but im not there yet
19:12:25notchrisfor some background, i come from JS land
19:12:32notchrisand typescript
19:12:34disruptekoh, the land that time forgot?
19:12:34Zevvtoo late. we lost: https://tokio.rs/blog/2020-12-tokio-1-0
19:12:38notchrisdisruptek: exactly
19:12:42Zevv"multi-threaded, work-stealing scheduler"
19:13:38notchrisI see a lot of Rust fans as well
19:13:58disruptekzevv: nah, it's still mio-based.
19:13:58notchrisNot too familiar with it
19:15:29disruptekrust is pretty good.
19:17:28notchrisbut yeah when i was looking into accessing the camera on a mbp via nim
19:17:36notchrisi found out you need a plist entry to grant auth
19:17:43notchrisand i did find a nim lib to generate plists
19:17:47notchrisso idk, theres hope i guess
19:18:14disruptekplists are just xml.
19:18:22*Jesin quit (Quit: Leaving)
19:18:29notchrisdoes the `p` stand for preference?
19:18:35disruptekwho cares?
19:18:42notchristouche
19:20:38notchrisdisruptek: im glad we're friends now
19:20:57disruptekyeah, it's pretty fucking great.
19:21:50notchrisim probably useless to you from a code standpoint, but i make free music
19:21:54notchrishttps://notchris.net
19:21:56notchrisnjoy
19:22:14disruptekwe need that for the stream now that twitch is shitting all over us thieves.
19:22:46disruptekmratsim: your weave tests require cligen, you aboriginal nimble author, you.
19:24:47*Jesin joined #nim
19:25:50*habamax quit (Ping timeout: 256 seconds)
19:27:49*Q-Master quit (Ping timeout: 264 seconds)
19:36:47*lritter quit (Quit: Leaving)
19:39:02*vsantana quit (Ping timeout: 256 seconds)
19:41:09*vsantana joined #nim
19:44:27*D__ joined #nim
19:44:32*D_ quit (Ping timeout: 256 seconds)
19:54:12*Q-Master joined #nim
19:56:36*Arrrrrrrr quit (Ping timeout: 240 seconds)
19:57:43*Arrrrrrrr joined #nim
19:59:10*Q-Master quit (Ping timeout: 246 seconds)
20:00:40*rockcavera quit (Ping timeout: 272 seconds)
20:01:00*oddp quit (Quit: quit)
20:04:53FromDiscord<nikki> accessing camera just means using the AV apis and yeah your application's Info.plist needs permissions. you don't need to write the plist from Nim, you can just write it by hand
20:04:58FromDiscord<nikki> or from Xcode
20:05:23FromDiscord<nikki> write some foo.m file with obj-c in it, and have some C funcs it exposes
20:05:31FromDiscord<nikki> then call those from Nim
20:05:44*vsantana_ joined #nim
20:07:03*vsantana_ quit (Client Quit)
20:08:48*Q-Master joined #nim
20:08:49*narimiran_ quit (Ping timeout: 265 seconds)
20:09:06FromDiscord<notchris> thanks @nikki i will do my best :X
20:09:18*vsantana quit (Ping timeout: 265 seconds)
20:12:23FromDiscord<shadow.> notchris we live very close to each other πŸ’€
20:12:45FromDiscord<shadow.> nice music btw
20:12:54FromDiscord<notchris> @shadow. Ooo CT? Thank you!
20:13:02FromDiscord<shadow.> yep haha
20:13:21FromDiscord<notchris> Ah! It's rare but it happens. I'm in manchester currently
20:13:34FromDiscord<shadow.> yeah thats about a 25 minute drive lmao
20:13:54FromDiscord<notchris> Hell yeahhh feel free to chill and code whenev
20:13:59FromDiscord<shadow.> loll
20:14:18FromDiscord<shadow.> currently struggling with today's aoc
20:14:26FromDiscord<shadow.> can't decide between a linked list or a linked ring
20:14:30FromDiscord<shadow.> rip
20:14:43FromDiscord<notchris> ah i didn't try it out this year
20:14:49FromDiscord<notchris> ik its always super hard though haha
20:14:59FromDiscord<shadow.> yeah i've gotten this far so i'm not aboutta drop it
20:15:06FromDiscord<shadow.> i did skip day 20 part 2 but so did everyone else lol
20:15:16FromDiscord<notchris> oh man that difficult?
20:15:28FromDiscord<shadow.> well
20:15:31FromDiscord<shadow.> aoc started with 130k people
20:15:40FromDiscord<shadow.> only 10k ppl did day 20 part 1 (including me)
20:15:43FromDiscord<shadow.> and only 5k ppl did part 2
20:15:48FromDiscord<notchris> holy crap lol
20:15:51FromDiscord<shadow.> i wasnt able to do part 2, or rather i didn't wanna write 250 lines of code
20:16:05disruptekthat's a lot of people with too much time on their hands.
20:16:11FromDiscord<shadow.> yep
20:16:22FromDiscord<shadow.> or too little sunlight
20:16:26FromDiscord<notchris> id never be able to keep up with new anime and balance that
20:16:26disrupteki keep looking at that testes pr languishing due to aoc.
20:16:43FromDiscord<notchris> lol yeah i saw that come up on gh
20:16:54FromDiscord<shadow.> lol
20:17:22FromDiscord<notchris> @shadow. ever go to the ct science center?
20:18:16FromDiscord<shadow.> yep
20:18:17FromDiscord<shadow.> haha
20:18:21FromDiscord<shadow.> it's a cool place
20:18:23FromDiscord<notchris> nice i used to be head dev there!
20:18:28FromDiscord<shadow.> damnn
20:18:29FromDiscord<shadow.> how long ago?
20:18:47FromDiscord<notchris> hmm its been like 2.5 years now
20:18:54FromDiscord<notchris> I was there for about 5 years
20:19:03FromDiscord<shadow.> then i def went there while you were head dev lol
20:19:15FromDiscord<notchris> Hell yea!
20:19:29FromDiscord<shadow.> man do i love just doing `T.toSeq.proc` whenever i need to
20:19:30FromDiscord<shadow.> lmao
20:19:39disruptekyou guys may have taken a shit in the same toilet.
20:19:45FromDiscord<shadow.> most likely have
20:19:48FromDiscord<shadow.> i might try to make a lazy iteration library
20:19:58FromDiscord<shadow.> lazy evaluation
20:20:05FromDiscord<shadow.> i know that makes me sound like a rustacean but so be it
20:20:13disruptek!repo cps
20:20:14disbothttps://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim πŸ”— 15 42⭐ 2🍴
20:20:16FromDiscord<shadow.> i like being able to do `T.map()` without an issue
20:20:21FromDiscord<shadow.> hm?
20:20:26FromDiscord<shadow.> i was talking more generics fp
20:20:39FromDiscord<shadow.> nvm
20:20:42FromDiscord<shadow.> i think i mixed up my terms
20:20:55leorize[m]you can use cps as the backbone is what he meant
20:21:00FromDiscord<shadow.> ohhh
20:21:03FromDiscord<shadow.> fair enough
20:21:26FromDiscord<shadow.> idk im just thinking like a lot of functions in sequtils construct seqs which probably isn't that efficient
20:21:40FromDiscord<shadow.> i kinda like the `T.iter().proc().proc().collect()` approach rust has
20:21:51FromDiscord<shadow.> as in dont collect until the end of the iter chain
20:22:09FromDiscord<notchris> i never used the public toilets
20:22:11FromDiscord<shadow.> rip
20:22:12FromDiscord<notchris> so unlikely
20:22:19leorize[m]nim's zero_functional does exactly that
20:22:25leorize[m]afaik
20:22:29FromDiscord<shadow.> google time
20:22:29disruptekyes.
20:22:31FromDiscord<notchris> i used the public water fountains though
20:22:39disruptekNO WAY!
20:22:45FromDiscord<shadow.> yep that's what i was looking for
20:22:49FromDiscord<shadow.> ah yes we've definitely drank the same water
20:22:57FromDiscord<shadow.> well i've probably shitted somewhere in manchester too
20:23:26disrupteksometimes i look around manchester and it's hard to tell what /hasn't/ been shit on.
20:24:10FromDiscord<notchris> @shadow. so youre in central ct or?
20:24:20FromDiscord<shadow.> probably a little north of there but yeah
20:24:32FromDiscord<notchris> Wow rly close
20:24:33disruptekhe's not sure /where/ he is.
20:24:35FromDiscord<shadow.> im near the capital
20:24:38FromDiscord<shadow.> west of it
20:24:39FromDiscord<shadow.> lol
20:24:47FromDiscord<notchris> so west hartford
20:24:48FromDiscord<shadow.> yes
20:24:49FromDiscord<shadow.> lol
20:25:05FromDiscord<notchris> ever eat at black bamboo?
20:25:07FromDiscord<shadow.> yep
20:25:10FromDiscord<shadow.> haha
20:25:10FromDiscord<notchris> so good right
20:25:15FromDiscord<shadow.> very
20:25:20FromDiscord<notchris> i have a crush on a girl who works there
20:25:23FromDiscord<shadow.> lmaoo
20:25:25FromDiscord<shadow.> good luck
20:25:27FromDiscord<notchris> ikr
20:26:09FromDiscord<shadow.> just flex your knowledge of pointers and references and she'll be all over you
20:26:17*Arrrrrrrr quit (Quit: Arrrrrrrr)
20:26:51FromDiscord<notchris> _considers this_
20:26:53FromDiscord<shadow.> "are you a linked list because i'm trying to O(1) insert my value?"
20:27:04FromDiscord<shadow.> it works every time, trust me
20:27:11FromDiscord<notchris> lol yeah im not bringing you as my wingman/lady w/e
20:27:17FromDiscord<shadow.> probably not a good idea
20:27:39FromDiscord<notchris> well, looks like we're best friends now
20:27:51FromDiscord<notchris> sorry disruptek
20:28:18FromDiscord<shadow.> rip/
20:28:19FromDiscord<shadow.> (edit) "rip/" => "rip."
20:28:31FromDiscord<shadow.> it's ok he has his hookers
20:29:02FromDiscord<notchris> then i dont feel as bad
20:29:03FromDiscord<notchris> tbh
20:29:03FromDiscord<shadow.> if you have another nitro boost you should boost nim πŸ˜‰
20:29:14FromDiscord<shadow.> we'd be at level one i think lol
20:29:18FromDiscord<shadow.> afaik im the only booster πŸ˜”
20:29:21FromDiscord<shadow.> (edit) "πŸ˜”" => ":blobpain:"
20:30:16FromDiscord<notchris> i boosted my anime server twice tho
20:30:19FromDiscord<notchris> i have none left :X
20:30:20FromDiscord<shadow.> f
20:30:25FromDiscord<shadow.> lemme see if i can boost this one again
20:30:27FromDiscord<notchris> we dont even use the animated server icon
20:30:54FromDiscord<shadow.> but the hip members of the nim programing language discord wanna use all the emojis https://media.discordapp.net/attachments/371759389889003532/791402477890830386/unknown.png
20:31:07FromDiscord<notchris> oh shitttt
20:31:10FromDiscord<shadow.> haha
20:31:14FromDiscord<shadow.> im /j
20:31:40FromDiscord<notchris> sometimes i drive to wh /newington
20:31:44FromDiscord<notchris> just to go to california pizza kitchen
20:31:49FromDiscord<notchris> and watch people walk into the mall
20:31:50FromDiscord<shadow.> can't say i've been there
20:31:53FromDiscord<shadow.> ah the mall
20:31:54FromDiscord<shadow.> westfarms?
20:31:57FromDiscord<notchris> yeaa
20:32:03FromDiscord<shadow.> my gf lives near there lol
20:32:25FromDiscord<notchris> i used to live in new britain so i was p close
20:32:30FromDiscord<notchris> so glad i dont anymore
20:32:30FromDiscord<shadow.> nice nice
20:32:32FromDiscord<shadow.> ah lol
20:33:01FromDiscord<shadow.> hmm
20:33:05FromDiscord<shadow.> this problem is still hurting my head
20:33:55FromDiscord<notchris> i have to do issues at work for another 90min
20:33:59FromDiscord<notchris> then i think we have tomorrow off
20:34:02FromDiscord<notchris> im not 100% sure tho
20:34:07FromDiscord<shadow.> welp, good luck
20:34:09FromDiscord<shadow.> im already on break
20:35:55FromDiscord<notchris> Woo i just confirmed we do
20:36:02FromDiscord<notchris> btw which anime is in your avatar
20:36:39FromDiscord<shadow.> karma from assassination classroom
20:36:58FromDiscord<shadow.> i just needed to immaturely flex my nitro so yk
20:37:02FromDiscord<shadow.> got a gif and the #0001 tag
20:37:03disruptekkarma's a bitch.
20:37:16FromDiscord<notchris> @shadow. ah me too
20:37:22FromDiscord<notchris> im notchris 0001 right
20:37:26FromDiscord<shadow.> "yeah that's right, i can afford to pay 5 dollars for a useless discord premium, suck it." << my ideaology
20:37:36FromDiscord<shadow.> quite the flex, i know, i know
20:37:39FromDiscord<shadow.> lmao
20:37:45FromDiscord<shadow.> and yes, your tag is 0001
20:40:04FromDiscord<shadow.> my head still hurst
20:40:07FromDiscord<shadow.> this problem is odd
20:40:18FromDiscord<shadow.> yesterday's was fun after i spent 2 hours trying to figure out what i did wrong
20:40:25FromDiscord<shadow.> when in fact i was just making my params immutable and shadowing
20:40:28FromDiscord<shadow.> instead of mutable
20:40:31FromDiscord<shadow.> so that was lovely
20:40:32FromDiscord<notchris> ok im flexing now @shadow.
20:40:38FromDiscord<shadow.> there we go
20:40:39FromDiscord<shadow.> perfect
20:40:51FromDiscord<notchris> lmao
20:41:14FromDiscord<shadow.> man its like this was just asking me to use a linkedring
20:41:24FromDiscord<shadow.> i mean it needs O(1) middle insertion and wraparound indexing
20:41:28FromDiscord<shadow.> wraparound logic
20:42:07FromDiscord<notchris> its a sign
20:42:33FromDiscord<shadow.> true
20:44:36FromDiscord<shadow.> hmm
20:44:44FromDiscord<shadow.> i know you can do `var a, b = v`
20:44:48FromDiscord<shadow.> but can you do `a, b = v`
20:45:04FromDiscord<shadow.> because that would be lovely
20:45:08FromDiscord<notchris> like destructuring?
20:45:11FromDiscord<shadow.> well
20:45:13FromDiscord<shadow.> no
20:45:21FromDiscord<shadow.> just assigning to things to the same variable outside of a definition
20:45:24FromDiscord<notchris> ah
20:45:45FromDiscord<shadow.> var a, b = 5↡a, b = 6↡assert (a, b) == (6, 6)
20:45:46FromDiscord<shadow.> ya feel?
20:46:05FromDiscord<shadow.> idk whatever it's not that bad to write the other line
20:46:56FromDiscord<notchris> ahh
20:47:00FromDiscord<notchris> ok yeai. see
20:47:25FromDiscord<shadow.> lol
20:47:40FromDiscord<shadow.> i can only imagine what part two is gonna be like
20:52:59*bozaloshtsh quit (Quit: ZNC 1.7.5 - https://znc.in)
20:53:14*bozaloshtsh joined #nim
20:53:14*bozaloshtsh quit (Changing host)
20:53:14*bozaloshtsh joined #nim
20:53:17FromDiscord<notchris> @shadow. i dmed u my life story
20:55:39FromDiscord<shadow.> gotchu
21:03:16FromDiscord<notchris> lmao
21:05:49FromDiscord<Shucks> Umm, is there a pass nim compiler pragma? Trying to hardcode `skipProjCfg`
21:06:04disrupteknope.
21:07:18FromDiscord<shadow.> hmmm
21:07:32FromDiscord<shadow.> has anyone else had issues with `SinglyLinkedRing.find(T)`?
21:07:35FromDiscord<shadow.> seems to be infinitely stalling for me
21:07:53PrestigeCan you show a code example?
21:08:31FromDiscord<19> trying to follow the Nim invocation from C example on windows, getting undefined reference to NimMain when i use `gcc`
21:08:47disruptekuse --app:lib
21:09:26FromDiscord<shadow.> prestige: sure
21:09:44FromDiscord<shadow.> https://play.nim-lang.org/#ix=2Jjl
21:09:47FromDiscord<shadow.> stalls on the 3rd iteration
21:10:08FromDiscord<19> now it says undefined reference to imp_NimMain
21:10:35FromDiscord<shadow.> i did some debug prints and it seems to be stalling on line 33
21:10:55FromDiscord<Daniel> If i understand corerctly, firist it was c2nim, then nimgen, then the final tool nimterop which superseded all of previous ones...or am i missing something?
21:11:16disruptekyeah; c2nim and nimterop are competitive impls.
21:11:22Prestigehm maybe a bug then
21:11:25*ex_nihilo joined #nim
21:11:38FromDiscord<shadow.> yep, stalls on playground too
21:11:41*ex_nihilo quit (Remote host closed the connection)
21:11:56FromDiscord<shadow.> odd
21:12:33*ex_nihilo joined #nim
21:12:41FromDiscord<shadow.> fuck this is gonna ruin my aoc if i cant use a linked ring lol
21:13:40*ex_nihilo quit (Remote host closed the connection)
21:13:59PrestigeI believe it's calling https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/collections/lists.nim#L331
21:14:44*ex_nihilo joined #nim
21:15:15FromDiscord<shadow.> hm?
21:15:16FromDiscord<shadow.> yeah
21:15:20FromDiscord<shadow.> that's what it's calling
21:15:24FromDiscord<shadow.> idk what part it's stalling on tho
21:15:32FromDiscord<shadow.> lemme add some debug prints inside of the module
21:16:10FromDiscord<shadow.> yeah it cant find 5
21:16:18*ex_nihilo quit (Remote host closed the connection)
21:16:18FromDiscord<shadow.> lemme check out the for loop
21:16:40FromDiscord<shadow.> yup, it's infinitely cycling
21:16:45*ex_nihilo joined #nim
21:17:20FromDiscord<shadow.> same thing happened when i tried to print the list
21:17:22PrestigeSeems like the for loop using nodes(L) is invoking the wrong iterator? Or the iterator is broken
21:17:30FromDiscord<shadow.> nah im guessing i messed up the list somehow
21:17:34FromDiscord<shadow.> printing it has the same issue
21:17:36FromDiscord<19> im generating a lib on windows and it says success but i dont get the lib file
21:17:40FromDiscord<shadow.> probably user error oof
21:17:46FromDiscord<shadow.> ill look into it
21:18:55FromDiscord<19> sent a code paste, see https://play.nim-lang.org/#ix=
21:20:41FromDiscord<shadow.> wait a minute.
21:20:45FromDiscord<shadow.> how would find on a ring even work in the first place
21:21:21FromDiscord<shadow.> nvm
21:21:39PrestigeIterator removes elements as it searches
21:21:55FromDiscord<shadow.> fair enough
21:22:17FromDiscord<shadow.> ig ill try implementing my own
21:22:26Prestigehttps://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/collections/lists.nim#L296
21:22:58Prestigeas it iterates*
21:23:09FromDiscord<shadow.> tbh i prolly just fucked up my list idk
21:23:12FromDiscord<mratsim> nimble doesn't support optional dependencies / task level dependencies, not my fault
21:23:22*hnOsmium0001 quit (Quit: Connection closed for inactivity)
21:23:32Prestigeidk shadow, maybe create a minimal example to test it out
21:23:36FromDiscord<shadow.> fair enough
21:23:38FromDiscord<shadow.> thanks
21:24:06*D__ is now known as D_
21:29:02FromDiscord<shadow.> yeah i cannot figure this out
21:29:03FromDiscord<mratsim> @zevv, @disruptek, CPS on stack vs CPS on heap should "only" require compiler help about lifetime and if a variable escapes its scope
21:30:00FromDiscord<shadow.> fuck it, time to make my own linkedring
21:30:08FromDiscord<mratsim> and it's not a narrow use case. If you write a kernel driver for say a blue tooth chip, or if you do a TLS or any other cryptographic handshake, or within a scheduler you do not want to allocate
21:30:12FromDiscord<Clyybber> disrutpek: So is https://github.com/nim-lang/Nim/issues/16389 an infinite loop or is it just hitting the limit?
21:30:13disbotβž₯ recent regression in generics as demo'd by jason package ; snippet at 12https://play.nim-lang.org/#ix=2IA6
21:30:16FromDiscord<mratsim> allocate is very last resort
21:30:17FromDiscord<Clyybber> That is what timothee is asking
21:30:51FromDiscord<mratsim> And it would be sad to have the one thing that simplify 80% of embedded development (state machines) be something they can't use.
21:31:46FromDiscord<mratsim> also in many case, the CPS object will be part of a larger ref
21:32:00FromDiscord<mratsim> and you can pay the allocation only once if CPS is a plain object.
21:32:16disruptekclyybber: it's >100 and <150 insts. not infinite.
21:32:27FromDiscord<Clyybber> then tell him on github
21:32:33FromDiscord<Clyybber> thats all he was asking
21:32:40FromDiscord<Clyybber> :P
21:32:48disruptekfine. i don't have a web browser right now. but, soon, maybe.
21:33:02FromDiscord<Clyybber> oh updating?
21:33:04disruptekmratsim: no, because i want my cps to be able to instantiate new envs.
21:33:20disruptekfinally dumping my last btrfs because i can't fucking take it anymore.
21:33:56FromDiscord<mratsim> instantiate new envs?
21:34:04disrupteki would rather "waste" nvme with my chromium profile thrashing then deal with btrfs over san.
21:34:10FromDiscord<Clyybber> disruptek: Ah, because of the 5.10 perf regression?
21:34:13disruptekthan, too.
21:34:27disruptekno, it's the instability that i cannot tolerate.
21:34:37disrupteklooking forward to bcachefs.
21:34:41FromDiscord<Clyybber> Same
21:34:47FromDiscord<Clyybber> My home is on bcachefs
21:34:48disruptekmratsim: yes.
21:35:04FromDiscord<Clyybber> But the rest is still on btrfs; although I haven't had any problem with btrfs
21:35:05FromDiscord<mratsim> what does it mean, and what is it used for?
21:35:20disruptekit's in mainline now? i thought it was but the web-site says it isn't.
21:35:27FromDiscord<Clyybber> no, its not
21:35:33FromDiscord<shadow.> prestige: starting to think this is a bug
21:35:35disruptekmratsim: cps currently lets you return an entirely new continuation.
21:35:42FromDiscord<Clyybber> but its addressed all its review comments
21:35:52FromDiscord<Clyybber> but probably won't end up in 5.11
21:35:59disruptekthat's okay.
21:36:01FromDiscord<Clyybber> since the merge window is closing in a wekk I think
21:36:12disrupteki will settle for ext4. works great across my san.
21:36:23FromDiscord<mratsim> I don't see why ref vs stack prevents returning a new continuation.
21:36:24*rockcavera joined #nim
21:36:53disruptekwell, i await your PR. 😁
21:37:08FromDiscord<mratsim> for now I'm designing, top down
21:37:48FromDiscord<mratsim> sent a long message, see http://ix.io/2JjA
21:37:51FromDiscord<mratsim> and will do the same with continuations
21:38:01FromDiscord<Clyybber> disruptek: Btw, since ryu's tables are too big I ported grisu2; its tables are only 1kb which is great compared to sprintf's 4kb
21:38:08FromDiscord<Clyybber> and its also faster
21:38:21disruptek!repo lemonboy/dtoa
21:38:22disbothttps://github.com/LemonBoy/dtoa.nim -- 9dtoa.nim: 11Port of Milo Yip's fast dtoa() implementation 15 5⭐ 1🍴
21:38:28FromDiscord<Clyybber> oh no
21:38:30FromDiscord<Clyybber> fuck
21:38:35FromDiscord<Clyybber> thats the exact one I ported
21:38:37FromDiscord<Clyybber> bruh
21:38:45disruptekbut, it's fine. i'm sure yours is licensed, at least.
21:39:23FromDiscord<Clyybber> I want to put it in the stdlib
21:39:26FromDiscord<Clyybber> replace the $
21:39:36disruptekput it in dist.
21:40:21FromDiscord<Clyybber> it has to be put in the stdlib, so that the stdlib doesn't use sprintf anymore and the 4kb tables don't get generated
21:41:36disruptekultimately, yes, but i don't trust the compiler any more and i specifically don't trust stdlib.
21:41:49FromDiscord<Clyybber> thats cool, but I do
21:41:53disruptekbut whatever. i cannot win this battle.
21:42:08FromDiscord<mratsim> can someone explain to me why I have an extra 0 at the end? https://play.nim-lang.org/#ix=2JjB
21:42:17FromDiscord<Clyybber> yeah; not sure what battle you are fighting; I think dist is a great idea though; fusion as it should be
21:42:50disruptekclyybber: i have red all over my project dashboard. all the fucking time.
21:43:05disrupteki give up on cpp.
21:43:18FromDiscord<Clyybber> you probably test the most extensively
21:43:57disruptekgive me some thoughts in the dist discussions. i want to hear ideas on how it should work.
21:44:35disruptekmratsim: there's a thing where loops run their tails.. probably clyybber will say i'm wrong, but it happened to me.
21:44:57disruptekand, no, i didn't really read your code.
21:45:03FromDiscord<Clyybber> disruptek: I don't think we should use --nimblePath
21:45:31FromDiscord<Clyybber> not even nimble uses it
21:45:44disrupteknimble is hardly a paragon of design excellence.
21:45:53FromDiscord<Clyybber> nimblePath is bad
21:45:56disrupteknimph uses it and it works really well for having multiple distributions.
21:46:14FromDiscord<Clyybber> what can nimblePath accomplish that --path can't?
21:46:17disrupteki have, like, my shashlick tree, my treeform tree, my disruptree, etc.
21:46:37FromDiscord<Rebel> For a fairly complex Nim project let's say around 2000 lines and you build it in debug mode how long would you expect to zip up the generated files? Attempting to zip up those generated files with Python takes 10+ minutes (stopped after 15 minutes of waiting :/)
21:46:49disruptektrivial configuration. no need to reconfigure projects when you change your distribution.
21:47:26disruptek2000 lines? i'd say under a second.
21:48:00disruptekit takes me like 90s to build nimph, with FFI and >500k lines of nim.
21:49:56FromDiscord<Clyybber> disruptek: My idea of fusion/dist was having it just be a preinit .nimble
21:50:18FromDiscord<Clyybber> is dist tied to nimph?
21:50:22FromDiscord<Clyybber> or tied to nimble?
21:50:28disruptekneither.
21:50:48FromDiscord<Clyybber> so do you do nim c --nimblePath:yourdistfolder yourself?
21:51:02disrupteki don't do anything, yet.
21:51:11FromDiscord<Rebel> Is Python really just that slow?
21:51:15disruptekyes.
21:51:19FromDiscord<Clyybber> ok, I think its not good to rely on nimblePath staying in the compiler
21:51:28disruptekrebel: i'm j/k. you're probably reading stdin.
21:51:55FromDiscord<Rebel> ?
21:52:07disruptekclyybber: in my software, i use a combination of local deps and --nimblePath, but my local deps are specified using --nimblePath in any event.
21:52:27disruptekrebel: make sure your python-based zip isn't in i/o wait.
21:52:47disruptekclyybber: nimph merely specifies --path statements for stupidly-structured packages.
21:52:57FromDiscord<Rebel> sent a code paste, see https://play.nim-lang.org/#ix=2JjH
21:53:25FromDiscord<Rebel> Well O(N^2) is a bit yikes so yeah I could just use built in commands try that lol
21:53:31disruptekdoesn't that just write the filename?
21:54:24disruptekclyybber: to put that another way, nimph merely specifies paths for packages that cannot be imported otherwise.
21:55:35FromDiscord<Rebel> No? Regardless I have an idea and will just use an asyncio subprocess call with tar or zip and see how that fairs as that will just call a C binary that is much faster
21:55:52disruptekjust use zippy, chucklehead.
21:55:54disruptek!repo zippy
21:55:55disbothttps://github.com/guzba/zippy -- 9zippy: 11Pure Nim implementation of deflate, zlib, gzip and zip. 15 68⭐ 4🍴 7& 1 more...
21:56:37FromDiscord<Rebel> oh
21:57:12FromDiscord<Rebel> Fair
22:00:40FromDiscord<ElegantBeef> @juan_carlos well the video is outdated anyway, so i guess i should rerecord it πŸ˜„
22:00:57disrupteki pictured you fatter.
22:02:07FromDiscord<ElegantBeef> Quit picturing me
22:03:28*Vladar quit (Quit: Leaving)
22:04:37Prestige@shadow. I also was thinking it is a bug
22:05:37disruptekbeef: but i'm almost there.
22:05:50FromDiscord<ElegantBeef> I dont care if you're coming or going
22:08:22disruptekif i had a nickel...
22:09:06FromDiscord<ElegantBeef> You'd be less hungry
22:10:52disruptekclyybber: so the sum total of your advice is, "don't use that thing that currently works"?
22:11:25FromDiscord<Clyybber> well I thought you yourself wanted nimblePath gone
22:11:30FromDiscord<Clyybber> but maybe I misremember
22:13:55disruptekno, i asked araq to leave it in because it's handy.
22:13:56FromDiscord<ElegantBeef> Damn my colourise is failing tests
22:14:09FromDiscord<ElegantBeef> Well i give up, we'll never have nice coloured outputs πŸ˜›
22:14:15FromDiscord<Clyybber> woot
22:14:24disruptekgood, now we can work on something useful.
22:14:49FromDiscord<Clyybber> Beef: Btw, can you make the "is" in "is immutable not var" not be colored?
22:14:54FromDiscord<Clyybber> I think it would look better
22:15:05FromDiscord<ElegantBeef> I can
22:15:19FromDiscord<ElegantBeef> Lol disruptek, i dont know if you noticed, i dont do much useful developing
22:15:34disrupteki'm not talking about you, obviously.
22:15:49disruptekclyybber: don't you want me to test stuff?
22:16:02FromDiscord<Clyybber> I don't know?
22:16:09FromDiscord<Clyybber> What should I want you to test
22:16:41disruptekit depends on whether you want to learn about regressions from users or from CI.
22:17:00FromDiscord<Clyybber> am I regression-man now?
22:17:05FromDiscord<Clyybber> thats a lame superhero
22:17:10disruptekyou're the only dev here.
22:17:20FromDiscord<Clyybber> heh
22:17:29FromDiscord<Clyybber> whaddabaddayou?
22:17:41FromDiscord<Clyybber> but anyways; tell me what regressed
22:18:11disrupteklike, what doesn't work right now?
22:18:18FromDiscord<Clyybber> sure
22:18:28disruptekjason.
22:18:28FromDiscord<Clyybber> but not the usual concepts pls; I know that already :p
22:18:33FromDiscord<Clyybber> aight
22:18:48disruptekand skiplists demonstrates a pretty bad bug on windows with gc:arc.
22:18:52FromDiscord<Clyybber> but it works with a higher instantiation limit right?
22:18:56disruptekyes.
22:19:06FromDiscord<Clyybber> disruptek: That I can't debug; I don't have a windows machine
22:19:14disrupteki have the same problem.
22:19:25FromDiscord<Clyybber> Yeah; araq will have to take a look at that one
22:19:56disruptekit's actually my bloom filter, if you can believe it.
22:19:58FromDiscord<ElegantBeef> Clyybber any idea why my tests are writting hints out in some cases causing messages to be different? πŸ˜„
22:20:02disruptekat least, i think it is.
22:20:12FromDiscord<Clyybber> Beef; I'll take a look
22:21:34FromDiscord<Clyybber> @ElegantBeef are they though?
22:21:42FromDiscord<Clyybber> I think it might be your color sequences
22:21:54FromDiscord<ElegantBeef> It shouldnt be using them
22:22:03*klaufir_ quit (Ping timeout: 260 seconds)
22:22:06FromDiscord<ElegantBeef> assuming `--color:off` is set
22:22:32FromDiscord<Clyybber> but the failing tests don't explicitly set --color:off do they
22:22:37FromDiscord<ElegantBeef> I dont know
22:25:56FromDiscord<Recruit_main707> i am getting a weird error when trying to iterate over a NimNode: `for field in obj[2][2]: # Error: unhandled exception: index 6 not in 0 .. 4 [IndexDefect]`
22:36:12FromDiscord<ElegantBeef> @Clyybber colour must be off as there is no ansi code for using config, so i dont get it πŸ˜„ https://hatebin.com/ndikaunoiz
22:36:48FromDiscord<Clyybber> oh don't worry about that
22:36:50FromDiscord<Clyybber> its not the cause
22:36:58FromDiscord<Clyybber> testament only tests for subset
22:38:03FromDiscord<Clyybber> the line with the custom pragma error seems fishy
22:38:15FromDiscord<Clyybber> ah nevermind
22:40:35FromDiscord<Clyybber> heh; found it
22:40:40FromDiscord<Clyybber> @ElegantBeef its ` vs '
22:40:56FromDiscord<ElegantBeef> Oh
22:41:00FromDiscord<ElegantBeef> Ok
22:41:12FromDiscord<ElegantBeef> Gotta fix all the errors with back ticks
22:41:38FromDiscord<ElegantBeef> ConSistanCy
22:43:49FromDiscord<ElegantBeef> texplain is a weird un though
22:45:57FromDiscord<ElegantBeef> Ok so hopefully that's all of them
22:48:01FromDiscord<ElegantBeef> I should've tested before pushing, but i'm a numpty
22:52:18*MyMind joined #nim
22:53:34*Sembei quit (Ping timeout: 260 seconds)
22:56:36disruptekitym nimpty ftfy
23:10:56*xet7 joined #nim
23:13:47*superbia quit (Quit: WeeChat 3.0)
23:16:45*saem joined #nim
23:24:42saemhi, folks
23:24:54FromDiscord<ElegantBeef> Hello
23:25:11FromDiscord<ElegantBeef> It's the vscode Nim extension person πŸ˜›
23:25:42saem_a_ vscode nim extension person -- I only ported the code and rsduck has been awesome with patches.
23:25:45*azed quit (Quit: WeeChat 2.9)
23:26:09saemThanks though, I hope it's useful.
23:26:18FromDiscord<ElegantBeef> Ah
23:26:28FromDiscord<ElegantBeef> I didnt look much into it so i just assumed you were the original author πŸ˜„
23:27:14saemI added a history section to help clear that up in the readme. It does have some features and fixes the other one doesn't at this point.
23:27:33saemSome unique bugs too, because we yoloing it with no tests.
23:35:39saemApologies for my lack of knowledge of the community, @elegantbeef. I'm in the vs-code guy, which guy/gal/non-binary-pal are you? ;)
23:36:12FromDiscord<ElegantBeef> I'm the schmuck that makes random stuff, and currently is attempting to colourise the output of the compiler
23:37:19saemCool! I'm presently figuring out tests for nimsuggest and using that to also learn what I don't really get about setting up a productive dev environment for the compiler.
23:38:24FromDiscord<ElegantBeef> Dont ask me about that, i tend to just run my head into a wall and hope it doesnt get stuck
23:40:39saemWe have the same approach then.
23:40:48ForumUpdaterBotNew thread by 19: Call Nim from C on Win, see https://forum.nim-lang.org/t/7284
23:43:25disruptekweird, i have a sticky head sometimes, too.
23:44:10saemThat just means push harder until you're free on the other side, right?
23:44:27disruptekno, she hates that.