<< 20-12-2020 >>

00:00:17FromDiscord<Quibono> Dom we're not the fastest in that benchmark, tis a problem. :p
00:00:32FromDiscord<Quibono> 21st place smh
00:00:37disruptekpathetic.
00:00:40*klaufir_ joined #nim
00:01:06disrupteki didn't even know it went up to 20.
00:01:36FromDiscord<Quibono> Disruptek they added a 21st spot because everyone is a winner. ๐Ÿ˜ฆ
00:01:58disruptekthe decay of civilization, right here.
00:03:17FromDiscord<dom96> You'll never be the fastest
00:03:54FromDiscord<dom96> Unless you want to spend your life tweaking to adjust your code to fit the specific CPUs they run the benchmarks on
00:04:31disrupteki think i'd rather document async.
00:04:32FromDiscord<Quibono> I'm mostly joking because I can't code right now. ๐Ÿ˜ฎ
00:04:44FromDiscord<dom96> Not to mention you won't even get close to these RPS numbers
00:04:56FromDiscord<Quibono> How come?
00:05:01FromDiscord<dom96> Once you do you'll be able to pay a team of software engineers to tweak the code and get those last percentages
00:05:17disruptekthat sounds about as likely, yeah.
00:07:23FromDiscord<dom96> That said, something definitely happened to our performance
00:07:35FromDiscord<dom96> Round 17 https://media.discordapp.net/attachments/371759389889003532/790007450161643530/unknown.png
00:07:53FromDiscord<dom96> Round 19 https://media.discordapp.net/attachments/371759389889003532/790007526250119188/unknown.png
00:08:49FromDiscord<dom96> So actually, we can get to the top performance. The JSON benchmark is probably due to how we serialise JSON
00:08:49disruptekyer movin' in the wrong direction there, sport.
00:09:23FromDiscord<fwsgonzo> would it be possible to make Nim not zero things that can be zeroed with a fused malloc+memset (calloc) ?
00:09:57disruptekwell, you can tell it not to zero stuff.
00:10:17FromDiscord<fwsgonzo> that's fine - I like that it's not adding to the heap of undefined behavior
00:10:38FromDiscord<fwsgonzo> i just happen to be in a situation where individual memory writes are super costly compared to calloc
00:12:01FromDiscord<dom96> Either the new httpbeast is to blame or the new Nim https://github.com/TechEmpower/FrameworkBenchmarks/commit/227880491e47718f4d6a0ba380948ee2b0df5b7c#diff-74c2ce5ad03c51d2b4cb7f1eaf18912f1e99c972c5a206f6a91db8da225b277a
00:12:58*klaufir_ quit (Ping timeout: 256 seconds)
00:13:15FromGitter<gogolxdong> poll waits 500ms everytime right?
00:13:19disruptekyeah, it's probably that patchlevel release.
00:14:21FromDiscord<Quibono> So dom what would you need to do to get into top 5?
00:14:29FromDiscord<dom96> wat
00:14:49FromDiscord<Recruit_main707> the benchmark
00:14:53FromDiscord<Quibono> httpbeaaaast
00:16:00FromGitter<gogolxdong> or 50ms ,dont quite remember
00:16:13FromDiscord<dom96> poll changes shouldn't affect it
00:17:19disruptekleorize: i just noticed that the binary on windows for, say, 1.4, is 1.4.3. also, it doesn't feature the git hash in the --version. i'm rendering this from github ci, so... setup-nim.
00:17:20FromDiscord<dom96> Very interesting though, I'll have to take a look tomorrow
00:17:50disruptekgogolxdong: it's 500ms but it doesn't always consume 500ms, obs.
00:17:53disruptekobviously.
00:18:19*tane quit (Quit: Leaving)
00:18:20FromDiscord<dom96> > So dom what would you need to do to get into top 5?โ†ตFind and fix the regression ๐Ÿ™‚
00:18:35disrupteklearn concurrency.
00:18:57FromDiscord<dom96> I might even change the `$(%{"message": "Hello, World!"})` line
00:19:00disruptekleorize: and 1.2 is 1.2.9; same hash problem.
00:19:11FromDiscord<dom96> although hm, that might actually be a rule in the benchmark
00:19:18disruptekeven devel doesn't have the hash. wtf.
00:21:28FromDiscord<dom96> huh, that's pretty interesting
00:21:47FromDiscord<dom96> Pretty much all the benchmarks that were in the top 10 in 2018 are now in the top 50
00:21:47leorize[m]disruptek: that's a nightlies bug then
00:21:50FromDiscord<dom96> including tokio-minihttp
00:21:57leorize[m]hmm, did something change in the compiler :/
00:22:17FromDiscord<dom96> ulib-json seems to be the exception
00:27:28FromDiscord<shadow.> FINALLY
00:27:31FromDiscord<shadow.> aoc part one done
00:28:07FromDiscord<shadow.> that was quite hard not gonna lie
00:30:31FromDiscord<bark> is it parsing
00:31:45FromDiscord<shadow.> yeah
00:31:49FromDiscord<shadow.> parsing and then pattern matching
00:31:56FromDiscord<shadow.> that took me a few hours ngl-
00:33:35FromDiscord<KingDarBoja> `browserOptions = %{}` when a proc has this typing, how I must pass the "json" object to this? o.o
00:34:03FromDiscord<ElegantBeef> That'd be an empty jsonified object
00:34:09FromDiscord<ElegantBeef> so any jsonNode should work
00:34:48FromDiscord<ElegantBeef> !eval import json; echo (%{}).typeof
00:34:50NimBotCompile failed: /usercode/in.nim(1, 21) Error: invalid token: (\29)
00:34:54FromDiscord<ElegantBeef> Shit
00:35:20leorize[m]just pass it?
00:35:20FromDiscord<KingDarBoja> https://nim-lang.org/docs/json.html#%25%2A.m%2Cuntyped says it is untyped
00:35:26FromDiscord<KingDarBoja> I tried passing it
00:35:30leorize[m]it's just a default arg
00:35:36FromDiscord<ElegantBeef> It's untyped cause it's a macro
00:35:39FromDiscord<KingDarBoja> sent a code paste, see https://play.nim-lang.org/#ix=2IMF
00:35:40FromDiscord<ElegantBeef> !eval import json; echo (% {}).typeof
00:35:42NimBotCompile failed: /usercode/in.nim(1, 21) Error: invalid token: (\29)
00:35:46FromDiscord<ElegantBeef> ok
00:35:50FromDiscord<ElegantBeef> Eval doesnt want to play nice
00:36:14FromDiscord<Quibono> What's the equivalent of [:-1] in nim?
00:36:31FromDiscord<ElegantBeef> `[^1]`
00:36:44FromDiscord<Quibono> Thanks
00:36:46FromDiscord<ElegantBeef> iirc that's the backwards index in python?
00:37:02FromDiscord<Quibono> Everything but the last element
00:37:12FromDiscord<ElegantBeef> oh then you want `[0..^2]`
00:37:15FromDiscord<Quibono> Thanks
00:37:23FromDiscord<KingDarBoja> Still no idea how to pass what I want
00:37:28FromDiscord<ElegantBeef> You pass a json node
00:37:38FromDiscord<KingDarBoja> Ah
00:37:38FromDiscord<ElegantBeef> What's the proc signature?
00:37:52FromDiscord<KingDarBoja> sent a code paste, see https://play.nim-lang.org/#ix=2IMG
00:38:01FromDiscord<KingDarBoja> (edit) "https://play.nim-lang.org/#ix=2IMG" => "https://play.nim-lang.org/#ix=2IMH"
00:38:25FromDiscord<ElegantBeef> yea browser options is just a empty jsonNode, so if you jsonify your input with either `toJson` or `% object` it'll work
00:38:57FromDiscord<ElegantBeef> The reason the macro says "untyped" is that it is expanded before type checking is done and can be used on any object
00:39:15FromDiscord<KingDarBoja> ok, thanks!
00:39:41FromDiscord<KingDarBoja> ElegantBeef +rep
00:40:06FromDiscord<ElegantBeef> Hey i just pretend i know anything
00:52:10*firegem joined #nim
00:53:26*firegem quit (Client Quit)
01:07:20FromDiscord<juliuskiesian> anyway to make nimble put binary output in a specific folder?
01:07:30FromDiscord<juliuskiesian> for example, in $project/bin?
01:08:25FromDiscord<ElegantBeef> `-o` `--out` allows you to change the name and `--outDir` the path
01:08:45FromDiscord<ElegantBeef> So you can make your own build path using a nimble task
01:09:19FromDiscord<ElegantBeef> https://github.com/ftsf/nico/blob/master/exampleApp/exampleApp.nimble#L15
01:09:21FromDiscord<ElegantBeef> Example of that
01:10:18FromDiscord<ElegantBeef> Is it possible for Zippy to archive an entire folder?
01:16:13FromDiscord<ElegantBeef> @guzba hopefully you dont mind the ping ^?
01:21:32FromDiscord<guzba> hey, no problem. are you hoping to create a zip archive (zip file) of the folder? if so, currently zippy does not yet have procs for creating zip archives, only the direct compress/uncompress calls sorry! i meant to work on that today earlier but did other nim stuff instead haha. i need to get back to zippy and finish up the zip archive stuff
01:22:11FromDiscord<ElegantBeef> Ah shucks, was rewriting my unity build system and since i knew you library was pure was going to embed some upload support into it
01:22:15FromDiscord<guzba> zip archives is mostly just a header + lookup table with zip'ed blobs so i just need to sit down and work on it
01:22:20FromDiscord<ElegantBeef> Guess i'll put that off for a bit
01:22:36FromDiscord<guzba> (edit) "zip'ed" => "deflated"
01:22:58FromDiscord<guzba> yeah ill need a bit longer. i was working on getting zippy to zlib-level perf which ive basically managed at this point
01:23:09FromDiscord<guzba> so no more excuses not to work on zip archive
01:23:46FromDiscord<ajusa> wait that's really impressive actually
01:23:48FromDiscord<guzba> ill ping when ive got things ready and you can be my guinea pig ๐Ÿ™‚
01:24:21FromDiscord<guzba> yeah thanks, its been a lot of work to get there. im still slower in some cases but am a bit faster in others so overall i feel quite good about it
01:24:34FromDiscord<guzba> i used to be lik 3x slower but now im worst-case like 20% slower
01:24:36FromDiscord<guzba> big difference
01:24:39FromDiscord<ElegantBeef> Well eitherway, good job, happy to see pure nim schtuffs
01:25:13FromDiscord<guzba> yep im all in on pure-nim stuff, its got tons of benefits even over nims great c interop
01:25:56FromDiscord<ElegantBeef> Well Nimarchive is nice as it works and isnt too hard to compress/uncompress archives, but it requires a dependancy and cannot be build cross platform
01:26:12FromDiscord<ElegantBeef> I couldnt ever get a windows build to work right, due to it
01:26:46FromDiscord<guzba> yeah i work on windows nowadays so i feel the "it doesn't work on windows" pain very often, hence i prefer if things are just in nim
01:29:12FromDiscord<ElegantBeef> Not that it matters much for what i'm doing but do you plan expanding to tarballs and the like eventually?
01:29:43FromDiscord<ElegantBeef> I only have on user of my build system and he only ships windows/mac builds afaik so zips are fine
01:29:47FromDiscord<guzba> i do like the idea of supporting tar.gz etc too, it seems very reasonable
01:30:37FromDiscord<guzba> i think tarballs are not that far from what i already have too, and may even be simpler than zip archives but we'll see when i look closer
01:31:19*Tanger joined #nim
01:31:33FromDiscord<guzba> iirc zip archives can be a bit tricky in the file format of like 32 vs 64 bit something and varios compression algorithms for the data, not always straight zlib but i could be mis-remembering
01:31:43FromDiscord<guzba> (edit) "varios" => "various"
01:32:13FromDiscord<ElegantBeef> No clue here, i just know they make file transfer easier ๐Ÿ˜›
01:32:33FromDiscord<guzba> haha yeah that's all that should matter anyway. its just a fancy bundle really
01:33:42FromDiscord<guzba> i did png fully in nim in github.com/treeform/pixie -- png is basically a wrapper of zipped data it turns out
01:34:28FromDiscord<guzba> i tried jpeg too but that made me mucho angry, its a very complex image format
01:34:35FromDiscord<guzba> maybe ill get back to it someday
01:34:52FromDiscord<juliuskiesian> Thanks. that works.
01:34:53FromDiscord<ElegantBeef> It's 2020, jpeg isnt needed
01:34:57FromDiscord<ElegantBeef> No problem
01:35:20FromGitter<gogolxdong> ok , I found it comparing with nextTimer, does this count for a performance issue?
01:35:37FromDiscord<ElegantBeef> Like does anyone actually use jpeg ๐Ÿ˜„
01:37:29FromDiscord<guzba> if they knew how much of a pain it is to load them they'd reconsider if they are lol
01:38:26FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=2IN8
01:40:15FromDiscord<ElegantBeef> Half of Nim is elegant the other have is elegant
01:40:19FromDiscord<ElegantBeef> (edit) "have" => "half"
01:41:05FromDiscord<ajusa> it's amazing honestly. Nim is probably the closest to how I express my code, sometimes it just flows with a bunch of beautiful function transforms
01:41:45FromDiscord<ajusa> sent a code paste, see https://paste.rs/f67
01:49:43FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2IN9
01:49:54Fish-Facehow do you write "sequence containing an empty sequence"
01:50:03Fish-Face@[@[]] seems to fail
01:50:39Fish-Faceit seems to get parsed as the proc @ applied to [@[]]
01:51:18FromDiscord<ElegantBeef> You can do `newSeq[seq[int]]()`
01:51:57Fish-Faceit seems to get parsed as the proc @ applied to [@[]]
01:52:00Fish-Faceoops
01:52:33Fish-Facedang
01:52:35Fish-Faceverbosity
01:55:48FromGitter<gogolxdong> I think the latency in poll is โŽ โŽ ```let t = getMonoTime() โŽ t - p.timers[0].finishAt``` [https://gitter.im/nim-lang/Nim?at=5fdeaf2393af5216fc506ce9]
01:56:35mipriit's always a proc @ that's applied to an array. That's not the error. The error is that there's no @ proc that works for an array[1, seq[empty]]
01:56:38FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=2INa
02:01:45FromDiscord<ElegantBeef> @ajusa yea i didnt know your enum, so had no clue if it could go out of range ๐Ÿ˜„
02:02:36FromDiscord<ajusa> fair enough lol, I didn't post the entire thing. I'm pretty happy with how my code looks now, unfortunately it doesn't actually work so I should probably fix it
02:03:27giacosealmove, just started binaryparse to binarylang conversion!
02:06:21FromDiscord<sealmove> Nice. Do a git pull cause I just pushed some minor fixes. I started dogfooding it just today.
02:06:55FromDiscord<sealmove> Also it should land on nimble soon, already made a PR for this.
02:07:52FromDiscord<ajusa> Not sure if this is an issue from my code, but can you not do a map with an operator?โ†ต`toSeq(0..3).map($)` doesn't work
02:09:29FromDiscord<sealmove> `$it`, not just `$`
02:09:56FromDiscord<ajusa> toSeq(0..3).mapIt($it)?
02:10:13FromDiscord<ajusa> (edit) "toSeq(0..3).mapIt($it)? ... " added "yeah that seems to work"
02:11:03FromDiscord<sealmove> Yup, I always use It versions of the procs in sequtils.
02:11:11giacosealmove sure, using #head
02:12:08FromGitter<gogolxdong> What's the potential benefit from CPS?
02:13:00FromDiscord<sealmove> giaco so if I push your setup somehow pulls automatically? How do you do this?
02:14:56giacosealmove, I didn't get your larst line. What do you mean. I'm just saying that I'm using "requires "https://github.com/sealmove/binarylang.git#head" in my nimble file
02:16:18FromDiscord<sealmove> Mm, never used #head in my .nimble, I wonder if it pulls new changes each time you build.
02:16:42FromDiscord<sealmove> If it works this way that's sweet!
02:17:26giacosealmove, I'm a newbie, but I think it depends if you build using nim c or nimble c
02:18:38FromDiscord<sealmove> Yeah of course, if it does work like this it will only get triggered when building using the nimble command, since the nim command doesn't even check the .nimble file.
02:19:10FromDiscord<sealmove> I was just not aware that nimble can do this :p
02:22:30FromDiscord<sealmove> @gogolxdong more readable/safe code for specific code patterns?
02:25:09FromDiscord<sealmove> So giaco did the 2 things you mentioned yesterday work? I am off to bed and curious to learn :p
02:31:05*Tanger quit (Remote host closed the connection)
02:31:54FromGitter<gogolxdong> There is some CPS pattern code in Nim I think.
02:32:45giacosealmove, still reading your docs and trying to figure out how to convert things
02:34:09FromDiscord<sealmove> I guess it's a quite long read, but most things should be identical in syntax. Only strings changed quite radically.
02:35:21giacosealmove, yep. I've converted all the parsers in 10 secs, but strings + repetitions are exacly the 2 problems I had and so requires full read and comprehension
02:36:32FromDiscord<sealmove> I see, happy you are trying it out :-) you're the first one. Gotta sleep now, bb.
02:38:48giacosealmove have a nice sleep and thanks!
03:03:00FromGitter<jrfondren> https://www.bleepingcomputer.com/news/security/bouncy-castle-crypto-authentication-bypass-vulnerability-revealed/ โŽ they screwed up string equality.
03:06:23FromDiscord<ElegantBeef> Jesus, looking at that code, as long as the length matches and the last hashed value matches it's a valid password
03:07:03FromDiscord<ElegantBeef> Ah nvm that's `&=`
03:12:04*sagax quit (Read error: Connection reset by peer)
03:13:47*rockcavera is now known as Guest80455
03:13:47*tiorock joined #nim
03:13:47*Guest80455 quit (Killed (rothfuss.freenode.net (Nickname regained by services)))
03:13:47*tiorock is now known as rockcavera
03:15:47*tiorock joined #nim
03:15:47*tiorock quit (Changing host)
03:15:47*tiorock joined #nim
03:15:47*rockcavera quit (Killed (verne.freenode.net (Nickname regained by services)))
03:15:47*tiorock is now known as rockcavera
03:20:22FromDiscord<KingDarBoja> Still only index checking? What about character checking? O.o
03:34:16*vicfred quit (Quit: Leaving)
03:56:21disrupteki find your character wanting.
04:00:51disruptekleorize: but are we supposed to use odd-numbered releases for testing release branches?
04:01:27*muffindrake quit (Ping timeout: 260 seconds)
04:03:48*muffindrake joined #nim
04:05:21ForumUpdaterBotNew thread by Bung: Looper - Another web framework written in Nim, see https://forum.nim-lang.org/t/7271
04:07:01leorizedisruptek: setup-nim fetch whatever is the latest from the nightly build for those branches
04:07:30disrupteki guess that makes sense, right?
04:07:41disruptekbecause a fix will go into the odd release.
04:08:01leorizebugs goes there too, as usual :P
04:08:11disruptekright.
04:08:30leorizehttps://github.com/alaviss/setup-nim/issues/4 <- this one tracks version selection for setup-nim
04:08:30disbotโžฅ Allow installation of a specific nightly or released version
04:08:42disruptekso it's working it's just that the hash isn't getting revealed in the --version.
04:08:48leorizenot all feature in there will get in, setup-nim is meant to have as little code as possible
04:08:53disruptekgood.
04:10:14disrupteki think i'm going to make testes into a simple test runner that can replace nimble. it doesn't really make sense to put such code in a separate repo and i don't really want to bother with nimscript any more.
04:26:53*clyybber quit (Quit: WeeChat 3.0)
04:33:52FromDiscord<shadow.> a <- ("a" a) | "a"โ†ตโ†ตidk how tf npeg figures this out but this is gonna save my aoc part two ty zevv you're a wizard
04:41:17*narimiran joined #nim
04:45:44*vicfred joined #nim
04:51:27*rockcavera quit (Remote host closed the connection)
04:53:29*spiderstew_ joined #nim
04:55:16*spiderstew quit (Ping timeout: 240 seconds)
05:04:28*a_chou joined #nim
05:17:26giacohello! newbie question. I do echo(myvar) and I get "@[160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160]". I do "import math" and "sum(myvar)" and I get "224". I was expecting 1760
05:18:07FromDiscord<m0nsta> https://news.ycombinator.com/item?id=25464354
05:18:26FromDiscord<m0nsta> ^anyone seen this ?
05:19:51FromDiscord<Rika> It was posted yesterday
05:20:03disruptekpaper date is november.
05:20:11FromDiscord<Rika> I mean here
05:20:16FromDiscord<Rika> It was posted here yesterday
05:20:43FromDiscord<m0nsta> cool
05:20:58FromDiscord<m0nsta> there's some nim chatter in the comments
05:21:02FromDiscord<m0nsta> : )
05:25:36*narimiran quit (Ping timeout: 240 seconds)
05:29:12giacoany hint?
05:30:41mipri!eval import math; echo @[160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160].sum
05:30:43NimBot1760
05:32:27giacoI get correct result in inim too, but in my exercise program I echo the var and I get that representation, but sum() or .sum returns 224 instead
05:33:00miprithen there's some unrelated problem in your code
05:34:09giacosure, I'm here to ask for some help. the myvar is seq[uint8]>
05:34:23*a_chou quit (Quit: a_chou)
05:34:47mipri!eval import math; echo @[160.uint8, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160].sum
05:34:49NimBot224
05:35:52giacothat's because the return value would be uint8 too and it is overflowing?
05:36:28mipri!eval import sequtils; echo @[160.uint8, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160].foldl(a.int + b.int, 0)
05:36:30NimBot1760
05:37:07mipri!eval import sequtils; echo @[160.uint8, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160].foldl(a + b.int, 0)
05:37:09NimBot1760
05:37:16miprirather. the 0 there is the first 'a'.
05:38:34giacogot it, good idea to use reduce. But what's the reason of the problem? Is "sum" using the same variable type of the input array?
05:38:55mipri!eval import math; echo @[160.uint8, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160].sum.typeof
05:38:57NimBotuint8
05:39:21mipriavoiding that is why I'm using the three-argument form of foldl
05:39:29mipri!eval import sequtils; echo @[160.uint8, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160].foldl(a.int + b.int)
05:39:30NimBotCompile failed: /usercode/in.nim(1, 98) Error: type mismatch: got <int> but expected 'uint8'
05:40:33giacomipri: thanks! it's working. Now an easy catch for a newcomer
05:40:49mipriwhat's strange to me is that there's no overflow check, which I normally expect. math.nim does a {.push checks: off.}
05:41:07*waleee-cl quit (Quit: Connection closed for inactivity)
05:42:27giacointeresting
05:42:52miprioh, that's not actually why, it's because it's uint8
05:44:19mipriwell, that's *also* why
05:44:24miprihttps://play.nim-lang.org/#ix=2IOe gets an overflow
05:45:30giacoso math disables checks, but manual proc would get it. Interesting
05:45:57miprimath and unsigned types indepedently prevent the overflow check
05:46:26giacoI wonder why
05:47:11miprimath? probably speed. unsigned types? the expectation that overflow is what you want
05:48:08giacowhile I can understand why speed matters, I don't get the second item
05:48:22giacois it an historical reason?
05:49:05mipriI think it's pretty common but couldn't tell you about the history.
05:49:50giacok, thanks a lot. I'm using nim to learn (actually re-learn) how to program using low level concepts
06:03:16giacogiven a an array of uint8, how can I convert into a char array so that I can perform comparison with human readable stuff like ['h','e','l','l','o']?
06:07:56miprihttps://play.nim-lang.org/#ix=2IOl
06:10:15giacothank! Would you go for the cast solution or the mapIt?
06:11:28mipriI don't know that there's any actual difference. I'd tend to go with the cast.
06:12:51*NimBot joined #nim
06:13:06giacothanks
06:13:48FromDiscord<Rika> The cast relies on internal representation
06:14:18FromDiscord<ElegantBeef> There is also `strutils.toHex` for strings to make them actually readable if the internal data isnt actually written strings ๐Ÿ˜„
06:14:36FromDiscord<ElegantBeef> In these parts we tend to use `string` as identical as `seq[byte]`
06:15:38giacowould you also consider it equal to seq[uint8]?
06:15:57FromDiscord<ElegantBeef> Byte is just an alias to uint8
06:16:24FromDiscord<ElegantBeef> My C# heritage is showing for me defaulting to `byte` instead of `uint8`
06:16:53giacok, and what about cstrings? Do I ever have to care about string terminations and stuff like that while staying within nim borders?
06:17:55FromDiscord<ElegantBeef> Nope
06:18:59giacogood, good!
06:19:03giacothanks
06:24:15giacoI have an proc that wants a bytestream as input, but I have a uint8 array. What's the right object to deal with that?
06:25:29mipristdlib doesn't have a bytestream, so read the docs of whatever module you're working with. or its source.
06:26:11FromDiscord<ElegantBeef> Yea the closest the stdlib has is a `stringstream`
06:27:27FromDiscord<ElegantBeef> Assuming you setup your editor, your goto definition should let you see the type it's api
06:27:52giacoyou're right! I though it was taking that function from "streams", but actually comes from another pkg. My fault, sorry
06:28:26FromDiscord<ElegantBeef> Unforgivable we'll now vote to see if you can stay
06:28:46FromDiscord<Rika> Why did you change your avatar
06:28:54FromDiscord<ElegantBeef> Peer pressure
06:29:07FromDiscord<Rika> I vote beef out
06:29:09FromDiscord<ElegantBeef> Also known as all my friends had Christmas hats
06:29:22FromDiscord<ElegantBeef> So changed to my other doggo
06:29:42FromDiscord<Rika> Out with beef
06:30:11FromDiscord<ElegantBeef> Fine, i'll leave and use Beeflang just so it makes sense
06:31:58FromDiscord<ElegantBeef> But remember the name "Beef" can hurt peoples sensibillities
06:32:42FromDiscord<ElegantBeef> https://github.com/beefytech/Beef/issues/14 context for that joke
06:32:42disbotโžฅ Project name and logo can hurt people's sensibilities
06:47:44giacoI'm trying to use the seq[char] to string function from user Reactormonk here (second answer) but it seems deprecated (my nim is not accepting the syntax) https://stackoverflow.com/questions/32094567/converting-a-seqchar-to-string
06:48:07giacoI'm talking about "s.mapIt(string, $it).join"
06:49:21mipriremove the "string, " from that
06:50:02giacoit works! Thanks again
06:50:58giacooh, I just found that I can just simply call .join on the seq[char]
06:55:23*j-james[m] joined #nim
06:59:24*letto quit (Quit: Konversation terminated!)
07:08:26giacoare body of cases in a "case" statements considered blocks? Can I use defer in them?
07:12:01*vicfred quit (Quit: Leaving)
07:19:10miprihttps://play.nim-lang.org/#ix=2IOK
07:24:36*habamax joined #nim
07:32:46*opal quit (Remote host closed the connection)
07:59:53giacomipri: thanks again and again!
08:08:25giacosealmove, I've successfully converted my code to binarylang and everything is smooth! Your string implementation correctly parses non-byte-aligned strings saving quite some code. I've failed in two things: 1- modularize my code by moving "createParser" function into a separate file, I guess get and put are not exported (should I wrap them into exported functions?) 2- I'd chain parsers but I failed to
08:08:27giacouse conditional code inside the macro when I need to select which parser to use based on a previous parsed field or first magic bytes of a field (common case in network protocols, just think udp and different payload)
08:28:49*narimiran joined #nim
08:38:32*saem quit (Remote host closed the connection)
08:38:48*FromDiscord quit (Remote host closed the connection)
08:39:02*FromDiscord joined #nim
08:48:02FromDiscord<sealmove> @giaco hey again. You can simply use an export statement.
08:48:44FromDiscord<sealmove> `export myParser` at the end of your module.
08:49:47FromDiscord<sealmove> For selecting parser did you try the custom parser API?
08:51:08giacosealmove, not yet!
08:51:44FromDiscord<sealmove> It's quite easy.
08:52:34FromDiscord<sealmove> Btw non-byte-aligned strings raise an exception :S how did it work for you? Can I see code?
08:52:50*ex_nihilo joined #nim
08:53:58giacosealmove, I mistyped sorry. It is now non-byte-aligned, but custom length (still talking about 8*N bits)
08:55:51giacosealmove, can I show you code? I'd be happy to hear your opinion (noob warning ahead)
08:56:43FromDiscord<sealmove> Yes please
09:00:27giacosealmove: here's the parsers > https://termbin.com/fttr , here's the code using them https://termbin.com/9xi7 . It is my very first nim code that goes somewhere after the hello world
09:01:06giacoplease be patient if you see any weird thing in there. I can say that the code works, any suggestion would be appreciated
09:04:04giacoas you can see I'm converting back strings to buffers to achieve conditional parsers. Dirty way to solve the problem, but I used it as an exercise to handle streams and buffer to strings conversions
09:04:54FromDiscord<sealmove> did you notice the default parser options?
09:05:09FromDiscord<sealmove> instead of `lu` everywhere you can make it default to `l`
09:12:49giacoendian= applied, thanks!
09:13:03FromDiscord<sealmove> yup. I assume you did `u8: segments[segments_table.foldl(a.int + b.int, 0)]` instead of `s: segments(segments_table.foldl(a.int + b.int, 0))` because there might be some null-byte in the middle?
09:15:03giacobecause thats the buffer I pass to the next parser and contains both strings and binary data
09:15:50FromDiscord<sealmove> aha correct. let's make the custom parser, give me a sec
09:15:52*letto joined #nim
09:15:52giacoso I'm converting it from seq[uint8]->seq[char]->string manually later
09:16:52FromDiscord<sealmove> yes I think it's the only correct way right now.
09:19:01FromDiscord<sealmove> hmm, I haven't done TLV in binarylang yet. this is interesting.
09:19:26giacoTLV?
09:19:30FromDiscord<sealmove> kaitai struct has a dedicated feature for this https://gist.github.com/sealmove/080f54337a92d24e5ab6c8d61ffe8ecf
09:20:16FromDiscord<sealmove> Type-Length-Value, it means you are switching types at runtime based on condition
09:23:03FromDiscord<sealmove> gaico: hmm, how do you wanna do this? would you like to have fields in your oggPageParser that are wrapped into an Option, and only 1 of them gets a value?
09:23:14FromDiscord<sealmove> have 2 fields
09:24:29giacoit would be ok, surely better than switching back and forth main code
09:26:10FromDiscord<sealmove> It would look like this: https://play.nim-lang.org/#ix=2IPC
09:27:01FromDiscord<sealmove> The other solution is to use a union and have 1 field, which one do you prefer?
09:28:06FromDiscord<sealmove> when I say union, I mean an object variant type of course
09:29:19giacowell RFC says that the wrapper (ogg) should be agnostic about it's segmented payload, so ogg parser shouldn't know about it's dealing with opus, not sure if dual field or union is more compatible with the idea
09:29:49giacomay I ask you how can I do both? I want to think about it
09:29:55FromDiscord<sealmove> I guess union, which I also find more neat
09:39:23FromDiscord<sealmove> @giaco here you go: https://play.nim-lang.org/#ix=2IPJ
09:40:39FromDiscord<sealmove> After the plugin system is complete, you will be able to make a plugin for TLV to avoid such boilerplate. But for now if you hide this boilerplate somehow I think it's pretty sweet.
09:41:55FromDiscord<sealmove> sorry, autocompletion converted `s` to `sizeof`, here is the corrected one: https://play.nim-lang.org/#ix=2IPK
09:43:06FromDiscord<sealmove> and in the type I forgot to indent fields. anyway, i haven't run the code so do your tweaking, it shouldn't be hard to run.
09:50:15*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:55:00FromDiscord<sealmove> @giaco sorry I didn't see you wanted both
09:55:59FromDiscord<sealmove> sorry I have no time to show you the solution with 2 fields right now
09:57:04FromDiscord<sealmove> but it's longer and uglier anyway ๐Ÿ˜›
10:02:48giacosealmove, I'm back I had to eat something I was starving. Thanks for the union solution! I'm going to apply that now
10:06:09giacook this surely is a good topic for today: get to understand lines 4 to 7 :D
10:06:39FromDiscord<sealmove> yup, object variants is an awesome nim feature, read up the manual ^^
10:08:55giacosure!
10:09:11giacoI'd like to ask your opinion on same code
10:11:54*fanta1 joined #nim
10:12:13giacorfc says that segments_table is a list of bytes where each byte is the length in bytes of the following segments. I actually sum them up and read all of them as a big unique segment and pass it down to next parser, but that's actually a workaround. A real ogg parser should return an array of arrays as "segments" field instead
10:13:03FromDiscord<mratsim> @zevv @disruptek any idea if this corresponds to a thing in the CPS POC? https://en.wikipedia.org/wiki/Delimited_continuation
10:15:51giacosealmove, do you thing there's a way to achieve that using binarylang?
10:16:35FromDiscord<sealmove> @giaco: you can do anything with custom parsers, it's just nim code
10:16:51FromDiscord<sealmove> but binarylang only provides some primitives
10:17:44giacosealmove, sure, I mean if there's a way in binarylang to read a list of variable lengths. I guess not, but I wanted to ask. Thanks!
10:19:03FromDiscord<sealmove> no, list of list is not implemented except with repetition + magic
10:19:22FromDiscord<sealmove> but i have a snippet in README which explains how to do it in 2 steps
10:19:37FromDiscord<sealmove> now that I think about it, you don't even need custom parsers for this
10:22:13FromDiscord<sealmove> it's the snippet under Substeams section
10:23:53*letto quit (Remote host closed the connection)
10:26:18giacosealmove, do you mean the limit = 8 + aux + fixed example? I've considered that, but I don't see how I can use it to handle a list of lengths to read, as it is not to be used for repetition
10:30:43giacowhat I need is segment_table is [3,1,2], I need to read following bytes in chunks of 3,1,2 resulting in something like [[AA,BB,CC],[DD],[EE,FF]]. What I am doing now as workaround is just reading 3+1+2=6 -> [AA,BB,CC,DD,EE,FF]
10:31:17FromDiscord<mratsim> use tuples
10:32:08FromDiscord<sealmove> sec, need to finish something first, i'll show you
10:34:14FromDiscord<sealmove> ok so, what I mean is you can make a subparser that accepts the length of the segment as argument
10:36:02giacosealmove but segments have variable lengths
10:37:34FromDiscord<sealmove> right, hmm, let me think about it
10:50:32giacowhat do you use as IDE per nim? I'm settled into vim and vscode right now. Tried to install aporia but nimble failed in compilation of both version in nim packages and head
10:52:32FromDiscord<sealmove> i also use vscode (when on windows) and neovim when on linux.
10:52:34FromDiscord<Recruit_main707> arporia is outdated, vscode has the best support, intellij got a plugin recently and its actively developed, but its still very new
10:53:03Zevvmratsim: not quite sure, we dont really return a value
10:53:33FromDiscord<mratsim> you return a continuation?
10:53:54giacothanks for the feedback
10:56:10FromDiscord<Rika> Neovim actually has the best support
10:57:42FromDiscord<sealmove> giaco you can do it with until repeat repetition and the implicit `i` symbol to index your `segments_table` array
10:58:29giacointeresting, let me re-read that section
10:58:36FromDiscord<sealmove> I am in the middle of a tournament right now so I can't write the example, maybe later
10:58:49giacowhat? :D
10:58:58FromDiscord<sealmove> shogi tournament
11:00:09FromDiscord<Rika> Oh man I wanna learn shogi
11:00:10giacogo get that Gyoku
11:00:27FromDiscord<sealmove> I've been playing since 2009
11:00:37Zevvmratsim: thats an implementation detail, in our current setp we replace te `fn` member in the ref environment
11:00:57FromDiscord<mratsim> oh interesting
11:01:01FromDiscord<sealmove> @giaco thanks ๐Ÿ˜„
11:01:17FromDiscord<mratsim> I bought the "Art of Shogi" 10 years ago but i didn't read it :/
11:01:28FromDiscord<sealmove> guys you will make me cry
11:01:31Zevvbut disruptek is planning on droopping the fn from the env and passing it around instead, so yes
11:01:34FromDiscord<sealmove> usually ppl don't even know it exists
11:01:46FromDiscord<mratsim> also couldn't find a good place to play it online apart from a polish website.
11:01:56FromDiscord<mratsim> I have a shogi set at home
11:02:03FromDiscord<sealmove> yeah, it's tough, though poland has a community
11:02:18FromDiscord<sealmove> oh for online there is 81dojo which is awesome
11:02:22FromDiscord<sealmove> 81dojo.com
11:02:42FromDiscord<dom96> Zevv: https://irclogs.nim-lang.org/19-12-2020.html#23:58:58
11:04:02FromDiscord<mratsim> @sealmove will keep in bookmarks, but I think I found a new timesink in async/CPS
11:04:14FromDiscord<sealmove> hehe ^^
11:04:34FromDiscord<Rika> ~~I only know it exists because of a manga~~
11:04:34FromDiscord<dom96> Also someone should answer https://irclogs.nim-lang.org/20-12-2020.html#02:12:08 ๐Ÿ™‚
11:07:51FromDiscord<mratsim> @dom96 I've been thinking about function colors. I don't see in Nim how it manifest as a problem.
11:08:55Zevvdom96: the benefit for me is not performance but simplicity
11:09:10Zevvit allows me do interesting flow control in the language
11:09:17FromDiscord<dom96> Zevv: I see. That's not what the implication was from the IRC logs ๐Ÿ™‚
11:09:18Zevvmy primary goal has been to have lua-style coroutines since day 1
11:09:37Zevvthe io_uring discussion I guess
11:10:16Zevvthat would be a "nice exercise" to see how far to push it.
11:10:29ZevvFor the mratsim-kind of folks, the benefit is in the memory management.
11:11:00FromDiscord<dom96> @mratsim I can see it being problematic when you have a synchronous API that you want to use.
11:11:11FromDiscord<dom96> But once you are able to await a spawned thread this won't be a problem.
11:11:25*Q-Master quit (Ping timeout: 240 seconds)
11:11:28FromDiscord<dom96> Awaitability of FlowVars and channels really is the missing piece to all of this.
11:11:31FromDiscord<mratsim> isn't waitFor sufficient to transform async into sync though?
11:12:48FromDiscord<dom96> Zevv: if simplicity is the goal then I think it should be sold as a replacement for closure iterators, rather than async/await.
11:13:03*j-james joined #nim
11:13:04FromDiscord<dom96> In all likelihood we can have async/await working on top of it without any API changes
11:13:07giacosealmove, not sure how you would use repeat-until to solve the problem. "until", just like "for", would return an array, not an array of arrays
11:13:13Zevvmaybe not even a replacement. It's just a library. You can use it to build stuff
11:13:28*j-james left #nim (#nim)
11:13:28FromDiscord<mratsim> I've been reading into Lattner Async swift proposal, that's what they propose, and Kotlin does the same as well
11:13:35FromDiscord<dom96> Sure, once it works well as a library we can adopt it into the compiler.
11:13:39FromDiscord<sealmove> giaco, encaptulate the parsing of 1 array in a subparser
11:13:58FromDiscord<sealmove> the subparser should accept a size
11:14:13FromDiscord<mratsim> give me 1 hour to organize my research because I'm getting lost in it xD
11:14:17*letto joined #nim
11:14:22FromDiscord<sealmove> and then use `segments_table[i]` as argument for that size
11:14:35giacosealmove, yes, but the size it at the left of the ":", can I use "i" there?
11:14:36FromDiscord<dom96> @mratsim it's about transforming sync into async though ๐Ÿ™‚
11:14:41giacooh!
11:14:45giacoI was not considering that
11:14:55FromDiscord<mratsim> ah I see
11:18:37FromDiscord<dom96> Btw if we want to win benchmarks, we could use an efficient async DB driver. This is the missing piece for the Techempower benchmarks. I plan to have a look why httpbeast regressed and fix it today.
11:18:52FromDiscord<dom96> It can only cover JSON/Plaintext though as the other benchmarks involve DB calls.
11:19:44Zevvdom96: I see your point and understand your frustration, really. I spend some decen effort already to fix async a year ago with varriount. I don't even remember the details, but we went through the ioselectors, passing stuff around and basically got it to work. In the end it was bikeshedded and reviewed to smithereens, and I just lost interest in the subject.
11:19:57ZevvIt does not solve my personal itch, because I don't care about mixing async and threads
11:20:12ZevvI don't even care about async performance, since it is just fine as it is now for my pracical purposes.
11:20:55ZevvThe reason why I started with CPS i really the lua coros. I created a working implementation based on ucontext (https://github.com/zevv/nimcoro/) that kind of does what I want
11:21:06ZevvAraq saw that passing my and mentioned that I should take a look at CPS
11:21:28ZevvI didn't even know that just a few weeks before that he had already been pushing the CPS on irc and had discussed it with disruptek - I missed that
11:21:49ZevvI was in a period with some time & air, so I went through the CPS paper, liked the idea and made some initial POC implementation
11:22:04ZevvAfter a few weeks I got stuck, and no one was really interested to look at it, so I abandoned
11:22:21Zevvuntil - again a few weeks later - disruptek had picked it up and actually got it to work much better
11:22:22giacosealmove, the "i" symbol on the left side of the expression returns an error: "*oggSegmentParser(segments_table[i]): segments{i>page_segments}" -> Error: undeclared identifier: 'i'
11:22:58FromDiscord<sealmove> @giaco use until repetition (curly brackets), not substream
11:23:29FromDiscord<dom96> Ah, I think we are in agreement then. What frustrates me is the implication that CPS will replace async/await, you could aim to replace async/await by the CPC concept described in the paper but CPS can only realistically be implemented as a replacement for closure iterators specifically.
11:24:37ZevvI think it's partly philosiphical, not only practical
11:24:47FromDiscord<sealmove> @giaco never mind, i didn't read your example correctly
11:25:00ZevvCPS provides the lower building blocks. Closure iterators are limited in what they can do, CPS is more essential
11:25:18FromDiscord<sealmove> `i` should work, i will give it a try later and see what's wrong
11:25:30ZevvCPS allows pretty cool tricks, like taking any closure and running it "anywhere" - if you want it on another thread, that's just comes natural
11:25:51giacosealmove, np. Thanks
11:26:01Zevvso I don't think anyone is looking to replace async in the short term, but it is a pretty interesting research project *with the potential* to maybe one data offer something like that
11:26:09FromDiscord<dom96> Zevv: wouldn't that be possible with closure iterators too? Assuming the heap isn't thread-local?
11:26:39ZevvActually, I wouldn't know, I lack knowledge of the details
11:26:42FromDiscord<dom96> Zevv: no, CPS cannot replace async. You need something on top, I think it's important to make that clear.
11:26:55FromDiscord<dom96> Async/await is one approach that you can put on top of CPS
11:26:57FromDiscord<dom96> CSP is another
11:27:09Zevvsure. CPS is the lego blocks
11:27:54FromDiscord<dom96> Once CPS is working well we should discuss the next approach. I just don't want the community to give up on async/await thinking that it will be gone soon because CPS will replace it.
11:28:04Zevvbut async does have some kind of problem, because why is no one able to "fix" this flowvar/async problem? Mulitple people have tried, but they all get stuck somehow
11:30:11FromDiscord<dom96> It has definitely been fixed at least once. The problem as far as I'm concerned was it got stuck in review and then interest was lost to push it forward.
11:30:32Zevvright, that was my impression as well.
11:30:46FromDiscord<sealmove> @giaco, `i` only exists inside curly brackets
11:30:55ZevvSo for me, personally, CPS is about the "level 1", cutting up stuff into continuations I can play with
11:30:56FromDiscord<dom96> But even looking at it as things are right now, you can already mix FlowVars and async. You just need to poll the FlowVar which sucks.
11:31:10ZevvRight
11:31:12FromDiscord<dom96> So it really isn't much of a stretch to integrate this with the event loop
11:31:58giacosealmove, so it can't help with the problem
11:32:25ZevvI'm really ambivalent about this. Async is pretty mature and does a good job, but every time I try to work in the implementation I see this pretty massive amount of pretty complicated code. I understand a lot of that is because of the ioselector abstractions and all
11:32:34Zevvbut it's not particulary /fun/ to work on anymore.
11:33:03Zevvthat's no ones fault, that's how it goes with any piece of matureed or aged software
11:33:13FromDiscord<sealmove> @giaco yes, I should fix this, that's why it's nice when people use your product ๐Ÿ˜‰ expect it done today
11:33:33giaco:D :D
11:33:52FromDiscord<dom96> Which parts in particular did you find complex? I'd love to scope out something that could push it into a better state.
11:34:51Zevvha good question. I think it's the "overall complexity", but that's a non-answer
11:34:56FromDiscord<dom96> This stuff is unfortunately complex though, I imagine if I looked at the CPS implementation I would also be very confused.
11:35:25ZevvRemember that CPS itself is not much more than asyncmacro
11:35:37Zevvit's just a transformation
11:35:58Zevvso if anyone would "rebuild" async on top of CPS, it will bring the same level(s) of complexity
11:36:02FromDiscord<dom96> Of course, but you have splitting steps, lambda lifting steps and what not. That's not even something the async macro does.
11:36:05Zevvof io selector abstractions, schedulers, etc
11:36:10FromDiscord<dom96> indeed
11:37:14FromDiscord<dom96> IO selectors in particular have gone through significant changes by various people, so I'm not surprised if that's complex
11:37:46FromDiscord<dom96> but the async macro transformation is also probably difficult to understand, especially if you just read the code, you'd need to view how the ASTs get transformed.
11:38:07Zevvpartly yes, partly no
11:38:40ZevvI really should make a writeup about this, because what happens is not even very complicated
11:39:40*PMunch joined #nim
11:39:58FromDiscord<sealmove> @giaco then we should inject an `i` variable not only when using until repetition, but also when using for repetition, so you will be able to do `oggSegmentParser(segments_table[i]): segments[segments_table.len]`
11:40:01FromDiscord<dom96> What I think would be useful is to get the perspective of those that are intimately familiar with closure iterators. In particular yglukhov who implemented the ability to handle exceptions with yields in the `try`/`except` blocks.
11:40:23Zevvthat makes sense
11:40:27FromDiscord<dom96> He might very well be the best advocate for simplicity ๐Ÿ™‚
11:40:54giacosealmove, exactly!
11:41:05Zevvbut still, I think you should see this all as a research thing mostly, at this time
11:41:22FromDiscord<sealmove> this is very easy to fix, just need to add 2-3 lines of code
11:41:47Zevvfor me personally it's just the fun of it, I like how thinking about programming in new ways like this makes my brain go porridge
11:42:09ZevvI'm really a low level engineer, and working with these high level CS concepts is just plain fun
11:42:19FromDiscord<dom96> sure, I understand. I only have a problem with how expectations are being managed with the community about it.
11:42:29ZevvI don't understand the most of this stuff, and then it's pretty rewarding to get it to work. Just like npeg, I know hell nothing of parsers, but still it works
11:42:33giacosealmove, this change opens quite big possibilites
11:43:38FromDiscord<sealmove> let me be a good programmer and write tests for it before implementing it ๐Ÿ˜›
11:44:03*Q-Master joined #nim
11:44:56Zevvdom96: part of that comes from ar4q i think, who seems to be actively pushing this
11:45:41giacosealmove, take your time. As I said, I'm using this project as a playground to learn nim (and to replace my previous failed attempt with golang)
11:48:25FromDiscord<dom96> Zevv: possibly, I think it would help us all if it was clearer what exactly he is pushing.
11:49:00*Q-Master quit (Ping timeout: 256 seconds)
11:49:00Zevvhttps://github.com/nim-lang/RFCs/issues/295#issuecomment-744277794
11:49:01disbotโžฅ next steps for CPS ; snippet at 12https://play.nim-lang.org/#ix=2Gti
11:49:31Zevvwhich makes me think he might have missed some of the details, since weave is not the way to go on this
11:51:34PMunchAoC, day 19 and 20 is now live streaming: https://www.youtube.com/watch?v=GIgx6wpb-zs https://www.twitch.tv/pmunche
11:51:49FromDiscord<Zevv[IRC]> (edit) https://github.com/nim-lang/RFCs/issues/295#issuecomment-744277794
11:51:50*FromDiscord quit (Remote host closed the connection)
11:51:50disbotโžฅ next steps for CPS ; snippet at 12https://play.nim-lang.org/#ix=2Gti
11:52:03*FromDiscord joined #nim
11:53:03FromDiscord<dom96> Yeah, that still doesn't explain what his feelings are regarding async/await. I have spoken about it with him a little and I do have an idea of his feelings, but I'd rather leave it up to him to communicate.
11:53:32*Q-Master joined #nim
11:54:01*pbb quit (Ping timeout: 268 seconds)
11:55:01*pbb joined #nim
12:03:43Zevvdom96: can't argue with that, right
12:12:29*superbia joined #nim
12:20:58FromDiscord<mratsim> The macro transformation is ugly, I looked at CHronos's but I assume async dispatch is the same
12:22:29FromDiscord<mratsim> One thing that Araq was appealed by I guess is also macro composition
12:23:01FromDiscord<mratsim> I'm looking into CPS for compiler and its clear that for functional language compiler it seems like an excellent compilation target: https://www.gnu.org/software/guile/manual/html_node/Compiling-CPS.html
12:23:45FromDiscord<mratsim> so you would directly CPSify any macro node and the codegenerator only takes CPS
12:23:51FromGitter<gogolxdong> CPS is cool from what you have been discucssed.
12:24:17*tane joined #nim
12:25:17FromGitter<gogolxdong> What's the problem of async/await for now?
12:26:54FromDiscord<mratsim> http://www.cs.umd.edu/class/fall2012/cmsc430/compiling_functional_languages.pdf
12:29:34FromDiscord<Shucks> Anyone a idea how I could check if fields to a object ptr are set? I guess segfaults are not catchable. https://prnt.sc/w6hu7p
12:30:38FromDiscord<mratsim> import segfault or import signals if you want to
12:30:46FromDiscord<mratsim> but just test foo.isNil
12:30:47*Vladar joined #nim
12:31:12FromDiscord<mratsim> you manage to have debugger suport in VScode?
12:31:25FromDiscord<Shucks> Yea, works pretty good
12:42:37FromDiscord<mratsim> Wow the rabbit hole, I just uncovered "continulet" in Stackless Python: https://doc.pypy.org/en/latest/stackless.html#continulet
12:46:31*krux02 joined #nim
12:48:51miprilikewise I looked up Ada-style concurrency, and the Ada rendezvouz comes from CSP
12:52:48FromDiscord<mratsim> Rendez-vous is blocking though
12:56:02*lum quit (Quit: Lum: Bye!)
12:56:13*superbia quit (Quit: WeeChat 2.9)
13:00:50*lum joined #nim
13:01:31*lum quit (Client Quit)
13:03:09*lum joined #nim
13:03:10FromDiscord<alehander42> oo
13:03:44*lum quit (Client Quit)
13:04:56*lum joined #nim
13:05:43*lum quit (Client Quit)
13:05:50*Q-Master quit (Ping timeout: 256 seconds)
13:08:35*lum joined #nim
13:11:23*lum quit (Client Quit)
13:11:40FromDiscord<sealmove> hum weird error: "'node' is not accessible using discriminant 'kind' of type 'TFullReg' [FieldDefect]"
13:14:57Zevvwell, is it then?
13:15:02miprihttps://play.nim-lang.org/#ix=2IR1 generates that error.
13:15:32FromDiscord<sealmove> `TFullReg` is not in my code
13:15:44FromDiscord<sealmove> seems like an internal error
13:16:12miprivm code, looks like
13:16:47Zevvsealmove: not here
13:16:50Zevvwhat version?
13:17:04FromDiscord<sealmove> 1.4.2
13:17:07Zevvoh wait it does. wrong cache hit
13:17:34Zevvit's not compile time
13:17:57Zevvwait what it's not your code but what is that snippet then?
13:18:24Zevvthe error is totally ok for that code
13:18:28mipriwhat snippet? my paste? That was just showing how to replicate that error, assuming that stuff was in his code.
13:18:48Zevvwell that is perfectly fine. It accesses a variant member that's not valid for it's kind
13:18:55Zevvso it goes *boom* on you
13:18:57Zevvas it should
13:18:58mipriright, but that stuff *isn't* in his code
13:19:10mipriso it's the compiler accessing a field that it shouldn't
13:19:24Zevvriight, but how do I reproduce it in the compiler then
13:20:23Zevvhttps://github.com/nim-lang/Nim/issues/13652
13:20:26disbotโžฅ Compiler crash with getAst of a resultless macro and adding to a statement list ; snippet at 12https://play.nim-lang.org/#ix=2IR7
13:21:58FromDiscord<sealmove> oh
13:22:02FromDiscord<sealmove> i can reproduce
13:22:03FromDiscord<sealmove> replaceWith
13:22:11FromDiscord<sealmove> sorry, here: https://play.nim-lang.org/#ix=2IR9
13:23:48FromDiscord<sealmove> is this code correct or am I am missing something?
13:28:49mipriit's definitely a compiler bug. you can avoid it there by operating on args before constructing MyObj
13:30:07FromDiscord<sealmove> duh i can't this, myObj is constructed in different place in my code, and I want to modify it
13:30:29FromDiscord<sealmove> is it because it's a seq[NimNode]?
13:31:38mipriok, you can also avoid it by copying args out of MyObj, mutating it, and then setting it back
13:32:17FromDiscord<sealmove> thanks, i'll do that
13:32:19miprihttps://play.nim-lang.org/#ix=2IRg
13:32:25*lum joined #nim
13:33:34*lum quit (Client Quit)
13:34:30*lum joined #nim
13:35:05*lum quit (Client Quit)
13:40:21*clemens3 quit (Quit: WeeChat 2.7)
13:40:27*lum joined #nim
13:41:54*Q-Master joined #nim
13:42:01*lum quit (Client Quit)
13:42:59*lum joined #nim
13:44:53*lum quit (Client Quit)
13:45:22*lum joined #nim
13:45:28FromDiscord<sealmove> "internal error: environment misses: :tmp" is my new nightmare
13:46:36*Q-Master quit (Ping timeout: 240 seconds)
13:47:32*lum quit (Client Quit)
13:48:24*lum joined #nim
13:50:22mipri*shrug*. lambda lifting part of compiler that makes those, and :tmp variables I've seen from --expandArc output.
13:52:24*lum quit (Client Quit)
13:54:13*lum joined #nim
13:54:57*lum quit (Client Quit)
13:55:25FromDiscord<sealmove> can bindSym solve those? Or is it completely unrelated? I never used bindSym and I still don't get what it does.
13:55:26*lum joined #nim
13:57:12FromDiscord<Gibson> is the right way to distribute nim binaries that need ssl on windows to statically link them using some cursed compiler options and manual downloads?
13:58:25*klaufir_ joined #nim
13:59:29FromDiscord<mratsim> @sealmove the TFullReg happens to me sometimes when I use distinct uint64
14:03:14FromDiscord<mratsim> @zevv @dom96 @disruptek, here is a nicely packaged collection of Rabbit Holes: https://github.com/weavers-guild/weave-io/tree/master/research
14:03:41Zevvno man
14:03:42Zevvforget it
14:03:45ZevvI'm not going there
14:03:47FromDiscord<mratsim> Now I need to put together some primitives design :p
14:04:11Zevvyou're once more *soo* overdoing this
14:04:54*klaufir_ quit (Remote host closed the connection)
14:05:16*klaufir_ joined #nim
14:05:30FromDiscord<mratsim> I'm not, I need to organize my thoughts, and that starts by putting all the stuff I read and found interesting in boxes.
14:06:25FromDiscord<haxscramper> What is the difference between `proc (a: T0, b: T1){.closure.}` and `proc (this: var string, arg: cint){.closure.}` when passing argument to a function? https://play.nim-lang.org/#ix=2IRE
14:06:51FromDiscord<mratsim> var string is a pointer
14:07:03FromDiscord<mratsim> you can't capture var
14:07:28FromDiscord<mratsim> welcome to the joy of borrow checking
14:07:55FromDiscord<haxscramper> I don't capture anything, I"m working purely with function signatures
14:08:27FromDiscord<haxscramper> But using `a: var T0` helped
14:09:11FromDiscord<haxscramper> And by the way, there is no capturing if I understand everything correctly, I can easily pass mutable arguments to callbacks anyway
14:09:54FromDiscord<mratsim> ah right
14:10:06FromDiscord<mratsim> yes you can't capture a var but you can apss it as aprameter
14:10:38*klaufir_ quit (Ping timeout: 265 seconds)
14:11:19FromDiscord<haxscramper> I just assumed `var string` can be inferred as `T`
14:11:55FromDiscord<haxscramper> E.g both `proc (a: int)` and `proc(a: var int)` are valid for passing to `proc(a: T)`
14:13:42FromDiscord<haxscramper> Though `var` is not a part of the type, so it looks like I need to write overloads for each possible combination of `T` and `var T`
14:14:22Zevvexcellent list of resources mratsim
14:18:15*Q-Master joined #nim
14:19:05*Vladar quit (Remote host closed the connection)
14:19:28FromDiscord<mratsim> The continulet exposed here are quite interesting: https://doc.pypy.org/en/latest/stackless.html
14:20:58FromDiscord<tiatomee> Yesterday I've talked a bit about dependent types and somebody suggested that even something like sigma types are possible in Nim
14:21:11FromDiscord<tiatomee> so I now have a problem where that would be useful
14:21:44FromDiscord<tiatomee> I have a string that contains a "rectangular" data. I want to treat it like an array of width x height
14:22:18FromDiscord<mratsim> type Matrix[M, N: static int] = object
14:22:40FromDiscord<mratsim> see: https://github.com/unicredit/linear-algebra/blob/master/linalg/private/types.nim#L14-L23
14:22:41FromDiscord<tiatomee> with sigma types I'd like to do something likeโ†ต`proc parse(input: string): (width: int, heigh: int โ‡’ array[height, array[width, char]])`
14:23:19FromDiscord<tiatomee> The issue with that is that the bounds have to be known at compile time, but I only know them at runtime
14:23:40FromDiscord<tiatomee> but the "sigma type" aka dependent tuple allows me to create dependent types based off runtime values
14:24:06FromDiscord<tiatomee> I could use `seq[seq[char]]` but then I lose the guarantee that all rows have the same length
14:25:08FromDiscord<mratsim> array must have a compile-time size so you can't use raw arrays either
14:25:41FromDiscord<tiatomee> Yes, the implication is that the size is only known at runtime, so I'll have to use something like a `seq`
14:25:51FromDiscord<mratsim> I don't think that's possible without DrNim / Formal verification right now
14:26:01FromDiscord<tiatomee> but that's what I meant yesterday with "lifting runtime values into the type system"
14:26:10FromDiscord<mratsim> Yes, i see now
14:27:06FromDiscord<mratsim> that said with your own type, you can have all the checks on parsing and know that except at serialization/deserialization boundary your object is internally consistent
14:28:16FromDiscord<tiatomee> Sure, that's probably also what I'll end up doing
14:28:24FromDiscord<tiatomee> it's just less of a guarantee than dependent types :)
14:29:12FromDiscord<mratsim> we'll come here ๐Ÿ™‚
14:29:44FromDiscord<tiatomee> If DrNim becomes more complete and powerful then that's a nice alternative I think
14:30:02FromDiscord<tiatomee> it's still a bit different than dependent types, but they can both be used for formal verification
14:30:22FromDiscord<tiatomee> and I'd actually really love to have a language as feature complete as Nim with decent support for formal verification
14:30:58FromDiscord<mratsim> I don't know if you saw but I posted a way forward to use DrNim / Z3 for formal verification.
14:31:21FromDiscord<tiatomee> I did not see that, no
14:31:22FromDiscord<mratsim> basically it's very inspired by Frama C
14:31:36FromDiscord<mratsim> https://github.com/nim-lang/RFCs/issues/222
14:31:38disbotโžฅ Correct-by-construction Nim programs ; snippet at 12https://play.nim-lang.org/#ix=2lbm
14:32:39FromDiscord<tiatomee> That's a bunch to read, but I see you are mentioning model checking
14:33:19FromDiscord<tiatomee> I don't think Frama-C does model checking by default, does it? There's the Eva plugin for symbolic execution and then the Why3 based one that rely only on deductive reasoning
14:33:44FromDiscord<tiatomee> Model checking is certainly interesting because it's generally pretty nice to start with but the bounded-ness can be a limitation
14:34:31FromDiscord<mratsim> Model checking because for embedded, that's one of the most important thing. Also for my own multithreading runtime i'd like to prove that the state machine is correct.
14:34:48FromDiscord<mratsim> so it's quite practical
14:35:04FromDiscord<mratsim> once we have that, that also means that we have a way to transform Nim AST into Z3 AST.
14:35:05FromDiscord<tiatomee> For state machines it really is nice, it would be nice to have
14:35:58FromDiscord<mratsim> The initial goals for DrNim are: bound checks / invariants (so what you need) and not nil checks.
14:36:58FromDiscord<tiatomee> I think it's great that DrNim exists at all and that it seems like it's reeeelatively easy to build
14:37:26FromDiscord<tiatomee> for Rust there are a few projects for formal verification but they are pretty complex to build up because the compiler has pretty complex APIs that are not stable at all
14:38:23FromDiscord<mratsim> I'm not sure what's the state of DrNim is, I think @Araq is looking for proof of concepts on where to apply it.
14:41:59FromDiscord<flywind> !eval import math; echo floorMod(8.0, -3.0)
14:42:02NimBot-1.0
14:53:23*Vladar joined #nim
14:55:32Oddmongeris this the only way to generate wasm bytecode ? https://github.com/arnetheduck/nlvm
14:56:52Oddmongerexcept generating C and using emcripten of course
14:57:21FromDiscord<Rika> ~~you just answered yourself~~
14:58:00Oddmongermyself was hoping i was wrong
14:58:46FromDiscord<Rika> well lets see if someone proves me wrong...
14:59:11FromDiscord<mratsim> clang can generate wasm from C directly as well
15:02:43FromDiscord<bark> hello guys. Is it possible to call next() on an iterator? (or use an iterator in any way that's not a for loop)
15:03:01FromDiscord<bark> or use lua style coroutines
15:03:03FromDiscord<Rika> yes if it is a closure iterator
15:03:27FromDiscord<Rika> if it is, then you just "call the variable storing it"
15:04:50FromDiscord<bark> thank you
15:07:14Oddmongerfor clang->wasm without emscripten, i've found this: https://surma.dev/things/c-to-webassembly/
15:08:43Oddmongerbut maybe it would be simpler to use emscripten anywayโ€ฆ
15:12:04*waleee-cl joined #nim
15:14:04EvolverHow do I run an OS process with args? I need to wait for it to finish. Its stdout and stderr can be that of the parent process (of Nim).
15:15:16FromDiscord<haxscramper> https://nim-lang.org/docs/osproc.html#execProcess%2Cstring%2Cstring%2CopenArray%5Bstring%5D%2CStringTableRef%2Cset%5BProcessOption%5D
15:15:33FromDiscord<haxscramper> And use `poParentStreams` to attach stdin/stdout
15:17:38Evolverhaxscramper: I was trying exactly this: `execProcess(myProc, args=args, options={poEchoCmd, poUsePath, poParentStreams})` and then I get:
15:17:38EvolverError: unhandled exception: /snap/nim-lang/1051/lib/pure/osproc.nim(1472, 17) `poParentStreams notin p.options` API usage error: stream access not allowed when you use poParentStreams [AssertionDefect]
15:19:12mipriexecProcess collects the output of the child process. It can't use poParentStreams
15:19:28Evolvermipri: ah, what then can I use?
15:19:48mipriexecProcess, since you don't care about the streams
15:20:16miprior if you do care, startProcess with poParentStreams, and then waitForExit
15:20:18EvolverI need the streams to be streamed to the terminal.
15:20:30FromDiscord<haxscramper> `startProcess`
15:20:40FromDiscord<haxscramper> You need `startProces`, not `exec`, sorry
15:20:53FromDiscord<haxscramper> Because `exec` tries to read from output
15:21:31FromDiscord<haxscramper> And raises exception because streams are attached to parent process
15:21:39Evolvermipri , haxscramper : Thanks. I will try `startProcess` followed by `waitForExit`.
15:23:36FromDiscord<Shucks> Weird. Still with `segfaults` imported I'm not able to catch segfaults
15:26:23mipri!eval echo cast[ptr int](nil)[]
15:26:25NimBotTraceback (most recent call last)โ†ต/usercode/in.nim(1) inโ†ตSIGSEGV: Illegal storage access. (Attempt to read from nil?)
15:26:33mipri!eval import segfaults; echo cast[ptr int](nil)[]
15:26:35NimBot/usercode/in.nim(1) inโ†ตError: unhandled exception: Could not access value because it is nil. [NilAccessDefect]
15:26:52mipriit's a Defect, mind.
15:27:36FromDiscord<Rika> you shouldnt catch segfaults in the first place..
15:27:51FromDiscord<Shucks> !eval import segfaults; try: echo castptr int[] except: echo "foobar"
15:27:52NimBotCompile failed: /usercode/in.nim(1, 29) Error: undeclared identifier: 'castptr'
15:28:05miprithe bot ate most of what I said.
15:28:21miprihttps://irclogs.nim-lang.org/20-12-2020.html#15:26:23
15:28:35FromDiscord<Recruit_main707> lemme try
15:28:36FromDiscord<Recruit_main707> !eval echo cast[ptr int](nil)[]
15:28:38NimBotTraceback (most recent call last)โ†ต/usercode/in.nim(1) inโ†ตSIGSEGV: Illegal storage access. (Attempt to read from nil?)
15:30:01FromDiscord<Shucks> https://play.nim-lang.org/#ix=2ISl
15:30:06FromDiscord<Shucks> mh yea that works here. >.<
15:30:16FromDiscord<himu> Where are the nim source code installed after `sudo apt install nim`. I need the location of `nimsuggest.nim`? I am on Ubuntu.
15:30:22FromDiscord<Rika> are you compiling with --panics:on or something
15:30:47FromDiscord<Shucks> --threads:on --app:lib --gc:arc
15:36:27*Fish-Face quit (Ping timeout: 260 seconds)
15:36:47FromDiscord<haxscramper> @himu I'm not sure if `apt` installs sources, but I suppose it has some way of listing files for a particular package, so you could try this
15:37:00FromDiscord<haxscramper> Though I'd recommend using `choosenim`
15:37:56mipridpkg definitely has something like that. in a pinch just: find /usr -name nimsuggest.nim 2>/dev/null
15:52:36FromDiscord<shadow.> does ufcs not work in pragmas?
15:54:09FromDiscord<Rika> what do you mean
15:58:35miprilike {.128.align.} instead of {.align(128).} I suppose
15:59:12FromDiscord<shadow.> yeah
15:59:26FromDiscord<shadow.> {.bot.event, async.} instead of {.event(bot), async.}
16:03:09FromDiscord<Shucks> So I guess arc is the issue. Compiled with --gc:arc that crashes: https://play.nim-lang.org/#ix=2ISI
16:05:07FromDiscord<shadow.> hm
16:05:16FromDiscord<shadow.> how do you make lambdas w macros?
16:05:19FromDiscord<shadow.> i dont see anything on the docs
16:08:47FromDiscord<shadow.> nvm got it
16:12:48FromDiscord<shadow.> how can i check if a nimnode contains a child?
16:14:50FromDiscord<tiatomee> What does `out T` do and how can it be used? It's quickly mentioned in the manual but not explained anywhere
16:15:14FromDiscord<haxscramper> It crashes compiler
16:15:18FromDiscord<shadow.> indeed
16:15:21FromDiscord<haxscramper> The only use I was able to find
16:15:22FromDiscord<tiatomee> That I noticed :)
16:15:36FromDiscord<haxscramper> Though there is an experimental `out` for types
16:15:56FromDiscord<haxscramper> https://nim-lang.org/docs/manual_experimental.html#covariance
16:17:23FromDiscord<shadow.> should i just make an in overload for nimnode children?
16:18:24disruptekyou mean nimlets?
16:18:54disruptekthe pitter-patter of tiny nimling feet...
16:19:41disruptekyou can use len() on nimnodes, chucklehead.
16:21:28FromDiscord<shadow.> yes
16:21:33FromDiscord<shadow.> but how can i check if a nimnode contains a nimlet
16:21:46disrupteklen
16:21:52FromDiscord<shadow.> no like
16:21:54FromDiscord<shadow.> a specific nimlet
16:21:58FromDiscord<shadow.> only john
16:22:01FromDiscord<shadow.> i dont care if he has steven
16:22:20disruptekthere's a find for recursive, uh, finding.
16:22:21FromDiscord<shadow.> like `if jimmy in fatherNimNode:`
16:22:28FromDiscord<shadow.> i only need top level lol
16:22:28FromDiscord<shadow.> ohh
16:22:31FromDiscord<shadow.> i suppose that'd still wrok
16:22:32FromDiscord<shadow.> lol
16:22:53FromDiscord<shadow.> what does it return if nothing is found?
16:22:55FromDiscord<haxscramper> `node.anyIt(it.kind in {<necessary kinds>})`
16:23:07disruptekdon't make me read the manual to you.
16:23:32FromDiscord<shadow.> probably emptyNode()
16:23:37FromDiscord<shadow.> lol
16:23:39FromDiscord<haxscramper> Or `node.matches([any is Kind()])` but that is magic
16:23:42FromDiscord<shadow.> hmmm
16:23:44FromDiscord<shadow.> thanks
16:24:19disrupteki hope you're attending to my testes right now.
16:25:15FromDiscord<shadow.> hmm
16:25:20FromDiscord<shadow.> after i add this dimscord pragma
16:27:22FromDiscord<haxscramper> diruptek: about nimph and gitnim
16:27:30FromDiscord<haxscramper> And discussion from couple days ago etc.
16:27:53disruptekyeah?
16:28:02FromDiscord<mratsim> @haxscramper, "out" is supposed to allow both in-place and out-of-place procedure with a single function declaration
16:28:03disruptekhurry up, 'cause i gotta take a wicked piss.
16:28:13FromDiscord<haxscramper> If I understand correctly you have these current implementations, but not really working on them right now?
16:28:51disruptekwell, i tend not to work on code that works, has no bugs, and is satisfactorily performant.
16:29:09FromDiscord<tiatomee> That's what I thought. I tried to use it instead of `var` in a parameter, but all it did was crash the compiler :sweats:
16:29:20FromDiscord<mratsim> never tried it :p
16:29:45disruptekgitnim has 9 commits and totals 101 lines.
16:30:27FromDiscord<haxscramper> Okay, so they are like in 'more or less finished state right now'. I just had some ideas that I might wanbt to imeplemnt, so I just wanted to check if these things are still used
16:30:30FromDiscord<haxscramper> well, not used
16:30:47FromDiscord<haxscramper> Alright, good to know
16:30:47disrupteknimph has a version 2 branch that is more ambitious.
16:30:55disruptekit is waiting for concepts fixes.
16:31:03disruptekyou can read the PR to see what it targets.
16:31:19FromDiscord<haxscramper> Yes, I've read it, though not very thoroughly
16:31:24disruptekgitnim is going to start accumulating a distribution of modules in the next week or so.
16:31:55disruptekeach branch will track a similar set of modules, though perhaps at different versions.
16:32:14disruptekwe're trying to reach araq's "batteries included" valhalla.
16:32:40disrupteki will probably experiment with moving the stdlib into modules, also.
16:33:26disrupteki like the idea that the stdlib is a declaration of extant modules, say, by url.
16:33:46disrupteki'll bundle that shit for you, but you can always mutate the list of submodules.
16:34:10disruptekwhat are you thoughts? feel free to type while i drain the main vein.
16:35:34FromDiscord<haxscramper> I want to fininish C++ thing
16:35:40FromDiscord<haxscramper> And then start to contribute
16:35:43FromDiscord<haxscramper> Well
16:36:07FromDiscord<haxscramper> I have several very proof-of-concept ideas, that you might find interesting, though they are just ... I guess in very disorganized state
16:37:17FromDiscord<haxscramper> For now, I just wanted to confirm current state of things mostly
16:38:46disrupteksecrets, huh.
16:39:01FromDiscord<haxscramper> Well, I want to write documentation generator
16:39:07disruptekoh that thing.
16:39:12FromDiscord<haxscramper> And just integrate whole
16:39:18FromDiscord<haxscramper> tests + documentation + atual code
16:39:27FromDiscord<haxscramper> Because unit test are just goldmine of examples
16:39:38disruptekhmm.
16:39:41FromDiscord<haxscramper> And current documentation generator doesn't really cut it
16:40:16disrupteknice, looking forward to reading about it.
16:40:24FromDiscord<haxscramper> I've also worked for some time on tree diffing to automatically generate semantic-ast-diffing changelogs
16:40:35Zevvdisruptek: if you want reading material
16:40:37FromDiscord<haxscramper> Detect API breakages between library versions
16:40:39disruptekah, you should talk to leorize about that.
16:40:46disruptekwe've tossed around some ideas.
16:40:55disruptekzevv: i was able to watch the first half of that talk finally.
16:41:29Zevvthe first half is fine
16:41:30FromDiscord<haxscramper> And just squeeze every line of nim code in your project for data, and use that data to save time for others when using your library
16:41:35Zevvits about acquire/release
16:42:05*ico joined #nim
16:42:06*Zevv quit (Quit: Lost terminal)
16:42:14*ico is now known as Zevv
16:42:14FromDiscord<haxscramper> But that would require keeping some sort of additional metadata in project and solving things like that, and I find it easier to try and base this on nimph and your work
16:42:17FromDiscord<haxscramper> Than nimble
16:42:24Zevvno one ever explaind to me its about acquire and release
16:42:24FromDiscord<haxscramper> But as I already said
16:42:31Zevvi have been lied to\
16:42:53FromDiscord<haxscramper> This is just random smoke in my head
16:43:15FromDiscord<haxscramper> Though if not for this generic caching but, I'd already have working tree diffing
16:43:25disrupteki dunno if i talk about it in the nimph-2 thing, but i plan to cache a lot of project metadata to speed things up.
16:43:47disruptekwe can use that to make the git rolling even faster, and enable queries when the project is dirty.
16:43:50FromDiscord<haxscramper> that is great
16:45:40FromDiscord<dom96> > Detect API breakages between library versionsโ†ตthat would be awesome, I remember Elixir (IIRC) doing something similar
16:46:39disrupteknimph should be able to roll your dependencies to the last or first occasion of API breakage, too.
16:46:56disruptekwe can start with it making sure your tests pass and move forward from there.
16:47:12FromDiscord<Quibono> Hrm, so there is a csources_v1 now, but editing build_all.sh to import it doesnโ€™t seem to be enough for building on M1
16:48:02*haxscramper joined #nim
16:52:45Zevvso did *you* learn anything new disruptek, or was it all old news to you
16:55:19FromDiscord<mratsim> did you read the PhD Thesis of Kerneis on CPC?
17:00:31*Fish-Face joined #nim
17:01:12narimiranZevv: i'm making my first steps in npeg! damn you and your cryptic stuff!
17:02:04FromDiscord<mratsim> yeah when I looked at npeg, i was like, hum hum hum, maybe I'll learn EBNF and all that jazz later
17:02:18FromDiscord<mratsim> I'll just use strscans for now
17:02:22FromDiscord<Quibono> I look at npeg and pee myself a little
17:03:54narimirannpeg has some nice useful stuff which strscans don't. the only problem is: i don't know how to use those superpowers just yet
17:06:24FromDiscord<dom96> parseutils ftw
17:06:41disruptekzevv: there were little factoids here and there but i'm looking forward to the second half.
17:07:30disruptekif you want to see npeg in production...
17:07:32disruptek!requires npeg
17:07:33disbotnpeg: no results ๐Ÿ˜ข
17:07:39narimiran@dom96 i see you never used neither strscans nor npeg :P
17:07:46FromDiscord<Clyybber> disruptek: that backfired lol
17:07:46disruptekdisbot: wtf, dude, are you high?
17:07:47disbotyep. ๐Ÿ˜Š
17:07:53disruptekoh shoot.
17:08:08FromDiscord<ache of head> what
17:08:18FromDiscord<dom96> narimiran: I learned how to parse from the best ๐Ÿ˜›
17:08:34narimirandisruptek: hm, that's strange. i think i saw some packages use npeg
17:08:34disrupteki think disbot is broken.
17:09:45FromDiscord<haxscramper> `gcplat`, `atoz`, `openapi`, `bluu`, `wauto` and some other
17:09:52FromDiscord<haxscramper> Six in total
17:09:58FromDiscord<haxscramper> `github`
17:10:06disrupteknimph.
17:10:19disruptekare you telling me i'm the only person using it?
17:10:24disruptekthat doesn't make any sense.
17:10:46disruptekand who killed disbot?
17:10:51FromDiscord<mratsim> @dom96 doing parsing state machines by hand gets old very fast, and you don't get fancy diagrams and nice error messages
17:11:09FromDiscord<haxscramper> What are the plans for AST construction in npeg, I think I saw some discussion not too long agot
17:11:18FromDiscord<haxscramper> But can't remember where it lead exactly
17:11:27FromDiscord<mratsim> It leads to the dark side
17:11:43FromDiscord<haxscramper> If I only had enough brainpower to finish this earlery parser generator
17:11:49FromDiscord<haxscramper> Earley'
17:11:56FromGitter<bung87> I got benchmark result, my framework slower than jester :(
17:12:42FromDiscord<dom96> @mratsim I prefer it over having to learn a mini-language to do the parsing
17:12:53FromDiscord<dom96> And then having to debug the mini-language when the parsing isn't how I want it
17:13:17FromDiscord<dom96> You don't need fancy diagrams, just good old fashioned procedural debugging skills ๐Ÿ™‚
17:13:28FromDiscord<mratsim> are you using wrkbin @Bung87? https://github.com/olliNiinivaara/GuildenStern/tree/master/bench
17:13:40narimiranungh.
17:15:56FromGitter<bung87> I write a benchmark module combine with `ab` , results is here https://github.com/bung87/Looper/runs/1585198581?check_suite_focus=true
17:16:39FromDiscord<dom96> You should use `wrk` and test it on a dedicated machine, not CI
17:17:41FromDiscord<mratsim> yeah, kill nimsuggest and test on your own machine
17:18:10disruptekdisbot: do you yet live?
17:18:11disbotit is certain.
17:18:19disruptek!requires npeg
17:18:20disbotnpeg: no results ๐Ÿ˜ข
17:18:26FromGitter<bung87> does CI test means something or worth nothing ?
17:18:32*disruptek ๐Ÿคฌ
17:18:39FromDiscord<mratsim> CI test yes, CI benchmarks no
17:18:57FromGitter<bung87> if the results already show mine is slower..
17:19:17Zevvnpeg is a hoax
17:19:19FromDiscord<mratsim> it could be that there was a load spike
17:19:45FromDiscord<mratsim> You can make weave slower than serial by having nimsuggest running on the same PC
17:19:57Zevvits an elaborate GPT2 generated document
17:20:06disrupteki guess.
17:20:13FromDiscord<mratsim> so hasbeen, have you heard about GPT3?
17:20:15Zevvwith nonfunctional code
17:20:24Zevvmpeg predates gpt3
17:20:49disruptekmaybe github now requires auth to perform queries.
17:20:50FromDiscord<mratsim> GPT2 can evolve into GPT3 on its own.
17:21:05FromDiscord<mratsim> you didn't reply btw, have you read Kerneis thesis on CPC?
17:21:10FromGitter<bung87> ok, haven't try `wrk`, `ab` also has problem on my mac
17:21:53*klaufir_ joined #nim
17:21:56narimiranZevv: ok, now that i have your attention.... you'll recognize what this is: https://play.nim-lang.org/#ix=2ITi - can you tell me what am i doing wrong? (and yes, i've seen your solution, but i want to start small)
17:21:58FromDiscord<mratsim> Also question @dom96 how does the stack traces look like in async dispatch? I suppose you don't see anything above poll()?
17:22:31FromDiscord<dom96> @mratsim you do, haven't you seen them before?
17:22:52FromDiscord<mratsim> I just see the thing that starts the event loop
17:23:03FromDiscord<mratsim> not what enqueued the handler
17:23:06FromDiscord<mratsim> at least in chronos
17:23:23FromDiscord<mratsim> so i don't know what the handler reacts to.
17:23:43FromDiscord<mratsim> Apparently CPS would allow that since things are not gobbled up by the event loop.
17:24:00FromDiscord<dom96> huh, did Chronos get rid of this aspect of asyncdispatch?
17:24:07FromDiscord<mratsim> though I still don't know how that materialize since there is no stack anymore ....
17:24:38FromDiscord<mratsim> I'll likely have to just write sample code to compare.
17:25:02FromDiscord<dom96> You will get multiple stack traces with async/await, it's not ideal and there is bound to be a way to merge these together but it's better than nothing.
17:26:31FromDiscord<mratsim> @disruptek @Zevv, are you implementing CPS via Environment or via Lambda Lifting?
17:26:47FromDiscord<mratsim> not sure I get that part.
17:31:58disruptekit's a little of both.
17:32:27disruptekthe 1011 was inspiration, but we've changed our approach a bit from theirs.
17:32:52disrupteki personally want to be able to inject into the environment in the middle of the continuation.
17:33:22disruptekbtw, we do stack tracing pretty trivially.
17:33:27disruptekditto exceptions.
17:34:45FromDiscord<mratsim> it's more that in Kerneis thesis it mentions that it's one of the flaws of event loops
17:35:05FromDiscord<mratsim> And tbh debugging the async part of what we do at Status is a pain
17:35:29disrupteki dunno what kerneis thesis is.
17:35:39disrupteksounds like a skin condition i once had on my lower back.
17:35:47FromDiscord<tiatomee> Is there a way to import a module only to run the top level code but not use any definitions from it?
17:36:06disruptekno.
17:36:23FromDiscord<tiatomee> Darn :/ Is there a way to disable the warnings then at least?
17:36:31disruptekwhich warnings?
17:36:44FromDiscord<tiatomee> the `UnusedImport` warnings
17:36:57disrupteklook at the .push and .pop pragmas in the manual.
17:37:21disruptekyou can use them to turn off warnings for code blocks.
17:38:18disruptekmratsim: also, ignore cps master branch. the work is in the typed branch.
17:38:28FromGitter<bung87> mine โŽ Requests/sec: 23034.08 โŽ Transfer/sec: 2.81MB โŽ jester โŽ Requests/sec: 32027.78 ... [https://gitter.im/nim-lang/Nim?at=5fdf8c1463fe0344960b4e6b]
17:38:46disruptekzevv: we should probably just move it all into master. what do you think?
17:39:01FromDiscord<tiatomee> disruptek: Thanks for the hint, but I don't understand what the syntax for that is to actually disable the warning. The manual doesn't say
17:39:18FromDiscord<dom96> bung87: what http server are you using out of curiosity?
17:40:03FromGitter<bung87> I write a server built upon chronos
17:40:10FromDiscord<dom96> Is the lack of stack traces the biggest obstacle? Am I understanding correctly that you don't get the same stack traces that asyncdispatch provides?
17:40:24FromDiscord<mratsim> @disruptek: https://tel.archives-ouvertes.fr/tel-00751444/document
17:40:27FromDiscord<tiatomee> https://forum.nim-lang.org/t/5461
17:40:32FromDiscord<tiatomee> Interesting, the push/pop doesn't work
17:40:37FromDiscord<tiatomee> but at the end of the module it does work
17:40:48FromDiscord<mratsim> @dom96 unknown never tried asyncdispatch in something even half as complex
17:41:13FromGitter<bung87> hmm my benchmark module dont with jester , it looks like after call `startProcess` there need waits some time
17:41:15FromDiscord<dom96> @mratsim do you have an example of a stack trace you could show me from Chronos handy by any chance? ๐Ÿ™‚
17:42:01FromDiscord<mratsim> mmmh let's see
17:42:02disrupteken anglais, s'il vous plait
17:42:16disruptekfrench class was 30 years ago.
17:42:22FromDiscord<mratsim> (because we have another issue with stacktrace which is when we use libbacktrace everything is mangled)
17:42:32mipritiatomee: it works at the beginning of the module, it just can't be pop'd
17:42:40disruptekoh, i see; it turns into english. ๐Ÿ˜
17:42:42FromDiscord<mratsim> @disruptek, it's only the remerciements that are in French, the rest is English
17:43:10FromDiscord<Daniel> Is Italian bank using nim?
17:43:14disruptekokay, yeah; we have this paper in the repo, i think.
17:43:51FromDiscord<haxscramper> You can put `--warning[UnusedImport]:off` in `nim.cfg` for your project/user/directory
17:43:59FromGitter<bung87> I only seen one GitHub user location is Italy use nim
17:44:04FromDiscord<haxscramper> project or user or ...
17:44:34FromDiscord<haxscramper> Like `~/.config/nim/nim.cfg` for example
17:44:44FromDiscord<tiatomee> I really only want it per-file, so this one pragma is actually fine for now
17:45:38FromDiscord<mratsim> @Daniel I think unicredit is using Nim for small stuff
17:45:49FromDiscord<haxscramper> Then maybe `{.push warning[ProveInit]: off.}`
17:46:07FromDiscord<mratsim> @disruptek you don't have this one, it's the full thesis
17:46:14disruptekahh.
17:46:22disruptekwanna PR it?
17:46:37disrupteki'll just give you push.
17:46:46FromDiscord<mratsim> sure
17:46:51FromDiscord<mratsim> I PR-ed it in mine
17:47:06disruptek...if i can find some bandwidth.
17:47:12FromDiscord<mratsim> don't worry
17:47:12FromDiscord<Daniel> Unicredit is huge, because it has bought out many banks across EU
17:47:20FromDiscord<mratsim> I've PR-ed it in weave-io anyway
17:49:05FromDiscord<dom96> ahh these benchmarks, 4.7 million QPS when I run httpbeast myself. 3.4 million QPS when I run it in the TechEmpower docker container.
17:49:32FromDiscord<dom96> Now it's down to a game of spot the difference...
17:49:34disruptekbut containers are /sooooooo/ great.
17:49:52FromDiscord<mratsim> I'll put a docker in your docker
17:50:17FromDiscord<dom96> aww yiss, 5.3 million QPS with -d:danger
17:51:20FromDiscord<mratsim> one thing I'm curious is I didn't see any mention/comparison with async/await in the CPS paper
17:51:33disruptekheh
17:51:43FromDiscord<mratsim> they talk about event loop and callback hell but async/await solves that as well
17:52:01FromDiscord<mratsim> so I assume it's because it sits at a higher level
17:52:06FromDiscord<dom96> Oh yeah, I noticed that too
17:52:34FromDiscord<dom96> huh, --gc:orc performs really badly
17:52:54FromDiscord<dom96> 285k QPS
17:53:12disruptekhonestly, that's more Qs than i need.
17:53:52FromDiscord<mratsim> that's curious, I though Araq optimized throughput to reach Boehm's level
17:53:59FromDiscord<mratsim> what happens with --gc:boehm?
17:54:21disrupteki'm about to lose access to github because AT&T disconnected my phone so my 2FA is fuxored.
17:54:33FromDiscord<mratsim> I think 20x less perf is a showstopper for ORC
17:54:40disruptekrude.
17:54:46FromDiscord<mratsim> and I say thorughput but actually the bench is about latency I think?
17:55:07FromDiscord<mratsim> download the special codes @disruptek.
17:55:13FromDiscord<mratsim> to restore access
17:55:26disruptekdownload is a word i don't use anymore.
17:55:52disrupteki swear i can whistle 300baud and this sounds slower.
17:55:54FromDiscord<dom96> huh, boehm is similar
17:56:01FromDiscord<mratsim> That's very interestingโ†ต> The cpc_link primitive takes a single argument, a scheduler, either an event loop (forโ†ต> cooperative scheduling) or a thread pool (for preemptive scheduling)
17:56:08FromDiscord<dom96> do they share the same code paths?
17:56:17FromDiscord<mratsim> boehm is a DLL
17:56:21FromDiscord<dom96> I know
17:56:39FromDiscord<mratsim> and no, Boehm is more like mark and sweep I think?
17:56:46FromDiscord<dom96> I just wonder whether the way it's integrated reuses some of the arc/orc code
17:56:56FromDiscord<dom96> it seems like there is a bottleneck in there somewhere
17:57:04FromDiscord<dom96> because it's not using all the CPU
17:57:04disruptekmratsim: you're starting to see why considering async/await doesn't make any sense.
17:57:05FromDiscord<mratsim> ah you think it's something like seq_v2?
17:57:10EvolverHow do I call something like `getmntent` which I believe is provided by Linux?
17:57:22disruptekimportc it.
17:57:45Evolverdisruptek: Is there an example?
17:57:48disruptekdisbot: do you still honor repo requests?
17:57:48disbotas i see it, yes.
17:57:50FromDiscord<dom96> not quite, something before the code hits the GC/allocator
17:57:52disruptek!repo yourang
17:57:53disbothttps://github.com/disruptek/yourang -- 9yourang: 11Thread-safe performant async I/O for Linux 15 5โญ 0๐Ÿด
17:58:11FromDiscord<dom96> For example, maybe it affects how thread local storage is handled
17:58:17FromDiscord<mratsim> async/await does make sense, but it can be implemented on top of CPS just like Kotlin implements async/await on top of coroutines and Swift is considering async/await on top of continuation/coroutines
17:58:23FromDiscord<dom96> arc/orc/boehm all don't need the thread-local heaps, right?
17:58:35FromDiscord<mratsim> no they don't
17:58:43FromDiscord<mratsim> it's all malloc-ed
17:58:43FromGitter<bung87> it always qps lower than jester , transfer higher than jester
17:58:46disruptekmratsim: technically true, yes -- but i don't see what it buys us.
17:59:08FromDiscord<mratsim> I didn't get to that part of the design yet :p
17:59:41FromDiscord<mratsim> still looking on the low level primitives, collecting pros/cons and things to be aware of for the high level ergonomics
17:59:59disruptekyeah, there's not much going on. that's part of what's so brilliant about it.
18:00:29FromDiscord<dom96> refc also gives 5 mil
18:00:44Evolverdisruptek: sorry I am lost. Is there an example of how I can importc `getmntent`?
18:00:53disruptekdom96: do your comparisons against markAndSweep
18:01:11FromDiscord<dom96> disruptek: just tried it, 4.4 mil
18:01:16disruptekEvolver: yourang is an example of hand-written import of an /arbitrary/ linux call.
18:01:36Evolverok
18:01:44disruptekyou can use it with the manual to see how to compose your own such calls.
18:02:16disruptekalso look at, say, the stdlib's posix module.
18:02:45Evolverdisruptek: Anything in particular in the posix module?
18:02:49disruptekno.
18:03:05disruptekvirtually every symbol is imported similarly.
18:03:38disruptekmratsim: once you internalize cps, let's talk about csp.
18:04:03FromDiscord<mratsim> is there anything special to CSP?
18:04:19disruptekit's the valhalla, so, yes.
18:04:34disruptekbut basically, the key is in the rendezvous.
18:05:49disruptekif we get csp right, you'll get proper static analysis and we'll get async to rival go, clojure, etc.
18:05:59disruptekbut with the ergonomics of nim, of course.
18:06:29FromDiscord<mratsim> What does the rendez-vous has over an actor message box which is async?
18:06:50disrupteki did it "by hand" in the cloud by just resuming two continuations at the same time.
18:07:08disruptekrv has no advantage of actors.
18:07:29disrupteki mean, they each may compose equivalents.
18:07:42disruptekrv is inherently sync, actors are inherently async.
18:07:58FromDiscord<dom96> what do you mean by "rendezvous"?
18:08:00disruptekrv is thus inherently more efficient.
18:08:18disruptekthe point at which two processes synchronize.
18:08:20FromDiscord<mratsim> That's what does not compute "we'll get async to rival go, clojure, etc." and "rv is inherently sync"
18:08:42FromDiscord<mratsim> @dom96 a rendez-vous is a channel that can only buffer 1 item.
18:08:57FromDiscord<mratsim> it's open only when 2 threads are in it.
18:09:13FromDiscord<dom96> oh, interesting. TIL.
18:09:16disruptekit's easier to just remove the concept of a channel.
18:09:39FromDiscord<mratsim> communicating sequential process is based on channel but the actual theoretical result depends on rendez-vous channels
18:10:02FromDiscord<mratsim> theoretical result that can be used to prove performance bounds and deadlock freeness AFAIK
18:10:09disruptekyes.
18:10:25disrupteki'm just saying, a channel can confuse the issue for the reader because it suggests space.
18:10:52FromDiscord<dom96> disruptek: what is missing from the current async to satisfy it rivaling Go and Clojure?
18:11:06disrupteksurely you've written async in go.
18:12:09disrupteki prefer rendezvous because it suggests two parties meeting.
18:12:30disruptekthat more accurately captures the semantics that are actually demanded of us.
18:13:02FromDiscord<mratsim> Other models of computations besides CSP are petri nets and Kahn Process Networks
18:13:33disruptekcan we make those with async/await?
18:14:53FromDiscord<mratsim> https://www.dejazzer.com/ece777/ECE777_3_system_modeling.pptx
18:15:08FromDiscord<mratsim> you need rendez-vous ๐Ÿ˜‰
18:15:18disruptekyes.
18:15:38disruptekdo you remember when go came out?
18:15:41FromDiscord<dom96> > surely you've written async in go.โ†ตthat's a non-answer ๐Ÿ™‚
18:15:53disruptekdo you remember why it was such a big deal?
18:16:05disruptekchannels.
18:16:11disruptekchannels was the innovation.
18:16:42FromDiscord<shadow.> aoc day 19 has me stumped
18:16:53FromDiscord<shadow.> my only other thought is just making an npeg list from it lmao
18:17:12FromDiscord<mratsim> I thought it was the goroutine and the absence of difference for the user whether a function blocked or not
18:17:26FromGitter<deech> Can closures be compared for function & environment pointer equality?
18:17:36disruptekyes.
18:17:40FromDiscord<mratsim> accidentally what made go great for IO made it very poor for high performance computing
18:17:43FromGitter<bung87> hmm jester doesn't response date header..
18:18:01disruptekmratsim: yes, but goroutines are exponentially more useful with channels.
18:18:02FromDiscord<mratsim> closures are function + data so fn+env to exec the fn
18:18:39disruptekmratsim: think about this... the fn part is know to us statically. so we should simply make it part of the type system.
18:19:02FromDiscord<mratsim> no don't do this
18:19:21FromDiscord<mratsim> I can't have a queue or deque of task in my scheduler in that case
18:19:28FromDiscord<dom96> it should do so if it's using httpbeast IIRC
18:19:30FromDiscord<mratsim> well this one is easy to type-erase
18:19:32disruptekyou can.
18:19:57FromDiscord<dom96> (that was in response to you bung87, I keep forgetting that it must be confusing for gitter/irc without the quote)
18:20:26FromDiscord<shadow.> is there any way to bypass the regex limit lmao?
18:20:42disruptekonly script kiddies use regex.
18:20:48FromDiscord<shadow.> its for aoc.
18:20:56disruptekditto.
18:20:57FromDiscord<dom96> Ugh, really annoying to see `ulib` (a C++ server) get exactly the QPS I can get if I run it outside their damn docker container.
18:21:02FromDiscord<shadow.> a recursive regex builder was the only solution i could think of
18:21:11FromDiscord<shadow.> i'm not making my own peg
18:21:36FromDiscord<dom96> also, the amount of dependencies some of these top scoring benchmarks pull is ridiculous
18:22:11*ex_nihilo quit (Quit: Leaving)
18:22:13FromGitter<bung87> @dom96 ok but i dont wanna benchmark against buggy server, so far the benchmark seems fine to me.
18:22:43FromDiscord<mratsim> didn't you see the Rust meme from friday about cargo reaching node_modules insanity?
18:22:50FromGitter<bung87> guess the router part may slower than jester
18:22:56FromDiscord<shadow.> is there a proc to set limit like in pcre?
18:23:04disruptekthere's pcre.
18:23:07disruptekgo nuts, chump.
18:23:11FromDiscord<shadow.> lmfao
18:23:12disrupteki mean, shadow.
18:23:34FromDiscord<shadow.> im finding a way to use regex in testes in a meaningful way.
18:23:37FromDiscord<shadow.> just to spite you
18:24:00disruptekoh no.
18:24:05FromDiscord<mratsim> @dom96 https://9gag.com/gag/arV6Vw5
18:24:37FromDiscord<dom96> haha
18:25:01FromDiscord<shadow.> yes
18:26:45FromDiscord<dom96> I really love this meme, the kitten makes it
18:27:22FromDiscord<mratsim> @zevv @disruptek is there a discussion about the pros/cons about the {.cps.} pragma vs a cps: block?
18:27:27FromDiscord<Quibono> It's my all time favorite meme.
18:28:08disruptekmratsim: they both suck. ๐Ÿ˜
18:29:07FromDiscord<mratsim> Well the name is poor, I would prefer as a user either {.suspend.} or {.suspendable.} or {.resumable.}
18:29:14FromDiscord<mratsim> but in terms of usage
18:30:28FromGitter<ynfle> Is there a way to `{.borrow.}` an implementation inside a proc?
18:30:33disruptekno.
18:31:16FromDiscord<dom96> hm, so far I've ensured the Nim version, nimble version, gcc version, and ubuntu version are the same.
18:31:20FromDiscord<dom96> Still seeing a discrepancy
18:31:39FromGitter<ynfle> So if I want a `distinct seq[int]` and be able to add, insert, delete etc. those funcs have to be exposed at the module level?
18:31:45FromDiscord<dom96> Starting to wonder if it's just the Docker tax
18:32:01disruptekynfle: just use conversion to call the original procs.
18:32:20disruptekadd(seq[int] x, value)
18:32:36FromGitter<ynfle> Is that "expensive"?
18:32:39disruptekno.
18:32:45FromGitter<ynfle> Thanks
18:32:51FromDiscord<mratsim> zero-cost ๐Ÿ˜›
18:33:01FromDiscord<mratsim> it's a no-op in C
18:33:02FromGitter<ynfle> "zero-cost" or zero-cost
18:33:09disruptekthe rare and elusive zero cost abstraction...
18:33:09FromGitter<ynfle> Oh ok
18:33:47FromDiscord<shadow.> hmm
18:33:54FromDiscord<shadow.> can you access captures in re
18:34:12FromDiscord<shadow.> like capture groups
18:34:14disruptekit wouldn't be very useful if you couldn't.
18:34:25FromDiscord<shadow.> well i meant like
18:35:19FromDiscord<shadow.> `"joe smith".match(re"([a-z]+) ([a-z]+)")`, how can i extract what the first and second groups matched
18:36:12FromDiscord<mratsim> sent a long message, see http://ix.io/2ITG
18:36:16FromDiscord<dom96> why the hell can I not pass a dockerfile filename to docker
18:36:36FromDiscord<mratsim> Does CPS for Nim work with Nim exceptions and try/finally with refc?
18:36:39FromDiscord<dom96> had to rename the thing to `Dockerfile` for it to work
18:36:50FromDiscord<mratsim> I don't understand docker
18:36:57disruptekmratsim: sure.
18:36:59FromDiscord<mratsim> why are you squatting my var/lib space
18:37:26FromGitter<jrfondren> shadow.: https://play.nim-lang.org/#ix=2ITH
18:37:45FromDiscord<mratsim> @shadow. use strscans
18:37:55FromDiscord<mratsim> if you use regex to solve a problem you have 2 problems
18:38:00FromDiscord<shadow.> strscans aren't extensive enough for what i need currently
18:38:16FromDiscord<haxscramper> `docker build -t nim-base -f nim-base-dockerfile .` should work, but IIRC it still should have "docker" somewhere in the name
18:38:18FromDiscord<shadow.> thanks jrfondren
18:38:22FromDiscord<shadow.> is there any way to do that with findall?
18:38:26FromDiscord<shadow.> and return a 2d array of matches
18:38:30FromDiscord<shadow.> captures
18:38:48FromGitter<jrfondren> meanwhile: https://play.nim-lang.org/#ix=2ITI
18:38:55FromDiscord<haxscramper> Well, in general it should work at elast
18:39:13FromDiscord<haxscramper> In general meaning this specific single example
18:39:15FromGitter<jrfondren> shadow, findAll returns a seq[string]
18:39:18FromDiscord<dom96> I had a `httpbeast.dockerfile` and tried changing the `.` to it
18:39:25FromDiscord<dom96> ugh, now I can't terminate the darn container
18:40:24FromDiscord<mratsim> sent a long message, see http://ix.io/2ITK
18:40:30FromDiscord<mratsim> @disruptek
18:40:42FromDiscord<mratsim> I don't remember if static proc worked fine
18:40:43FromDiscord<shadow.> fair enough
18:40:56FromDiscord<dom96> Can't have flags after the image name? Bleh
18:43:34FromDiscord<haxscramper> I thought about making wrapper generator for CLI programs
18:43:36disruptekmratsim: i'm not sure what they're talking about is what i'm talking about, but consider a graph of every "resumption" function that cps might generate... we know statically where we can continue from any such function. that data only needs to be accessed by the dispatcher.
18:43:58FromDiscord<dom96> I ran the dockerfile that the TechEmpower benchmarks run and got less than a million
18:44:04FromDiscord<dom96> (edit) "I ran the dockerfile that the TechEmpower benchmarks run and got less than a million ... " added "QPS"
18:44:06FromDiscord<dom96> much confused
18:44:06FromDiscord<haxscramper> Something like cligen in reverse
18:45:54FromDiscord<mratsim> sent a long message, see http://ix.io/2ITM
18:46:19disruptekyes, you are drinking the kool-aid.
18:47:00FromDiscord<mratsim> it's basically goroutines magic with a mathematically proven transformation
18:47:07disruptekyep.
18:48:19disruptekwhen i was a child, i spoke like a child, i thought like a child, i reasoned like a child. when i became a man, i gave up async/await.
18:48:23FromDiscord<dom96> Reading that I saw a lot of parallels with the plan to implement awaitable FlowVars.
18:48:44FromDiscord<dom96> In fact the paper mentions the same use cases: synchronous IO which blocks
18:49:06FromDiscord<dom96> So I don't really see much of a difference between these approaches.
18:49:37disruptekone is an elegant and simple solution that is provable, efficient, and accurately models the semantics we want. the other is async/await.
18:49:50FromDiscord<mratsim> However I don't really like their sync via condition variables. They should use the system event queue I think?
18:50:15disrupteka mere dispatcher impl detail.
18:50:21FromDiscord<mratsim> Ok
18:50:42FromDiscord<mratsim> Glibc condition variables are buggy and should be avoided ... made me lose 2 weekends
18:51:00FromDiscord<dom96> You can use as many adjectives as you want, I'm more interested in the details.
18:51:26disrupteki told you we cannot be friends if you won't read the paper and agree with me.
18:51:41FromDiscord<mratsim> sent a long message, see http://ix.io/2ITO
18:51:42disruptekyou're not interested enough to read, ergo we cannot be friends.
18:51:47FromDiscord<dom96> I read it
18:51:52FromDiscord<mratsim> haha, author agrees that Condition Variable are bad :p
18:52:09FromDiscord<mratsim> I think the paper is missing several details that are in the PhD Thesis
18:52:24FromDiscord<mratsim> but disruptek didn't read the thesis either
18:52:25FromDiscord<dom96> And it's not that I necessarily disagree, I am just trying to understand it better
18:52:38disruptekask an intelligent question, maybe.
18:53:11disrupteki impl a dispatcher because i needed to compare simple task registration and execution against async.
18:53:20disrupteki wanted to see more than a toy iterator.
18:53:32disruptekzevv breaks my balls over this, but it makes for a more compelling demo.
18:53:51disruptekalso, i think yardanico showed that the cps version has like 80% less overhead or something.
18:53:53FromDiscord<dom96> I am asking intelligent questions, I'm still waiting for an answer to at least two
18:53:57disrupteki forget what numbers he came up with.
18:54:01disruptekdom96: which?
18:54:15disruptekdon't ask me about async. ask me about cps.
18:54:21FromDiscord<dom96> it doesn't matter since you obviously don't have an answer
18:54:29disrupteksuit yourself.
18:54:50*PMunch quit (Ping timeout: 265 seconds)
18:55:05FromDiscord<dom96> I'll wait for Zevv to come back and discuss instead, or maybe mratsim can give me his thoughts
18:56:01disrupteki will tell you what i know about flowvars: they are special-cased in the compiler. even in the backend. no, thank you.
18:56:08FromDiscord<mratsim> I'm at p55 out of p186 and I don't have that much experience in async IO. I can comment on scheduler and things that might impact perf but that's mostly all
18:56:24FromDiscord<mratsim> Flowvars aren't
18:56:28FromDiscord<mratsim> it's spawn and aprallel
18:56:59disruptekwell, i don't know what he's asking about, then.
18:58:00FromGitter<kayabaNerve> I wrote a closure iterator and it crashes the compiler when I call it
18:58:03FromDiscord<mratsim> He is asking what's the difference on putting blocking IO on a threadpool and awaiting a FLowvar or a channel in the current async/await and putting blocking IO on a threadpool in CPS.
18:58:20FromGitter<kayabaNerve> ` Error: internal error: expr: var not init loadDatasFromTip_451776332` No idea why. Would love any ideas.
18:58:36FromDiscord<mratsim> Assume that the compiler just insulted you
18:58:47FromGitter<kayabaNerve> I did try emptying the body. An iterator with just `discard` has the same issue.
18:59:30FromGitter<kayabaNerve> mratsim: That to me or the previous discussion I appear to have interrupted by accident?
18:59:34FromGitter<kayabaNerve> Because it does insult me daily :(
18:59:40FromDiscord<mratsim> your error
18:59:41FromDiscord<dom96> > He is asking what's the difference on putting blocking IO on a threadpool and awaiting a FLowvar or a channel in the current async/await and putting blocking IO on a threadpool in CPS.โ†ตindeed, precisely
19:00:07disrupteki've not used nim's threadpool, but the difference is that cps naturally moves continuations between threads ad hoc.
19:00:18disrupteki'm speaking of a generic threadpool concept.
19:00:57disruptekthis is very sympathetic to, you might say synergizes with, arc/orc.
19:01:56FromDiscord<dom96> sent a code paste, see https://play.nim-lang.org/#ix=2ITX
19:02:16FromDiscord<dom96> (edit) "https://play.nim-lang.org/#ix=2IU0" => "https://play.nim-lang.org/#ix=2ITZ"
19:02:49FromDiscord<dom96> wow, the bridge handled that really poorly
19:03:01FromDiscord<dom96> https://media.discordapp.net/attachments/371759389889003532/790293192250753084/unknown.png
19:03:18FromDiscord<dom96> CC @Yardanico
19:06:23*PMunch joined #nim
19:15:59ForumUpdaterBotNew thread by Alexeypetrushin: Nim API for Interactive Broker, see https://forum.nim-lang.org/t/7272
19:16:12FromGitter<bung87> `Socket errors: connect 0, read 336, write 1, timeout 0` what about the socket errors? I have no idea
19:16:18*abm joined #nim
19:16:20FromGitter<bung87> when use wrk
19:17:35FromDiscord<dom96> it means the server is doing something wrong
19:18:26FromGitter<bung87> hmm, both jester and mine have
19:20:58FromDiscord<mratsim> I benchmarked httpbeast via wrk not jester personally
19:27:08FromGitter<bung87> I decrease -c from 400 to 100 no that errors, seems os related.
19:27:49FromDiscord<Clyybber> disruptek: hey which trackball mouse do you use again?
19:27:54giacosealmove, any news?
19:28:13giacoabout the tournament, obviously
19:28:48FromDiscord<sealmove> Oh I did great, 5 wins, 1 loss, 2nd place.
19:29:29FromDiscord<sealmove> Didn't have time to fix binarylang, will do that in a couple of hours
19:29:32giacosuper!
19:47:14Zevvdom96: sup
19:50:30disruptekclyybber: i have an mx ergo.
19:51:40disruptekreally good. the red/black thumbball wired model is also really good, but lower resolution, and usually around $15-20 on eBay iirc.
19:54:33FromDiscord<mratsim> I don't know how you figured the CPS transformation passes ugh.
19:54:52Zevvfrom the code?
19:54:57Zevvthe code is *horrible*
19:54:58Zevvreally
19:55:02disruptekrude.
19:55:18FromDiscord<mratsim> the code you wrote?
19:55:26ZevvI deny everything
19:55:27FromDiscord<mratsim> It's OK, functions are target and tiny
19:55:32FromDiscord<mratsim> targeted
19:55:35*hnOsmium0001 joined #nim
19:55:45FromDiscord<mratsim> but there is no "pass foo" "pass bar"
19:55:51FromDiscord<mratsim> so I don't know what is what
19:55:55ZevvI'm not sure how much of that code can be traced back to me
19:56:47FromDiscord<mratsim> Do you implement the optimization like "percolating"?
19:56:55FromDiscord<mratsim> to reduce the number of lifted variables?
19:57:00FromDiscord<dom96> Zevv: curious what your thoughts are on the above, essentially the question is: https://irclogs.nim-lang.org/20-12-2020.html#18:58:03. But more context above.
19:57:24disruptekreduce the number of variables?
19:58:04FromDiscord<mratsim> https://media.discordapp.net/attachments/371759389889003532/790307046830243890/unknown.png
19:58:22Zevvdom96: I think the biggest difference is that with CPS there is no allocation of futures or flowvars for each async operation
19:58:24FromDiscord<mratsim> https://media.discordapp.net/attachments/371759389889003532/790307132360753192/unknown.png
19:58:47Zevvdom96: the thing with CPS is that most of it kind of "disappears"
19:59:05Zevvit doesn't add stuff to make things async. No futures or other things.
19:59:56FromDiscord<shadow.> zevv i finally did day 19 lol
20:00:02Zevvwoohoo, all of it?
20:00:07FromDiscord<shadow.> yup
20:00:09Zevvnice
20:00:12FromDiscord<shadow.> really really slow execution but
20:00:14FromDiscord<shadow.> whatever
20:00:19disruptekmratsim: i can't remember if we optimize those out.
20:00:25FromDiscord<shadow.> takes like 2 seconds on danger and gc arc lmao
20:00:28disrupteki think we do.
20:00:34Zevvdisruptek: optimize what out
20:00:43Zevvshadow.: no one cares, you got your *
20:00:43disrupteklocals that don't survive splits.
20:00:48FromDiscord<mratsim> "classical" big step reduction rules, is that common knowledge? https://media.discordapp.net/attachments/371759389889003532/790307736118099998/unknown.png
20:00:53Zevvwell we split everything
20:00:56Zevvbut we shouldn't
20:00:59Zevvit's an optimization
20:01:25Zevvnow we don'y look at where we *need* to split because something might want to yield
20:01:30Zevvwe just split on all control flow
20:01:54Zevvso we also end up with procs that need to trampoline even if nothing yield-y is happening
20:02:00Zevvthat's silly, of course
20:02:10disruptekof course, but until we iron out the syntax, it's necessary.
20:02:18Zevvright
20:02:21disruptekright.
20:02:29FromGitter<ynfle> Is the `{.global.}` pragma useful for `proc`s defined inside `proc`s?
20:02:31FromDiscord<mratsim> right..
20:02:45disrupteki merged typed into master.
20:02:49Zevvthe two dot's make it look like your heart is not in it mratsim
20:03:06FromDiscord<mratsim> it means someone should have followed with right...
20:03:07Zevvdisruptek: master was broken already, so it's broken in a different way now
20:03:15disruptekso master now has the shim for `let x = cpscall()` now.
20:03:27Zevvah yes
20:03:29disruptekfor whatever that's worth...
20:03:36Zevvfunny how much of all this I just plainly forgot
20:03:41disrupteki know, right?
20:03:51Zevvrm -rf *; cleanroom
20:03:55FromDiscord<mratsim> It's just that as is, CPS is not equivalent to Lua coroutines as you can't choose the continuation you switch to
20:04:10disruptekwhy not?
20:04:14Zevvsure you can. I can just continue any other continuation?
20:04:30FromDiscord<mratsim> so waiting to reach the section that talks about the "queue of continuation" to see if I can remove that limitation
20:04:30disruptekdon't read too much into the papers.
20:04:36ZevvI have two "threads" going on, and I choose which one to run by picking which continuation to trampoline
20:04:39disruptekyou can.
20:04:54disrupteklook, i never graduated high school.
20:04:55FromDiscord<mratsim> in Lua you have an coroutine identifier so you can tell after this jump to that
20:05:01disruptekit's not important to understand the equations.
20:05:21Zevvit /might/ be important. but we don't. so it's safer to assume that's ok
20:05:36disruptekwell, that's where mratsim comes in...
20:05:54FromDiscord<mratsim> I don't try to understand equations related to FP or concurrency, those are just mindboggling
20:06:06disruptekokay, then we'll have to replace you.
20:06:08FromDiscord<mratsim> Math or crypto OK
20:06:14ZevvI throroughly enjoy observing how differntly it works for him and for us
20:06:26Zevvhere we are, two plumbers just fickin around
20:06:41Zevvmratsim: never too old, right?
20:06:49Zevvtry it, you'll like it
20:06:49disruptekhttps://media.discordapp.net/attachments/371759389889003532/790307736118099998/unknown.png
20:06:57disruptekoops.
20:07:05disruptekthis is the one i wanted to share: https://archive.org/details/theorypracticeof00rosc/page/n9/mode/2up
20:07:16*habamax quit (Ping timeout: 240 seconds)
20:07:29disruptekhttp://www.cs.ox.ac.uk/people/bill.roscoe/publications/4.pdf
20:07:41FromDiscord<mratsim> In lua the coroutine is an object: https://www.lua.org/pil/9.1.html
20:07:53disruptekhttp://www.unifyingtheories.org/
20:07:55FromDiscord<mratsim> and there is no scheduler the dev control the suspension and switch
20:07:57Zevvthere is no such thing as an "object" in lua
20:08:05Zevvit's a first class type
20:08:28Zevvyou can call "resume()" on it, and that's about it
20:08:40FromDiscord<mratsim> yes
20:08:50disruptekgotta take bentley for a run and then lick his balls; bbiab.
20:09:03FromDiscord<mratsim> but when you want Lua coroutines isn't about having a first class type that you can manipulate
20:09:05Zevvand resume() means something like "while fn: fn = fn(env)"
20:09:37ZevvI can make a "coroutine" object time in Nim, and make it have a resume() proc that just trampolines
20:10:28Zevvhttp://ix.io/2IUj
20:10:29FromDiscord<mratsim> ok
20:11:05FromDiscord<j-james> why do negative indices start with 1?
20:11:06FromDiscord<mratsim> so the CPS primitives we have in CPS are enough to implement lua coroutines
20:11:08Zevvthere it is. lua-like coroutines on cps, the whole implementation including a test case in 40 lines
20:11:21FromDiscord<mratsim> that's nice
20:11:25Zevvwhat we can't do is pass data around with yield() and resume()
20:11:32FromDiscord<mratsim> that means I don't have to scratch my head about that
20:11:35FromDiscord<mratsim> ah
20:11:42Zevvdisruptek has ideas about doing that, but with the typing it's pretty hard to do anyway
20:12:11Zevvit's also a syntax thing I believe, and the question where we stash the stuff that needs to be passed around
20:12:57FromDiscord<mratsim> you add a channel in the coro and send before resuming
20:13:06FromDiscord<dom96> Now Iโ€™m curious whatโ€™s missing from closure iterators for a Lua coroutines implementation ๐Ÿ™‚
20:13:17Zevvdom96: ask pmunch
20:13:29PMunchHuh?
20:13:35PMunchAsk me what?
20:13:39FromDiscord<mratsim> Mic drop
20:13:41Zevvyou did a coroutine implementation on iterators, or was that not you
20:13:47PMunchYeah that was me
20:13:55PMunchWell you did one as well didn't you?
20:14:01Zevvnot on iterators.
20:14:06PMunchAh
20:14:07ZevvI hit walls
20:14:11Zevvso i went to ucontext
20:14:26Zevvand then araq got sight of that, and started poking me about CPS
20:14:29FromDiscord<mratsim> https://i.kym-cdn.com/photos/images/newsfeed/001/273/942/c29.jpg
20:14:37FromDiscord<dom96> Lol
20:14:40Zevvand now here I am and everybody is blaming me
20:14:59PMunchThis little thing: https://github.com/PMunch/fibers/blob/master/example.nim
20:15:15PMunchHaha
20:15:16FromDiscord<dom96> So what problems did you run into PMunch?
20:15:16FromDiscord<haxscramper> `arr[^1] == arr[arr.len - 1]` probably
20:15:17Zevvanyway, I need to socialize a bit. Might be back later
20:15:40FromDiscord<haxscramper> At least this does make sense if you think about it like this
20:16:31FromDiscord<shadow.> pmunch did you ever do aoc day 19?
20:16:42FromDiscord<shadow.> i just finished it and i gotta say that sucked my soul lmfao
20:17:02PMunch@shadow. looking at part 2 now
20:19:00FromDiscord<haxscramper> By the way @dom96 `#internals` channel is still not bridged (`#nim-internals`), but considering amount of heavy technical discussion related to async etc. in `#main`
20:19:13FromDiscord<haxscramper> It might be a good idea to avoid crosstalk
20:19:27FromDiscord<dom96> PMunch: or were you able to implement Lua coroutines with Nimโ€™s iterators without any roadblocks?
20:20:22FromDiscord<dom96> Sure, we should bridge it. But thatโ€™s not something I have access to. @Yardanico needs to set it up.
20:20:31PMunchI wasn't really looking at Lua coroutines
20:20:54PMunchI was just listening to what Zevv said he wanted and implemented something like that
20:20:57FromDiscord<dom96> Would be useful to set up irc logs for that channel too
20:21:21FromDiscord<dom96> Right...
20:21:40FromDiscord<mratsim> sent a long message, see http://ix.io/2IUq
20:23:05FromDiscord<dom96> I feel like Iโ€™m hearing a bunch of supposed advantages that donโ€™t really exist.
20:24:33FromDiscord<mratsim> due to tail call you only have 82 bytes per continuation chain. You don't have unbounded heap growth
20:25:00FromDiscord<mratsim> I assume this is similar to https://github.com/weavers-guild/weave-io/tree/master/research#forkjoin-parallelism-color
20:25:44FromDiscord<mratsim> > A side note: continuation stealing ensures that on a single-thread order of execution of the program is the same as it's serial equivalent. Also child stealing suffers from unbounded suspended tasks spawned since they are only worked on late. It's an excellent way to DOS GCC OpenMP implementation.
20:26:40FromDiscord<mratsim> (i'm quoting myself so no authoritative ;))
20:27:16FromDiscord<j-james> Speaking of bridges, it'd be nice if the Discord-Matrix bridge was overhauled or updated
20:27:58FromDiscord<j-james> and / or #freenode_#nim:matrix.org moved to #nim:matrix.org for discoverability
20:30:35*Nightingaleski joined #nim
20:33:15*Nightingaleski left #nim (#nim)
20:36:23FromDiscord<dom96> Not sure how these bridges get created to be honest.
20:43:00FromDiscord<mratsim> sent a long message, see http://ix.io/2IUv
20:44:27FromDiscord<mratsim> okay finished reading the thesis
20:46:45*Jesin quit (Quit: Leaving)
20:54:16Zevvso, get to work then!
20:55:32FromDiscord<Quibono> Does this mean weโ€™re getting cheap threads?
20:55:48Zevvdepends on who you ask
20:55:54disruptekask dom96.
21:02:16FromDiscord<dom96> Weโ€™ve already got cheap threads technically
21:03:15*NimBot joined #nim
21:06:16disrupteklqdev: only chumps use systemd.
21:06:38FromDiscord<lqdev> disruptek: only chumps post in the wrong channel.
21:06:39*narimiran quit (Ping timeout: 260 seconds)
21:06:56FromDiscord<lqdev> but i fully agree with your opinion.
21:07:06disruptekonly chumps spam in offtopic.
21:08:45FromDiscord<lqdev> my main reason for using systemd is that i want a good repo like arch's but can't be arsed to install gentoo
21:09:31disruptekdoesn't seem like a great reason.
21:09:45*Jesin joined #nim
21:11:26*vicfred joined #nim
21:15:12*fanta1 quit (Remote host closed the connection)
21:29:27*haxscramper quit (Remote host closed the connection)
21:34:24*PMunch quit (Quit: leaving)
21:36:52FromDiscord<shadow.> can you use sugar collect with newString?
21:38:50FromDiscord<juliuskiesian> how do you get an array of all possible values of an enum?
21:39:05*aenesidemus joined #nim
21:40:52FromDiscord<exelotl> @juliuskiesian what's your use case?
21:41:53FromDiscord<exelotl> if it has to be a (fixed-length) array then your best bet is a macro, but that might not be what you really want
21:43:36FromDiscord<exelotl> if a seq is fine, then you can use https://nim-lang.org/docs/sequtils.html#toSeq.t%2Cuntyped
21:55:21jkenHow can I iterate a seq of a given type and make them mutable? My brain tried `for var thing in things:` but no go
21:55:38FromDiscord<sealmove> you can't, use index
21:55:49FromDiscord<sealmove> `for i in 0 ..< things.len`
21:56:36jkenthen `var thing = things[i]`?
21:56:45FromDiscord<shadow.> or just do
21:56:49FromDiscord<sealmove> yup
21:56:49FromDiscord<shadow.> `for thing in things.mitems:`
21:57:04FromDiscord<sealmove> oh right there is mitems, i forgot
21:57:09jkenof course! lol
21:57:33jkenworks like a charm
21:57:40jkenthanks!
21:58:45FromDiscord<sealmove> mitems seems dangerous practice though
22:06:11FromDiscord<shadow.> is there a better way to reverse a string than `s.reversed.join("")`
22:06:18FromDiscord<DeltaPHC> Nothing wrong with mutable iteration so long as you don't push/remove any items
22:07:16FromDiscord<shadow.> yeye
22:12:56leorizeand if you do add/remove items, the iterator will fail with an assertion error
22:21:25Fish-FaceSo I am using a package which allows the creation of structures in a DSL through the use of macros. If I want to run that on runtime data, how would I do it? Short of writing data to a file and executing the nim compiler externally...
22:29:16FromDiscord<ElegantBeef> You'd basically need to make your own interpreter and make a node construct similar to the json parser
22:29:56FromDiscord<ElegantBeef> If the entire thing works in nimscript you could use the nimVM to return the data
22:31:53FromDiscord<ElegantBeef> I did something similar for one day of advent of code it's here if you want to see https://forum.nim-lang.org/t/7162#45998
22:33:59FromDiscord<sealmove> @giaco you up?
22:34:35giacoyes!
22:34:41FromDiscord<19> hello, where is the gcc nim compiler located on linux?
22:34:48FromDiscord<sealmove> just pushed the fix, try it out ๐Ÿ˜‰
22:35:07FromDiscord<ElegantBeef> What do you mean "the gcc nim compiler"
22:35:09giaco(y)
22:35:18FromDiscord<ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/790346616204427294/unknown.png
22:35:47FromDiscord<sealmove> btw there is an incovenient, since parsers always return tuples, you will get a `seq[tuple[seq]]` instead of `seq[seq]`
22:36:04giaconot a problem
22:36:33FromDiscord<19> @ElegantBeef oh i thought it had it's own compiler
22:36:33FromDiscord<sealmove> inconvenience
22:36:43FromDiscord<19> i think in windows it has MinGW64
22:36:46FromDiscord<ElegantBeef> No nim outputs C code then sends it through a C/C++ compiler
22:36:55FromDiscord<ElegantBeef> You can even use Zig's compiler if you're daring
22:37:56FromDiscord<19> @ElegantBeef did you ever get this error `undefined reference to exp@@GLIBC_2.29` on linux
22:38:04FromDiscord<ElegantBeef> nope
22:38:14FromDiscord<19> gcc
22:38:41giacodinner time now, gotta try it later
22:38:57FromDiscord<ElegantBeef> Wonder if Fish-face seen my response ๐Ÿ˜„
22:39:12Fish-FaceI had not
22:42:18FromDiscord<ElegantBeef> What DSL are you using fish?
22:42:31Fish-Faceit's for day 19's AoC so nimly :P
22:43:26FromDiscord<juliuskiesian> a seq is fine for now, but i'm very interested in a macro that does this. could you give me hint on how to do it? thanks.
22:43:45FromDiscord<ElegantBeef> I've never used/looked at it, but yea you might be able to abuse the Nim VM to get it to work at runtime
22:44:17FromDiscord<ElegantBeef> I dont know what type of data it returns and what's required
22:44:45FromDiscord<exelotl> @juliuskiesian also just to make sure, have you seen Nim's `set` type and does that fill your need?
22:46:32FromDiscord<ElegantBeef> Based off your original question a set is the most sensible, you could also do `array[Enum,bool]` which would be similar but be a byte per value instead of a bit per value
22:47:23FromDiscord<ElegantBeef> The abillity to make an array that takes enums as values is pretty top notch imo ๐Ÿ˜„
22:47:30FromDiscord<ElegantBeef> (edit) "values" => "indicies"
22:47:36FromDiscord<exelotl> yeah it's amazing haha
22:59:10*Vladar quit (Remote host closed the connection)
23:14:17FromDiscord<exelotl> Feels like I'm close to doing it without a macro... https://play.nim-lang.org/#ix=2IVl
23:14:42FromDiscord<exelotl> but idk how to get the return type to be correct (or if that's even possible)
23:16:35disruptekleorize: my testes now creates a test runner binary and nimble can build it and says it is "installed" but i guess it isn't in the PATH and i cannot run it. have you run into this issue in setup-nim? should i manually add a nimble directory to my path?
23:17:30leorizesetup-nim do adds ~/.nimble/bin to PATH and is tested with nimterop's toast via CI
23:17:45disruptekhmm, weird.
23:18:52giaconow can I ask nimble to update a dependency to #head?
23:19:05leorizeI would recommend against that
23:19:37leorize`#head` is a terrible "version" in which it is always considered to be the "newest"
23:19:54giacoI have already it installed, but nimble c says it is already satisfied and nimble install won't get it
23:20:09leorizeso it breaks dependency resolution in subtles and horrible ways
23:20:16leorizeI'd recommend pinning a commit instead
23:20:33leorizeyou can force the installation via `nimble install <package name/url>#<commit>`
23:20:46leorizecorrection: `nimble install <package name/url>@#<commit>`
23:20:47disruptekuse tags instead, please.
23:21:13leorizeand yes, ask the author to tag the version with the fix you need
23:22:46giacoleorize: I know, I'm testing a library still under development
23:23:12leorizethen use `nimble develop`
23:24:40ForumUpdaterBotNew thread by Pumpus: NIM 32 bit dll, see https://forum.nim-lang.org/t/7273
23:25:18giacousing url@#head instead of url#head worked out nicely. Thanks
23:25:43disruptekthe syntax varies from the cli to the .nimble file for no particular reason.
23:28:11FromDiscord<ElegantBeef> It doesnt vary though
23:28:19FromDiscord<ElegantBeef> Atleast for nimble
23:29:37giacoI also don't understand why "nimble c" would not update a dependency with "#head" when repo get updated
23:30:01leorizebecause nimble is dumb and it doesn't understand git
23:30:32disrupteki don't see what my testes are doing differently than nimterop.
23:31:04disruptekand `check` reports that i need skipDirs though it's specified in my .nimble.
23:31:15disrupteki dunno how anyone tolerates this shit.
23:31:37disruptekeven the docs are contradictory.
23:31:46leorizedisruptek: can I see your CI run?
23:32:02disruptekhttps://github.com/disruptek/skiplists/runs/1585947925
23:32:47disruptekoh wait, linux is working. maybe i need to add .exe to the bin.
23:33:01leorizeI think I know what's wrong
23:34:08disruptekmaybe installExt, too.
23:34:15leorizeofc my windows test wouldn't catch this...
23:34:33*disruptek throbs.
23:34:42leorizethe issue is that Windows and git bash treats PATH differently
23:35:02disruptekyou mean ; versus : ?
23:35:27disruptekhow does toast end up working?
23:35:59leorizedisruptek: nope, it's `/` vs `\`
23:36:05disruptekgah.
23:36:36disruptekyou really think that's the problem?
23:36:50FromDiscord<ElegantBeef> Windows accepts both though, so i dont think it should be
23:37:18disrupteki'm thinking it's installExt.
23:37:21leorizedisruptek: yes, not the first time I have to deal with this kind of stupidity
23:38:03leorizeanyone has windows here?
23:39:15disrupteki've been dealing with a test failure in windows for /days/ now.
23:39:22disruptekjust from my little bloom filter.
23:39:39*tane quit (Quit: Leaving)
23:39:44disruptekabsolutely infuriating. it crashes before emitting any output at all.
23:41:14disruptekseems to be due to arc, or i'd just say /fuck it/ and move on.
23:42:05FromDiscord<KingDarBoja> `\\` ๐Ÿ˜„
23:42:30*wowaname joined #nim
23:42:37*wowaname is now known as opal
23:51:57FromDiscord<KingDarBoja> I totally forgot/cannot find how to write file from a JsonNode in Nim lang ๐Ÿ™ˆ
23:52:47FromDiscord<KingDarBoja> (edit) "I totally forgot/cannot find how to write file from a JsonNode in Nim lang ๐Ÿ™ˆ ... " added "any ideas?"
23:53:00FromDiscord<ElegantBeef> https://nim-lang.org/docs/io.html
23:53:05FromDiscord<ElegantBeef> plus `$`
23:55:13FromDiscord<KingDarBoja> sent a code paste, see https://play.nim-lang.org/#ix=2IVv
23:56:52FromDiscord<KingDarBoja> sent a code paste, see https://paste.rs/51d
23:57:34FromDiscord<ElegantBeef> Well yea
23:57:39FromDiscord<KingDarBoja> Ah shit, it is a varargs
23:57:51FromDiscord<ElegantBeef> the second argument for varargs is what's applied to all values
23:58:04FromDiscord<ElegantBeef> in this case all values passed to write, are stringified
23:59:07giacoI have a seq[tuple[foo: int]], I need to flat this into a single seq/array. I'm trying to use concat from sequtils but how can I unpack it as varargs?
23:59:31FromDiscord<ElegantBeef> What do you mean unpack it as varargs?