<< 28-12-2020 >>

00:00:46FromDiscord<Recruit_main707> disruptek, (or anyone else): you said i could get the pragmas applied to a typed object, but can i do it this way somehow?↵https://play.nim-lang.org/#ix=2K39
00:01:49disruptekthe pragma goes after the `object` keyword.
00:02:20FromDiscord<Recruit_main707> ah, ty
00:03:00FromDiscord<sealmove> @disruptek it seems to be an issue when nesting tuples more than 2 levels
00:03:15disruptekneat.
00:03:29disruptekif you produce a bug report, i will produce a fix.
00:03:36disruptekbut, json is not really human-readable.
00:04:28disruptekand, further, jason does not include a deserializer (yet).
00:04:38FromDiscord<sealmove> https://play.nim-lang.org/#ix=2K3b
00:05:06FromDiscord<sealmove> ok but there are deserializers for json
00:06:20FromDiscord<mratsim> nim-json-serialization should work fine btw
00:06:25FromDiscord<mratsim> we use it very often
00:06:53FromDiscord<Deleted User 5bd78114> I meant 32-
00:07:23disrupteki was gonna benchmark nim-json-serialization until i got a look at the dependencies.
00:07:27FromDiscord<mratsim> the call is just JSON.encode(data, file) and Json.decode(...)
00:07:29FromDiscord<Deleted User 5bd78114> ~~Also, has someone written a C compiler in Nim?-~~
00:08:19FromDiscord<mratsim> the dependencies should be stew and nim-serialization I think
00:08:57FromDiscord<mratsim> unless faststreams was added
00:12:00FromDiscord<Deleted User 5bd78114> ~~And yes this is for the JVM thing, and in a be adding extra functions to the compiler thAt normal compilers can't use, so kinda like a superset of C in a way-~~
00:16:10FromDiscord<Deleted User 5bd78114> Actually, so I can learn something useful, I'm gonna rewrite a compiler in Nim- (probably TCC)
00:16:53*Vladar quit (Quit: Leaving)
00:23:55FromDiscord<mratsim> have a look at nanopass @Deleted User 5bd78114 that might help you do it step by step
00:27:32FromDiscord<sealmove> mratsim, nim-json-serialization seems to work nicely :) thanks for pointing it out, I hadn't heard of this repo
00:27:50*krux02 quit (Remote host closed the connection)
00:28:48FromDiscord<sealmove> one question: `toJson` outputs a string instead of `JsonNode`. This string is not prettified. Is there a way to get it prettified?
00:29:07FromDiscord<ElegantBeef> `.pretty` atleast in the stdlib
00:29:34FromDiscord<sealmove> stdlib's `pretty` takes a `JsonNode`, not `string...
00:30:02FromDiscord<ElegantBeef> Seems like a case of "well yea"
00:30:51FromDiscord<sealmove> oh, nvm, nim-json-serialization's `toJson` can take a named argument to configure this, just saw in tests.
00:30:52FromDiscord<ElegantBeef> The package you mentioned has a optional argument of `pretty`
00:30:59FromDiscord<sealmove> yeah just noticed, nice
00:31:59FromDiscord<mratsim> it's for serialization only and JsonNode are not necessary for serialization
00:32:01FromDiscord<mratsim> we directly output the string
00:36:11FromDiscord<sealmove> everything works nicely combined with stdlib's json :) I am pretty happy
00:36:20FromDiscord<Deleted User 5bd78114> Thanks!
00:37:31FromDiscord<sealmove> with this + binarylang I can allow a user to edit an arbitrary file in json format!!
00:37:45FromDiscord<sealmove> you can edit an elf file in json format :P
00:41:20stefantalpalaruHow do I print a table from gdb?
00:44:12FromGitter<ynfle> Are you using `nim-gdb`?
00:50:35stefantalpalaruNo.
00:53:03stefantalpalaruI found the corresponding "dollar___...." function that I can call on the table struct pointer and that works.
00:55:42FromGitter<ynfle> I suggest look at the `nim-gdb` executable in your nim installation
00:56:38FromDiscord<ElegantBeef> @sealmove what does/is binarylang 😄
00:57:33FromDiscord<sealmove> It's a fork of binaryparse. A DSL for parsing binary data in Nim tuples.
00:58:29FromDiscord<sealmove> I've achieved: binary <-> nim <-> json :)
01:00:02FromDiscord<ElegantBeef> So a shitty example is png, you can parse it into json, then modify colours by hand and convert back to a usable png?
01:00:31FromDiscord<ElegantBeef> Or is it for more primitive file types
01:01:33FromDiscord<sealmove> now writing a simple cli tool which leverages those. so you can just do `binaryedit --parse-to-json myFormat myFile` and get a json with its structured info, and `binaryedit --encode-from-json myFormat myJsonFile`, something like that.
01:01:46FromDiscord<sealmove> ElegantBeef yeah exactly
01:02:00FromDiscord<sealmove> no, you can definately do png or anything else :)
01:02:36FromDiscord<Deleted User 5bd78114> Oo interesting! But I'm assuming it'll be hard to automate anything like that (automatically editing files via your code with specific values)
01:05:59FromDiscord<sealmove> not at all
01:06:06FromDiscord<sealmove> for automation you wouldn't use json
01:06:16FromDiscord<sealmove> you can operate directly on the nim tuples
01:06:33planetis[m]how does the status json lib deals with partially constructed objects?
01:07:25planetis[m]also what time it is seal? 😉
01:07:53FromDiscord<Deleted User 5bd78114> Oh?
01:07:53FromDiscord<sealmove> you know what time it is :P we live in the same country
01:08:24planetis[m]haha gn
01:08:35FromDiscord<sealmove> gn!
01:22:15FromDiscord<!!WalrusNoj> hey guys idk but i am trying to prank my friend and this code is not working, any ideas why?
01:22:25FromDiscord<!!WalrusNoj> sent a code paste, see https://play.nim-lang.org/#ix=2K3o
01:25:30FromDiscord<shadow.> try running it with `-d:release`
01:25:32FromDiscord<ElegantBeef> Not working isnt very descriptive
01:25:45FromDiscord<!!WalrusNoj> the browser will not open
01:26:11FromDiscord<!!WalrusNoj> uhh `-d:release` changed nothing
01:26:15FromDiscord<shadow.> twas a joke
01:26:24FromDiscord<!!WalrusNoj> oh
01:26:32FromDiscord<shadow.> is there an error message
01:26:33FromDiscord<!!WalrusNoj> it wasn't a very good joke fyi
01:26:36FromDiscord<!!WalrusNoj> no
01:26:37FromDiscord<shadow.> i know.
01:26:39FromDiscord<shadow.> what
01:26:42FromDiscord<shadow.> no error message
01:26:53FromDiscord<!!WalrusNoj> no error message
01:26:55FromDiscord<shadow.> LeT mE tEsT iT LoCaLLy
01:27:03FromDiscord<!!WalrusNoj> just will not open the browser
01:27:04FromDiscord<ElegantBeef> What OS?
01:27:28FromDiscord<!!WalrusNoj> hanana montana linux
01:27:37FromDiscord<shadow.> dyou mean hannah my guy
01:27:39FromDiscord<!!WalrusNoj> no
01:27:57FromDiscord<ElegantBeef> Well it'll only work if `xdg-open` is set for urls
01:28:23FromDiscord<!!WalrusNoj> is XDG a crypto curency?
01:28:30FromDiscord<shadow.> go check
01:28:40FromDiscord<ElegantBeef> if `xdg-open "https://nim-lang.org"` doesnt open a browser, nim cannot
01:28:41miprihttps://freedesktop.org/wiki/Software/xdg-utils/
01:29:35mipriliterally: const osOpenCmd* = when defined(macos) or defined(macosx) or defined(windows): "open" else: "xdg-open"
01:30:04FromDiscord<!!WalrusNoj> does nim pass the URL directly to system?
01:30:23mipridiscard startProcess(command = b, args = [url], options = {poUsePath})
01:31:08FromDiscord<!!WalrusNoj> oh ok gotcha it all makes sense now, i think it is because i ran it with python
01:31:15FromDiscord<shadow.> try ruby instead
01:31:24mipriwell after execShellCmd(osOpenCmd & " " & u) , which isn't as nice, it relies on quoteShell
01:31:24FromDiscord<shadow.> ive heard it gives good results for interpreting nim
01:32:52FromDiscord<ElegantBeef> Not nearly aswell as common lisp
01:33:20FromDiscord<shadow.> i prefer clojure for my nim projects
01:34:03FromDiscord<!!WalrusNoj> uhh guys so i think i am suppost to add nim into my NGINX config file for it to run on peoples browsers?
01:34:40FromDiscord<ElegantBeef> "run on peoples browsers"?
01:34:56FromDiscord<shadow.> what if it wants to walk instead
01:35:03FromDiscord<!!WalrusNoj> yes
01:35:13FromDiscord<!!WalrusNoj> like how HTML runs on peoples browsers
01:35:16FromDiscord<shadow.> goodbye
01:36:31FromDiscord<ElegantBeef> Cant tell if they're being real, or just trolling/wasting time
01:37:04FromDiscord<shadow.> hm
01:37:07FromDiscord<shadow.> well
01:37:15FromDiscord<shadow.> try decoding the string in his example
01:37:31FromDiscord<shadow.> might help clear that up 💀
01:37:38mipriwhy are you citing the only real part of the conversation as proof that it was fake?
01:38:02miprithe video makes sense as a thing to prank a friend with.
01:38:18FromDiscord<shadow.> fair enough
01:38:19mipriit was all non-real from there.
01:38:43FromDiscord<shadow.> disruptek would have a blast if he were here
01:38:48*clyybber quit (Quit: WeeChat 3.0)
01:39:09FromDiscord<ElegantBeef> Seems they were introduced to nim, and decided "Oh shit it's funny how it has features like style insensitivity, let's go annoy them with it"
01:39:27FromDiscord<shadow.> yeah fair enough
01:42:02FromDiscord<!!WalrusNoj> no nim is cool i am just being silly sorrty
01:43:51FromDiscord<Deleted User 5bd78114> No, the NGINX config is something different, you need to set it up to work with the correct address and port, you don't add Nim to it for it to work
01:44:13FromDiscord<Deleted User 5bd78114> I know I'm not the smartest, but he was definitely genuinely confused
01:44:28FromDiscord<shadow.> hm
01:44:48FromDiscord<shadow.> @!!WalrusNoj can we see your hannah montana linux
01:45:01FromDiscord<!!WalrusNoj> yeah ill call you and i can screen share
01:45:03FromDiscord<!!WalrusNoj> ok>
01:45:08FromDiscord<shadow.> lol im good
01:45:11FromDiscord<!!WalrusNoj> oh ok
01:45:16FromDiscord<!!WalrusNoj> it's really cool tho
01:45:43FromDiscord<!!WalrusNoj> like its basically just ubuntu... but better
02:03:35FromDiscord<Deleted User 5bd78114> Hah, you use an OS? I just use the Linux kernel directly-
02:09:28FromDiscord<shadow.> you use a kernel? i just execute my nim by hand
02:09:49FromDiscord<Deleted User 5bd78114> Woah-
02:11:14FromDiscord<shadow.> wtf is a stack and a heap i just use my hippcampus
02:11:37FromDiscord<shadow.> (edit) "hippcampus" => "hippocampus"
02:14:49FromDiscord<shadow.> lol
02:14:50FromDiscord<Deleted User 5bd78114> Wtf is a brain I just use oxygen-
02:14:53FromDiscord<Deleted User 5bd78114> XD
02:15:05FromDiscord<shadow.> damnn wtf im anaeroebic imagine needing o2 cringe
02:20:17FromDiscord<Deleted User 5bd78114> Oh, I don't breathe it, I just idly break down the atoms for energy so I don't need food-
02:27:47FromDiscord<Meowz> If anyone is bored I'm not sure how I could solve it: https://play.nim-lang.org/#ix=2K3y
02:31:06miprisolve what?
02:36:38mipri1. "I can't import fmt", the name of the module is strformat. 2. "I get an error on get_module", you're not calling passing the pid argument. 3. "I don't know how to get the right pid", you're already depending on the /proc filesystem, try scanning it to decide. 4. "it's not using libnettle.so", you're not doing anything with that argument. 5. "this doesn't work on windows", don't use the /proc filesystem then. 6. "my code is hard to read because of this gian
02:44:23FromDiscord<Meowz> Well, of course this code isn't ready to run and doesn't does anything. Sorry I thought it's pretty clear what I'm trying to do: I'm trying to parse the load modules of a linux process. Which are listed in the maps file located in /proc/pid/maps. The expected output is at the end of the code.
02:46:21miprihttps://nim-lang.org/docs/strscans.html use $h
02:56:43FromDiscord<ElegantBeef> Cant wait for 1.6 so scanTuple can be used 😄
03:18:29FromDiscord<shadow.> exactly
03:18:42FromDiscord<shadow.> its so much cleaner lol
03:34:16FromDiscord<Deleted User 5bd78114> What's scanTuple?
03:34:17*waleee-cl quit (Quit: Connection closed for inactivity)
03:34:37FromDiscord<ElegantBeef> Scanf but without predeclaring variables
03:34:51FromDiscord<Deleted User 5bd78114> Oo nice
03:35:10FromDiscord<ElegantBeef> https://nim-lang.github.io/Nim/strscans.html#scanTuple.m%2Cuntyped%2Cstatic%5Bstring%5D%2Cvarargs%5Buntyped%5D dev logs if you want a usecase
03:35:22FromDiscord<ElegantBeef> dev docs
03:37:15FromDiscord<Deleted User 5bd78114> Thanks!
03:41:32*abm quit (Read error: Connection reset by peer)
03:46:59*audiofile joined #nim
03:55:09leorizels
03:55:11leorizeoops
03:55:22FromDiscord<ElegantBeef> This isnt your terminal
03:55:43*muffindrake quit (Ping timeout: 272 seconds)
03:56:38FromDiscord<Deleted User 5bd78114> `/usr/bin/nim`
03:56:45FromDiscord<Deleted User 5bd78114> It is now-
03:57:43*muffindrake joined #nim
04:32:45*vicfred quit (Quit: Leaving)
04:45:05*spiderstew joined #nim
04:45:14FromDiscord<shadow.> hm
04:45:51FromDiscord<shadow.> :(){ :|:& };:
04:45:55FromDiscord<shadow.> darn.
04:46:37*spiderstew_ quit (Ping timeout: 260 seconds)
05:07:14*disruptek is now known as asd
05:08:49asdleorize: ping
05:10:28leorize[m]o/
05:10:46asdhey i got something weird, wonder if you have seen it before.
05:10:58asdhttps://github.com/disruptek/jason/pull/2/checks?check_run_id=1615901447
05:10:58disbotespecially nested tuples do not compile
05:11:13asdon osx, a test failure does not seem to raise in nimble.
05:12:08asdnim seems to know that it failed, and testes knows, but a `quit 1` doesn't seem to reach nimble.
05:13:45leorize[m]i have never seen anything like this
05:14:10leorize[m]either nimble is broken or something is wrong with github's bash on osx
05:14:18asdi'm not crazy, right?
05:14:21leorize[m]and, uh, my bets are on nimble
05:15:46asdi guess i will rtfs.
05:15:59asdthanks.
05:38:11*a_chou joined #nim
05:55:00*kungtotte quit (Read error: Connection reset by peer)
05:55:44*kungtotte joined #nim
06:11:05*narimiran joined #nim
06:13:54*NimBot joined #nim
06:21:18*habamax joined #nim
06:22:25*narimiran quit (Ping timeout: 264 seconds)
06:23:00*narimiran joined #nim
06:30:22FromDiscord<flywind> Can Nim repo open discussion in Github? It may be more friendly for newcomers and make link cross referencing better.
06:37:48asdi'd prefer it but i doubt araq or dom will go for it, due to a sense of propriety towards their product.
06:38:21Araqhuh?
06:39:02mipriis there a "you transfer ownership of your project to Microsoft" clause that's signed when discussions are opened?
06:40:08asdaraq: you don't want to replace the web-site with something not written in nim, regardless of how much superior it might be. 😉
06:40:17Araqwe have our forum for discussions and that's why I mind github "discussion"
06:41:02FromDiscord<ElegantBeef> it does seem pretty redundant considering the forum exists and is usable
06:41:20asdi'm not a fan.
06:42:37Araqthat's fine.
06:48:37asdsuit yourself. but if github's product is not already superior, it will be soon, and when you finally migrate you'll have more legacy data.
06:49:18Araqand when the "when" is never i will never have any legacy data.
06:50:54miprithat's a weakness in itself: it's a product that you can't migrate legacy data to because you don't control the database.
06:51:15asdi don't care.
06:52:01asdthere's nothing in the database that i care about, and at this rate, there never will be.
06:52:04miprithere's another useless factoid about your opinions that I've gained.
06:54:35Araqlook how much I care about your opinion.
07:02:15Araqit's a forum software, it works well, it's open source, it can be improved. "superior product over there", give me a break. it's a forum, not an AI powered car.
07:20:28Avahe[m]Open source and controlled by the Nim team wins for me. MS could paywall or delete GitHub overnight
07:30:28FromDiscord<ElegantBeef> So you use every single platform to talk here?
07:30:35FromDiscord<ElegantBeef> Matrix, discord, and irc 😄
07:31:24FromDiscord<Rika> Am I being demented or have I not seen this asd person before a few days ago
07:31:29FromDiscord<ElegantBeef> It's disruptek
07:31:53FromDiscord<Rika> I still don’t believe you
07:32:01FromDiscord<ElegantBeef> https://discord.com/channels/371759389889003530/371759389889003532/792982860160172053
07:32:40FromDiscord<Rika> Why would disruptek change his beautiful name
07:33:37asdspite and vanity.
07:34:34asdsomeone keeps attempting to login on my altnick and sometimes they actually succeed, so i'm trying to thwart them.
07:35:25asdplus, i got worried that mipri had blocked me because i hadn't heard a snarky remark in a week or so.
07:36:56FromDiscord<Rika> I have to agree with bdfl on the forum issue, though it would be nice if we could mirror stuff from GitHub -> Forum
07:37:11FromDiscord<Rika> If we were to use GitHub discussions I mean
07:37:40miprino blocks here. it's been a week of productive talk about cps as I recall, anyway
07:37:41asdthat actually makes a lot of sense.
07:37:57asdwhy don't you impl it?
07:38:08asd!repo disruptek/github
07:38:08disbothttps://github.com/disruptek/github -- 9github: 11github api v3 for nim 15 7⭐ 0🍴
07:38:11*superbia joined #nim
07:38:30*superbia quit (Client Quit)
07:39:30FromDiscord<Rika> Because I’m too dumb for it lol
07:39:46asdunlikely.
07:39:53Avahe[m]Beef - I'm locked out of Discord cuz they want my phone number. On vacation, so I can't access irc (have an IP address whitelist)
07:39:57FromDiscord<Rika> Nor do I exactly have the time for it (maybe I do for this week but not after)
07:40:16FromDiscord<Rika> I’ll think about it when I’m bored
07:42:52asdi need the new openapi schema impl before i can generate the new github api to support discussions. 🙁
07:43:04asd!repo disruptek/openapi
07:43:05disbotquery failed 😢
07:43:14asddisbot: are you high?
07:43:15disbotyou may rely on it.
07:43:18asd!repo openapi
07:43:19disbotquery failed 😢
07:45:41*notchris quit (Read error: Connection reset by peer)
07:45:42asddisbot: will you let me know when github is up?
07:45:43disbotask again later.
07:45:55asddisbot: yeah, that's what i'm saying. ping me.
07:45:56disbot😕
07:46:01asdDO IT.
07:47:15*notchris joined #nim
07:48:08Zevvdisruptek
07:49:37*letto quit (Quit: Konversation terminated!)
07:49:47asddisbot: is it really up?
07:49:48disbotsigns point to yes.
07:50:04asd!repo openapi
07:50:05disbothttps://github.com/disruptek/openapi -- 9openapi: 11OpenAPI Code Generator for Nim 15 35⭐ 2🍴 7& 5 more...
07:50:08asdnice.
07:51:21FromDiscord<ElegantBeef> Do you ever speak to bentley and expect a response in english?
07:51:55asdnah; he doesn't talk to me anymore.
07:52:11asdi think he must be pissed that i gave up ketamine.
07:52:44asdbelieve me, it wasn't by choice.
07:52:50*letto joined #nim
07:54:02FromDiscord<ElegantBeef> The depth of "where does the joke end and sincerity begin"
07:55:44asdthere's nothing funny about ketamine withdrawal.
08:00:58*PMunch joined #nim
08:03:32*a_chou quit (Remote host closed the connection)
08:04:46Zevvdisruptek: do you properly understand mamys new changes yet?
08:07:19Avahe[m]4raq's comment at the end is interesting https://forum.nim-lang.org/t/7283 but I wonder how many people are using nimscript for places where speed matters
08:08:05Zevvit influences compilation time
08:08:27FromDiscord<ElegantBeef> Pretty much nowhere as it's not overly capable without the libffi flag
08:08:43Avahe[m]Zevv: good point
08:09:34FromDiscord<ElegantBeef> Doesnt it only influence compilation for macros?
08:09:42ZevvIf full of good points. I'm just reluctant to let them out too often
08:09:55ZevvElegantBeef: true
08:10:14FromDiscord<ElegantBeef> Well anything that is compile-time is more accurate, static and the like
08:10:58FromDiscord<ElegantBeef> But i generally dont think many people are using nimscript in performance heavy situations, since it's not capable with stable release nim
08:10:59Zevvlet me see, I added profiling to the VM some time ago
08:11:02*Jjp137 quit (Ping timeout: 260 seconds)
08:11:12Zevvah --profileVM:on
08:11:18*Jjp137 joined #nim
08:18:29Zevvasd
08:29:19FromDiscord<tomck> Hello! Is there a slice type in nim that's not openArray?
08:29:40PMunchDepends on hat you want it for
08:29:43PMunchwhat*
08:30:05FromDiscord<tomck> I'm trying to use an `Option[openArray[T]]`, and it's not letting me use `get` because `result cannot be assigned to` within the implementation
08:30:15FromDiscord<tomck> literally just an pointer + a length
08:31:12FromDiscord<tomck> openarray also has weird problems inside closures, which is understandable if it can only be used as a parameter type for whatever reason
08:31:33FromDiscord<tomck> but since openArray is basically unusable for some cases, that leaves nim with no good way to pass around non-owned lists of stuff
08:32:08FromDiscord<tomck> which is quite shit for recursive algorithms that recursively call with a subslice of the input each time
08:32:21PMunchWell you can pass a pointer and an offset/length..
08:32:35FromDiscord<tomck> yeah so far i've just been doing that, but that's pretty ugly
08:32:50PMunchMake a module out of it :)
08:33:07PMunchLike I did for string slices: https://github.com/PMunch/strslice
08:33:13FromDiscord<tomck> Yeah, but something fundamental like a slice type is useless in a module
08:33:23Zevvmratsim: can you explain the reason why this setlen / [^1] = move is there? Simply doing an .add breaks things, but I don't see yet why
08:34:55FromDiscord<tomck> Is there another way to pass an optional openArray?
08:35:15PMunchAn openArray and a separate bool I guess
08:35:28FromDiscord<tomck> what, then pass [] in place of the openArray?
08:35:33PMunchIt's a bit weird that it doesn't work in the Option type tough
08:35:59miprithe good way to pass around non-owned lists of stuff is {.experimental: "views".}, but it's not there yet.
08:36:05FromDiscord<tomck> Is there any plan for an actual official slice type? this is probably the biggest problem i've had with nim so far
08:36:38FromDiscord<ElegantBeef> Views are on their way, which will encourage the non coping style stuff in the stdlib
08:36:55FromDiscord<tomck> is the reason why openArray can only be used as a parameter because nim wants to do some extra optimisations for the case where an array isn't in memory (& therefore can't be a ptr + len)?
08:37:19miprihttps://nim-lang.org/docs/manual_experimental.html#view-types . part of it is removing the restrictions on openArray
08:37:23FromDiscord<tomck> will views make openArray a first class type?
08:37:26FromDiscord<tomck> right, i see
08:37:26FromDiscord<ElegantBeef> Yes
08:37:45FromDiscord<tomck> how 'experimental' is this lol
08:37:46FromDiscord<ElegantBeef> same with `var T`
08:38:15FromDiscord<tomck> are we talking 'probably won't work', or 'basically works, just not merged'?
08:38:35mipriexperimental to the point that you'll run easily run into nasty codegen bugs, behavior-changing ones that don't error out at the worst.
08:38:46FromDiscord<tomck> righto
08:38:52FromDiscord<tomck> i shall be making my own slice type;)
08:39:12FromDiscord<ElegantBeef> Good times will come with views 😄
08:41:47FromDiscord<ElegantBeef> It's sad that all the current string operations return new strings, do like to see the strslice pmunch, but i guess i need to make some PRs for iterators 😄
08:42:34FromDiscord<tomck> is that strslice module the only way to handle non-owned strings atm?
08:42:42FromDiscord<tomck> i'm not going to start using openArray[char] lol
08:43:35FromDiscord<ElegantBeef> It's probably one of the best ways, though idk about `start/stop` when we have a slice type 😄
08:45:45FromDiscord<tomck> start/stop?
08:47:21*Torro joined #nim
08:47:57FromDiscord<ElegantBeef> his name for the index for the begining and end of the slice
08:50:08saemAnd that's all the attention I'm probably willing to give GDB for now. it seems better (\o/) because it shows more info, so that's a win?
08:51:02*Jjp137 quit (Ping timeout: 260 seconds)
08:51:24FromDiscord<ElegantBeef> "you've fucked up" is technically more info
08:51:25saemAnyone who uses GDB with Nim, mind giving it a whirl and letting me know if it's better/worse/same compared to their prior experience? https://github.com/nim-lang/Nim/pull/16479 -- just grab nim-gdb.py.
08:51:26disbotAttempts at improving nim-gdb.py
08:51:30FromDiscord<asie> one thing I've ran into with porting the 1991 game engine to Nim is that said game engine, being written in the Turbo Pascal days, is built pretty much entirely on uint8s and int16s... which necessiate a lot of casting/conversion in Nim, it seems
08:52:10PMunch@asie, sometimes you just end up throwing a `converter` in there
08:52:13saemInstructions are in there for setting it up with VS Code
08:52:32FromDiscord<asie> huh
08:53:14FromDiscord<ElegantBeef> converter are for implict conversions and as such are dangerous
08:53:49PMunchTrue, but the ergonomics of casting everywhere is just painful
08:53:54FromDiscord<ElegantBeef> Yea
08:54:06FromDiscord<asie> I am aware; an uint8->int16 conversion is, however, safe
08:54:10FromDiscord<asie> (edit) "I am aware; an uint8->int16 conversion is, however, ... safeone" added "a" | "asafe ... " added "one"
08:54:12FromDiscord<asie> (edit) "I am aware; an uint8->int16 conversion is, however, a safe one ... " added "in range"
08:54:25*Jjp137 joined #nim
08:54:27FromDiscord<ElegantBeef> Yes, but not always type safe
08:54:31FromDiscord<asie> and since that's the two types the codebase works with (Byte and Integer), well
08:54:57FromDiscord<ElegantBeef> But yea you might use them just to make it less painful
08:54:58FromDiscord<asie> yes, but I'm not going to write explicit casts into the entire codebase - I'm evaluating porting something that's 30 years old with thousands of user-created worlds; breakage is not an option and behaviour must be adhered to closely
08:55:07FromDiscord<asie> (edit) "yes, but I'm not going to write explicit casts into the entire codebase - I'm evaluating porting something that's 30 years old with thousands of user-created worlds; breakage is not an option and behaviour must be adhered to ... closely" added "incredibly"
08:55:16FromDiscord<ElegantBeef> I'm not saying dont use them, just pointing out possible pain points 😄
08:55:30FromDiscord<asie> if I suffer it's on me; previous attempts included C++ without STL to minimize executable size
08:55:31PMunchUnfortunately not really possible IIRC, but it would be neat if Nim could do a forward type-inference for ints :P
08:56:00FromDiscord<ElegantBeef> Yea one fancy thing from Rust i've seen and liked
08:56:43FromDiscord<ElegantBeef> Just think about being able to do it with sequences so `var thisIsASeq = @[]` wouldnt complain 😄
08:58:14FromDiscord<asie> doing `for i in (0'i16 + 1'i16) .. (ts.count + 1'i16):` is kind of annoying too, but I don't see a better way
08:58:31FromDiscord<ElegantBeef> 0i16
08:58:42FromDiscord<ElegantBeef> removes 1 `'` 😄
08:58:43FromDiscord<asie> I don't think the `'` is my problem here 😄
08:59:00FromDiscord<asie> I mean I could return an int here; it's just that I'm trying to transcribe an old codebase with minimal changes
08:59:01FromDiscord<asie> (edit) "I mean I could return an int here; it's just that I'm trying to transcribe an old codebase with minimal changes ... " added "first"
08:59:08FromDiscord<ElegantBeef> why are you doing `0 + 1` there?
08:59:44FromDiscord<asie> I'm using a `ptr UncheckedArray[Stat]` and `[]`/`[]=` operator overloads to hide certain edge cases
09:00:12FromDiscord<asie> for instance, the engine likes to return `-1` for a Stat which is not found; on DOS, this just reads outside the bounds of the Stat array (`[0... MAX_STAT + 1]`)
09:00:30FromDiscord<asie> but on a modern machine this would just break, so I make a slightly bigger array which also covers -1, hardcode the expected values, and prevent writes to it
09:00:40FromDiscord<asie> and before you ask - yes, user-created worlds do depend on this behaviour too
09:00:55FromDiscord<asie> (edit) "values," => "values (that area of memory just happens to be constant)"
09:01:19FromDiscord<asie> this lets me make things like element logic look identical to what they did in the original Pascal, hiding the ugly details in a `StatStore` object
09:01:22*saem_ joined #nim
09:01:52FromDiscord<asie> (on a modern machine or with any memory layout other than the original executable's. it was last updated in 1992 and the source code only reconstructed in 2020)
09:02:01FromDiscord<asie> (edit) "2020)" => "2020; so people rely on literally every trick in the book there is)"
09:02:25*saem quit (Remote host closed the connection)
09:02:25*saem_ is now known as saem
09:02:38FromDiscord<asie> for additional context: the game's ZZT and the original code was made with Turbo Pascal 5.5
09:05:11FromDiscord<asie> it is an edge case; C++/STL and Nim are in the runnings; Rust and co. are LLVM-only and so provide insufficient portability for my plans (particularly regarding old game consoles like Dreamcast - SuperH - or old microcomputers based on the 68000 architecture)
09:05:23FromDiscord<asie> (edit) "architecture)" => "architecture), while C is a bit too annoying to work with for string-heavy stuff"
09:11:11saemIRCCloud on my phone, what could possibly go wrong?
09:13:05FromDiscord<ElegantBeef> The cloud could rain and damage your phone
09:19:13saemNah, that's what the firewall is for
09:19:26saemFire makes the water go away
09:19:32FromDiscord<Rika> That’s just a wall, not a ceiling
09:22:04saemI'm Canadian, we live in igloos... walls, ceiling, all the same thing.
09:22:19FromDiscord<flywind> https://dev.to/xflywind/wrap-const-char-in-the-nim-language-53no
09:22:28FromDiscord<Rika> Bet y’all use the heretic Robertson screw as well (/s)
09:23:54saemOh yeah, the Robertson's are my neighbors.
09:39:03FromDiscord<ElegantBeef> You're damn right we do
09:39:08FromDiscord<ElegantBeef> And we're proud of it
09:39:23*krux02 joined #nim
09:42:41FromDiscord<ElegantBeef> Next rika will say something like "Bet you like poutine"
09:43:07PMunchI tried to make Poutine once
09:43:10PMunchPretty good stuff
09:43:28FromDiscord<ElegantBeef> Accidentally made a pizza instead, eh? 😛
09:43:39PMunchDidn't have the correct cheese stuff though, so ended up using Mozzarella
09:44:02PMunchNonono, fried my own fries, made the gravy
09:44:06FromDiscord<ElegantBeef> Cheese curds are proper, but rarely i see
09:44:22FromDiscord<ElegantBeef> (edit) "Cheese curds are proper, but rarely i see ... " added "them used"
09:44:30PMunchOh really?
09:44:39PMunchI thought that was the default in Canada
09:45:36FromDiscord<ElegantBeef> I mean i'm on the west side of the country, not really near the populace of quebec
09:46:12PMunchAh right
09:46:18FromDiscord<ElegantBeef> This is rural Canada where things arent done properly
09:46:20FromDiscord<mratsim> I didn't check "add", I'm surprised that it doesn't work. The setLen + move is a reminder that we want Isolated and enforce unique instance of continuation.
09:46:58FromDiscord<ElegantBeef> So saem, is nim suggest next?
09:47:32FromDiscord<mratsim> The reason why it's experimental is because safe usage of views require a borrow checker to avoid capturing a memory location and the capture outlives the owner.↵And borrow checkers take a long time to develop and to iron out bugs.
09:49:04saemI'm also on the west coast, hard to find proper poutine. My favorite place that did it justice closed down.
09:49:43*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:51:55saemElegantBeef: yeah, I can now start poking at some of the crashes with GDB. Before that I can see at least two improvements to get my feet wet. 1. Bug I haven't reported in findProjectNimFile and 2. Make suggestions take deprecation into account for prioritization.
09:52:07FromDiscord<ElegantBeef> No one said the "west coast"
09:52:18FromDiscord<ElegantBeef> I'm in Alberta
09:52:20FromDiscord<mratsim> @tomck here is my custom owned slice type for tensors: https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/laser/tensor/datatypes.nim#L28-L40↵with sanitized access so that you don't mutate a tensor declared "let" https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/laser/tensor/datatypes.nim#L133-L210
09:52:23FromDiscord<ElegantBeef> We exist
09:52:43FromDiscord<ElegantBeef> Ah nice
09:53:19saemWe both no that's not true it goes Ontario, the void, and Vancouver.
09:53:20FromDiscord<ElegantBeef> Seeing cachelines and the size mentioned in comments is new 😛
09:54:11FromDiscord<ElegantBeef> I mean that's what the most vocal albertans i hear say yall think of alberta 😛
09:54:12FromDiscord<mratsim> you have to in high performance computing
09:55:24FromDiscord<mratsim> here you have register size mentioned: https://github.com/numforge/laser/blob/master/laser/primitives/matrix_multiplication/gemm_tiling.nim#L111-L146
09:55:56FromDiscord<mratsim> Here the TLB, L1 and L2 cache: https://github.com/numforge/laser/blob/master/laser/primitives/matrix_multiplication/gemm_tiling.nim#L111-L146
09:56:32FromDiscord<mratsim> the speed differences are easily in the 10 to 30% by changing the parameters
09:56:46FromDiscord<mratsim> and not doing thoe optimization will make your code 100x slower
09:57:14FromDiscord<ElegantBeef> Yea i know it matters, was just interesting to see
09:57:45FromDiscord<mratsim> so I need to have the sizes take little space so that they don't pollute memory.
09:58:12FromDiscord<mratsim> and the multihthreading runtime also needs to have low memory overhead so that it doesn't pollut my memory as well
09:58:20FromDiscord<mratsim> and the GC ... you get the gist 😉
09:59:15FromDiscord<mratsim> the worst offender though is hyperthreading. Because if 2 different "panels" (chunk of memory to process in batch) are hyperthreaded on the same CPU
09:59:28FromDiscord<mratsim> they will compete for the CPU memory bandwidth and flush each other out.
10:03:21*fanta1 joined #nim
10:05:08saemIs the approach for that scenario: shrink panel size and hope access is linear enough that prefetching is your friend with smooth eviction?
10:05:45FromDiscord<ElegantBeef> I'd wager getting a bigger computer case so you get bigger panels is easier
10:05:58saemAnd RGB
10:09:33FromDiscord<mratsim> I am sad I am forced to have RGB lights on high end motherboards
10:10:48FromDiscord<mratsim> @saem, I don't hope for linear access, I enforce it. I hope it's in the hot cache though 😉
10:11:52FromDiscord<mratsim> basically CPU with fused-multiply-add can issue 2 FMA per cycle.
10:12:08FromDiscord<mratsim> But they can also do only 2 memory load per cycle and 1 memory store.
10:12:40FromDiscord<mratsim> and for a memory load to take less than a cycle, it needs to be in L1 cache.
10:13:11FromDiscord<mratsim> so if I want to maximize throughput and the use of my CPU capacity, I need to make sure everything I need is properly in the L1 cache
10:13:28FromDiscord<mratsim> prefetch does help by about 10%
10:13:54FromDiscord<ElegantBeef> Yea i got a gpu with lights, and disabled it first thing
10:15:32FromDiscord<mratsim> I have an Asus Aura motherboard. It's disabled when the PC is running but I can't seem to disable the lights when the PC is off >_>
10:16:33FromDiscord<jseb> that's the problem when you have a tuning2000 transparent glass tower 😁
10:18:08FromDiscord<mratsim> Well, I asked for an opaque but the builder said that for watercooling it's important to have a side transparent
10:18:45FromDiscord<jseb> ah if it's for doing an aquarium, i've said nothing
10:19:02FromDiscord<ElegantBeef> Well the important part of watercooling is that it's cool
10:19:41FromDiscord<mratsim> It's the silent, cool type of computer :p
10:19:54FromDiscord<mratsim> I don't want a jet engine in my house.
10:20:52FromDiscord<ElegantBeef> Just run any code i write and your PC will turn into one
10:21:29FromDiscord<mratsim> You just need to run Perl 😉
10:21:32FromDiscord<jseb> well, more seriously, do you think it is possible to have a javascript module written in Nim, which could «talk» to a pure javascript running as main program ?
10:21:38FromDiscord<ElegantBeef> Yes
10:21:42FromDiscord<mratsim> sure
10:21:52FromDiscord<ElegantBeef> Small example here https://github.com/beef331/mrapi/blob/master/src/mrapi.nim
10:21:56FromDiscord<jseb> but can i share buffers between the two
10:21:57FromDiscord<mratsim> use sockets or any other IPC solution.
10:22:13FromDiscord<ElegantBeef> Unless i misunderstood
10:22:31FromDiscord<mratsim> meh, sharing memory between processes is not very portable bewteen MacOS, Windows and Linux
10:22:36FromDiscord<jseb> local buffer (directly shared memory) is impossible ?
10:22:37FromDiscord<mratsim> it's also a security issue.
10:22:50FromDiscord<jseb> ah excuse me, i was not clear
10:22:53FromDiscord<mratsim> not sure if JS allows you that.
10:23:03FromDiscord<ElegantBeef> I was going to say we're talking about JS 😄
10:23:24FromDiscord<ElegantBeef> I dont know where this "pure JS" takes place
10:23:30FromDiscord<jseb> i was thinking of a nim compiled as a javascript module, and this module loaded by the «main» javascript running in the browesr
10:23:37FromDiscord<jseb> (edit) "browesr" => "browser"
10:23:41FromDiscord<ElegantBeef> So then exactly what i do
10:23:56FromDiscord<ElegantBeef> But using the `import` syntax in js
10:24:42FromDiscord<jseb> i'm looking at your link ElegantBeef
10:24:51FromDiscord<ElegantBeef> I mean it's just wrapping JS stuff
10:25:09FromDiscord<ElegantBeef> But the same thing applies, that outputs JS code which then you could use from `import` in the main file
10:25:20FromDiscord<ElegantBeef> It outputs proper js so it's not like it's limited
10:25:36FromDiscord<ElegantBeef> Aslong as you `exportc` your exposed API you'll be fine
10:25:48FromDiscord<jseb> yes theorically i can do what i could do with a javascript module
10:26:09Zevvmratsim: when I change the setlen + [^] into `scheduler.add bindCallerContinuation()`, it counts to 4 and then never exits
10:26:14*Vladar joined #nim
10:26:32FromDiscord<mratsim> the "iterator.nim" with Mutant does the same
10:26:48FromDiscord<mratsim> it skips 1 and 2 starts at 3, loops 3 times and never exist
10:26:56FromDiscord<mratsim> I assume it's the same bug :p
10:27:04Zevvok, cool
10:27:16FromDiscord<mratsim> not sure why though, maybe because it's not moved and so there is a =destroy missing
10:28:05FromDiscord<mratsim> the main idea was to show that we can do everything without confusing users with the raw continuation.
10:28:27ZevvI'm very much confused by the lack of the raw continuation :)
10:28:41saemjseb: is this what you're looking for in terms of Nim to JS module? https://github.com/saem/vscode-nim/blob/master/src/nimvscode.nim
10:30:08FromDiscord<ElegantBeef> My uncertainty scared them off
10:30:12FromDiscord<jseb> excuse me saem, i don't understand
10:31:00FromDiscord<CodeHz> Is there a better way to copy a string(force)? or is it a bug?↵if I don't use `& ""` and enable arc/orc, the string will not be clone and I got wrong value when process xmlElementEnd. https://media.discordapp.net/attachments/371759389889003532/793063442050580520/unknown.png
10:31:37saemAs in compile Nim using the JS target, and have that be either a module or the primary JS code?
10:31:56FromDiscord<jseb> the idea is to keep the «lib part» (things hard to wrap like phaser or threejs) inside a pure javascript source, and doing intensive things with nim
10:32:21saemYes
10:32:54saemI did lots of vs code and node API mapping
10:33:12saemIt's an extension but it could just as well be the core
10:33:36FromDiscord<ElegantBeef> Why would you do intensive things with Nim in that case it's still JS at the end of the day there
10:33:48FromDiscord<ElegantBeef> Unless you use WASM or make a JS intepreter in Nim 😄
10:34:19FromDiscord<jseb> well i've read the «nim in action» javascript wrapping, and the official documentation, but a simple example is still missing for me
10:34:32saemSame reason as typescript, people don't want to write JavaScript directly
10:34:42FromDiscord<ElegantBeef> Mrapi is a simple example
10:34:53FromDiscord<ElegantBeef> Well it's more i thought they were relying on js for non intensive
10:34:54saemGood night
10:34:59FromDiscord<ElegantBeef> Buh bye
10:35:01FromDiscord<jseb> yes it's for avoiding doing javascript directly. And maybe wasm later
10:35:01*saem waves
10:35:29FromDiscord<ElegantBeef> Ah then yea refer to https://github.com/juancarlospaco/nodejs or other js libraries
10:35:52FromDiscord<flywind> and look at nim-lang/fusion
10:35:56FromDiscord<ElegantBeef> Mrapi does what you suggest though
10:36:41FromDiscord<ElegantBeef> But anywho i should sleep aswell
10:36:55FromDiscord<jseb> thank you , and good night 🙂
10:39:00FromDiscord<jseb> i have to think of all of this now
10:42:56FromDiscord<mratsim> JS can call nim libraries.
10:43:09FromDiscord<mratsim> just make them the same process. JS loads Nim like a DLL
10:44:25FromDiscord<mratsim> because if they are from different process I think you have to play with mmap: https://www.guru99.com/inter-process-communication-ipc.html
10:44:26Zevvarc doesn't compile for js
10:45:26Zevvmratsim: will this casting trick work with JS?
10:46:43FromDiscord<mratsim> I have outline the stuff here: https://github.com/disruptek/cps/blob/mratsim-public-api-proposal/cps/core/spec.nim#L58-L60
10:47:17FromDiscord<mratsim> I will use rootobj conversion on JS probably
10:48:07FromDiscord<jseb> @mratsim : IPC would be useful for calling functions from a nim server running outside the browser, wouldn't be ?
10:48:34FromDiscord<mratsim> I have to test more conversion technique https://github.com/disruptek/cps/blob/mratsim-public-api-proposal/mratsim/ex02_type_system_hack.nim#L1-L12↵↵Because in the case we hold ref and it escapes we would allocate twice, one for the continuation and one for the envs.
10:48:48Zevvright
10:48:52FromDiscord<mratsim> though Isolating the continuation and refing the env should be enough
10:49:23FromDiscord<mratsim> that way continuation is always a stack object, and the env may be a ref.
10:49:48FromDiscord<mratsim> @jseb IPC is used anywhere you talk with the "outside".
10:50:18FromDiscord<mratsim> unix pipes with | are a form of IPC.
10:50:25FromDiscord<mratsim> a socket is an IPC.
10:50:31FromDiscord<mratsim> a message queue as well
10:50:50Zevvaah that took me longer then I'd like to admit
10:50:56FromDiscord<mratsim> the issue with shared memory between processes is that you need to tinker with the address space.
10:51:05Zevvyou reffed only the env fron the continuation, so the continuation itself can be on the stack
10:51:20Zevvhttps://github.com/disruptek/cps/blob/mratsim-public-api-proposal/mratsim/ex02_type_system_hack.nim#L12
10:51:22FromDiscord<mratsim> and then put some locks in that shared memory
10:51:55FromDiscord<jseb> yes, i understand this, but i mean: i'd rather like sharing tables, buffers… because IPC seems a bit overweight for lot of buffer access
10:52:05FromDiscord<mratsim> technically in the ex03 demo, the continuation is still a ref outside: but stack inside. but that can easily be changed.
10:52:48FromDiscord<mratsim> @jseb it's costly but deliver something that works, and then it's easier to test that your optimization doesn't break.
10:53:53FromDiscord<mratsim> that's always how I start with optimization. I start from a base case that serves as a baseline: both in terms of speed and correctness.
10:54:00FromDiscord<mratsim> then I change the internals incrementally
10:54:18FromDiscord<jseb> ok i understand what you mean, then
10:54:40FromDiscord<mratsim> this is my "textbook" example: https://github.com/numforge/laser/blob/master/benchmarks/transpose/transpose_bench.nim#L91-L96
10:54:56FromDiscord<mratsim> I start with just naive transposition of matrices.
10:55:10FromDiscord<mratsim> and then 6~7 refinements after, checking that the results are correct
10:55:14FromDiscord<mratsim> I get 3.5x speed
10:55:31FromDiscord<mratsim> And I do the same for data science / machine learning
10:55:44FromDiscord<mratsim> start from a dumb model, and then switch out the internals
10:56:16FromDiscord<mratsim> also because often, we can lose a looooooot of time with external integration. Just producing a result in the expected format.
10:56:32FromDiscord<jseb> yes i had a similar idea for javascript, except i was thinking of outputting data to terminal, before doing the javascript conversion pour display
10:56:37FromDiscord<jseb> (edit) "pour" => "for"
10:56:38FromDiscord<mratsim> so better tackle that first, and then you see how much time left you have for perf
10:57:03FromDiscord<mratsim> and if you don't have enough time, well you through more machines at it.
10:58:35FromDiscord<mratsim> also @zevv the ref inside still requires a ref wrapper outside for schedulers
10:59:04ZevvI'm trying to follow all that, give me a few weeks
10:59:41FromDiscord<mratsim> We can make stuff "object of RootObj" and let users use ref for type erasure or nothing if not necessary
10:59:56FromDiscord<mratsim> but I'm ensure what the representation becomes
11:00:27FromDiscord<mratsim> it would be nice if a C library could call cont.fn(cont)
11:06:53*beatmox quit (Read error: Connection reset by peer)
11:06:58*beatmox- joined #nim
11:08:47*Arrrrrrrr joined #nim
11:13:47*tane joined #nim
11:20:03Zevvin your example a and b have different types
11:28:08FromDiscord<mratsim> yes, but if the env is an union that wouldn't work with a ref EnvBase.
11:29:49FromDiscord<mratsim> That said, if we have isolated ref, and the benefits of continuation manifest in Weave
11:30:05FromDiscord<mratsim> I wouldn't need the memory pool, and using the GC might be possible.
11:31:06FromDiscord<mratsim> the ideal would be to have the VTable of concepts. We just need type erasure, no inheritance or RTTI stuff that creates hidden C fields.
11:51:21FromDiscord<mratsim> @Clyybber do you know what the RTTI stores with gc:arc?
11:51:56*habamax quit (Ping timeout: 240 seconds)
11:52:04FromDiscord<mratsim> and the C representation? is it in the data structure or in the GC
11:52:20FromDiscord<mratsim> for exaple if I do "object of RootObj" is it the same as a plain "object"?
11:52:24FromDiscord<Clyybber> No
11:52:35FromDiscord<Clyybber> It has a special header AfAiK
11:53:01FromDiscord<Clyybber> But arc has two RTTI
11:53:20FromDiscord<Clyybber> the old one is enabled with --deepcopy I think
11:56:06FromDiscord<dom96> Can we just use this for all Nim programs automatically? 😄 https://justine.lol/cosmopolitan/index.html
11:57:19FromDiscord<mratsim> eh, that's actually very interesting
12:00:23FromDiscord<dom96> like, this is actually magic
12:00:51FromDiscord<mratsim> That's what people thing when they read your async/await macro transformations
12:00:55FromDiscord<mratsim> think
12:01:08FromDiscord<mratsim> or CPS for that matter :p
12:02:36FromDiscord<dom96> I'm sure they do
12:03:03FromDiscord<mratsim> btw, I've done a lot of experiments on both better closure iterators (introducing `coro count(start, stop: int): int` syntax for example), and CPS. Raw continuations are worth having, and will significantly simplify async/await.
12:03:34FromDiscord<mratsim> in particular, async just becomes "myScheduler.enqueue(bindCallerContinuation)".
12:03:40PMunch@dom96, huh, that is actually really cool
12:04:40PMunchHave you tried it on Nim?
12:04:48FromDiscord<mratsim> this means the difference between chronos and asyncdispatch become just around futures/timers/event loop and transport.↵But then all of that can be unified efficiently around either coroutines (for streams and futures and transports) or continuations (for raw IO like sockets connection)
12:05:08FromDiscord<dom96> PMunch: not yet, but I will in a second 😄
12:05:31FromDiscord<mratsim> this means that as we progress we can have unified streaming API, that is very efficient, without waiting for interfaces/vtables/traits.
12:05:50FromDiscord<mratsim> and it can be passed from event loop to event loops.
12:05:58FromDiscord<mratsim> no need to choose one.
12:06:10FromDiscord<mratsim> including threadpools or Weave to asyncdispatch.
12:07:36FromDiscord<mratsim> this is my first design iterations with coroutines only: https://github.com/weavers-guild/weave-io/blob/master/design/design_1_coroutines.md↵and the second with exposing continuations: https://github.com/weavers-guild/weave-io/blob/master/design/design_2_continuations.md
12:11:00FromDiscord<mratsim> Also cancellation = not running the continuation.
12:11:19FromDiscord<mratsim> drop it and the destructors/finalizers are called.
12:13:30Zevvthats how it should be
12:13:38Zevvi love it when a plan comes together
12:14:21FromDiscord<mratsim> Usually when we reach that points, that's when ugly compiler bugs rear their ugly heads :p
12:15:31FromDiscord<mratsim> And this is the part of the stdlib that I can see being straightforward to upgrade with coroutines and CPS: https://github.com/disruptek/cps/tree/mratsim-public-api-proposal/cps/stdlib
12:16:19FromDiscord<mratsim> note: for strutils and sequtils we might want 2 implementations. One in-place to use with `dup`, and one coroutines-based, to allow streaming and lazy producer-consumer workflows.
12:17:09FromDiscord<mratsim> people might complain about color but I don't think there is a one size fits all there.
12:17:14*fanta1 quit (Quit: fanta1)
12:17:18FromDiscord<dom96> coroutines for strutils? Why?
12:17:46FromDiscord<mratsim> Because I'm tired of seeing "why is Nim so slow when processing CSV, advent of code, ..."
12:18:31FromDiscord<mratsim> strutils right know encourages 2 things: allocating intermediate buffers (solved with dup) and doing multiple loops over the data (not solved with dup)
12:18:51FromDiscord<mratsim> also that would make strutils compose with streams.
12:19:44FromDiscord<mratsim> you create your lazy processing, read stream chunk, maybe you search for a substring inside, output it to another coroutine that transforms it, and only then you allocate the final buffer.
12:19:55FromDiscord<mratsim> append to
12:20:21FromDiscord<dom96> hmm: `/usr/bin/ld: crt.o: unable to initialize decompress status for section .debug_aranges`
12:20:22FromDiscord<mratsim> so it's a functional alternative to collect, or similar to iterutils.
12:22:12FromDiscord<dom96> Oh well, no cosmopolitan for me
12:26:00PMunch@dom96, what does that mean?
12:26:23FromDiscord<dom96> no idea
12:26:33FromDiscord<dom96> Can you give it a try? Maybe you'll have better luck
12:26:43FromDiscord<dom96> This is just with their hello world example
12:31:11PMunchOh, I got their hello world thing to work
12:31:22PMunchBut it's pretty weird
12:32:10PMunchLike have a look at this: http://ix.io/2K5C
12:32:28PMunchCompiles fine, file struggles a bit with figuring out what it is
12:32:44PMunchThen after running it through bash it rewrites the binary to the actual program
12:32:57PMunchWhich means that after I have run it I probably can't copy it anywhere
12:33:19PMunchAnd now I need to run it as a normal program and not via bash
12:33:30FromDiscord<dom96> wow, interesting
12:33:33PMunchWhereas that didn't work before I ran bash on it
12:34:19FromDiscord<dom96> Can you check out what the file looks like before calling `bash` on it?
12:35:22qwrtesting the wonderful/terrible cosmopolitan libc hack?
12:35:36FromDiscord<dom96> yep
12:36:24Zevvdom96: we gain lazy evaluation and efficient functional programming
12:36:33PMunch@dom96, http://ix.io/2K5G
12:36:42PMunchFrom hexdump -C ./hello.com | head -n 100 | ix
12:37:16FromDiscord<juliuskiesian> just found out nim has a secret repl. 🙂
12:37:27FromDiscord<lqdev> yeah
12:37:30FromDiscord<juliuskiesian> sent a code paste, see https://play.nim-lang.org/#ix=2K5H
12:37:36FromDiscord<lqdev> but it runs things in the NimVM
12:37:49FromDiscord<lqdev> so it's not like real Nim
12:38:22FromDiscord<juliuskiesian> ok. so it's interpreted and slower?
12:38:33FromDiscord<lqdev> yeah
12:38:34FromDiscord<dom96> PMunch: yeah, that smells like far too much of a hack. Would be better if there was a separate script to do the conversion that can be reviewed.
12:38:47FromDiscord<lqdev> and also has some limitations namely with pointers and such
12:38:59FromDiscord<mratsim> @zevv: we get a syntax that doesn't eat your brain.
12:42:11Zevv\o/
12:46:32PMunch@dom96, what do you mean a separate script?
12:47:20FromDiscord<dom96> PMunch: the one you're running to get the binary, it shouldn't hide inside the binary
12:47:58PMunchAah
12:48:10PMunchWell I guess they wanted a single file thing
12:50:15PMunchI mean this is the thing it attaches: https://raw.githubusercontent.com/jart/cosmopolitan/467504308a103865c058f9a0ac858cc22e72240e/ape/ape.S
12:51:14PMunchBasically some hack that allows it to execute "something" for each platform. And that something is fix-this-to-actually-be-executable
12:52:13FromDiscord<cybertim> So i'm progressing with 'my first' nim project, currently using halonium inside jester, but this results in gc-safe errors, my solution for now is --threadAnalysis:off (everything seems to work fine) and from my simple understanding (as a async/await person) this is due to the fact that halonium spawns threads, does this mean that halonium needs a rewrite or is it possible to 'wrap' the whole thing inside some function that is gc-safe an
12:52:22PMunchWhat I thought this would be cool for, a utility USB that can run on all platforms, unfortunately wouldn't work to well since it rewrites the binary
13:00:30*saem quit (Quit: Connection closed for inactivity)
13:01:17*Arrrrrrrr quit (Ping timeout: 265 seconds)
13:01:48*Arrrrrrrr joined #nim
13:23:07FromDiscord<mratsim> I think there is a post about this. it's just that we need better gcsafe escape analysis.
13:23:46FromDiscord<mratsim> the escape hacth is using cast({.gcsafe.}): yourProblem.
13:24:00FromDiscord<mratsim> I don't remember the exact syntax
13:24:48FromDiscord<mratsim> the old one was `{.gcsafe.}: yourProblem` but we wanted to ensure that all unsafe uses could be greped with either `cast` or `unsafe` or `addr`.
13:25:16*lritter joined #nim
13:26:04Zevvgcsafe is a big pain in the derriere
13:26:39FromDiscord<lqdev> @mratsim i think the syntax was {.cast(gcsafe).}
13:28:40*habamax joined #nim
13:39:19FromDiscord<cybertim> yes i read about {.cast(gcsafe).} it's in the docs but it's only ~4 lines describing it, so it wasn't (and isn't) very clear, because just casting the whole thing to gcsafe doesn't mean it is safe, right? 😛
13:47:18FromDiscord<haxscramper> Is it possible to avoid
13:48:21FromDiscord<haxscramper> Is it possible to avoid `template instantiationt too nested`error when using dot operators in case of fields that are completely missing? I understand that this should cause this error
13:48:45FromDiscord<haxscramper> But maybe there is some workaround for checking if field is present in object
13:48:57FromDiscord<haxscramper> Without triggering ``.`` operator
13:49:10FromDiscord<mratsim> macros
13:49:30FromDiscord<mratsim> I had that issue in stint, build a macro that unroll your type recursively
13:52:35FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2K63
14:14:20narimirananybody interested in proof-reading our 2020 recap article? https://github.com/nim-lang/website/blob/c7caf9ae3555c8fd7ec9ac371dda27f987d1d66c/jekyll/_posts/2020-12-28-nim-in-2020-a-short-recap.md
14:14:41narimiran(don't worry about the image not showing up, and that embedded iframe)
14:23:10cmc[m]Is there a way for a proc to accept "any object with field foo:string and bar:int"- or, alternatively, "any object with foo:string and bar:int as the first two fields?
14:24:44Zevvconcepts
14:26:29*nyd joined #nim
14:27:52*Gustavo6046 quit (Ping timeout: 260 seconds)
14:28:36cmc[m]<Zevv "concepts"> cool, thanks!
14:29:21FromDiscord<sealmove> is it possible to accept a name of a nim module from the command line and import it at runtime?
14:30:54cmc[m]<FromDiscord "<sealmove> is it possible to acc"> No- at runtime, the binary has already been compiled, so you cannot import modules any more.
14:31:47*Gustavo6046 joined #nim
14:32:29FromDiscord<sealmove> hmm, what if I compile my modules to dll? can i choose them at load then?
14:32:37FromDiscord<sealmove> can I load them at runtime then
14:33:38FromDiscord<VVX7> import it as a shared library with Nim's FFI?
14:34:58cmc[m]<FromDiscord "<sealmove> can I load them at ru"> Yes, if you compile your modules to DLLs, then you can load them at runtime.
14:35:37FromDiscord<sealmove> nice. ok, now I have to learn how to do this. never made dlls before
14:43:07FromDiscord<haxscramper> narimiran: "600 new commits which have not already been backported" should probably be have already been, everything else looks good to me
14:43:57narimiran@haxscramper no, it is indeed commits which haven't been backported to the patches of earlier versions
14:44:08FromDiscord<haxscramper> oh
14:44:58FromDiscord<sealmove> `nim c -d:useNimRtl myprog.nim` generates a `.exe` instead of a `.dll`
14:50:19Zevvnim c -d:release lib/nimrtl.nim
14:51:06ZevvI think with arc you can do without librtl
14:54:11Zevvmratsim: "casting "ref object" to "ref object of RootObj" defined behavior"; I think that's funny to do. inheritable objects get a RootObj as first member with `TNimType* m_type` in there
14:56:33FromDiscord<mratsim> @Zevv, yep I checked the code and codegen
14:56:40Zevvright
14:56:44FromDiscord<mratsim> it's not funny it's undefined behaviour :p
14:56:58ZevvI find undefined behaviour pretty funny
14:57:03FromDiscord<mratsim> anyway, I have found a type erasure scheme that should be satisfactory to all.
14:57:24ZevvI still try to understand why the move needs to be explicitly there
14:57:26FromDiscord<mratsim> the cost is 8 bytes of space and an extra assign on object creation.
14:57:35Zevvif I take that out there is no suspending happening at all
14:57:55ZevvThe rootObj also takes 8 bytes, so that's the same
14:57:56FromDiscord<mratsim> you need to wasMoved the type
14:58:18FromDiscord<mratsim> it's via rootObj
14:58:30FromDiscord<mratsim> but don't make it ref by default
14:58:34Zevvriight. So, with your new scheme that drops?
14:58:47FromDiscord<mratsim> anyway pushing, 2 versions, the codegen is equivalent
14:59:14FromDiscord<mratsim> except that one is triggering the borrow checker because a copy happen even though there shouldn't be any copy.
15:00:50Zevvok, I need to dive in more to understand that I guess
15:01:05FromDiscord<mratsim> https://github.com/disruptek/cps/blob/mratsim-public-api-proposal/mratsim/ex04_type_erasure.nim
15:01:45Zevvyeah was just reading
15:01:49*beatmox- quit (Quit: ZNC 1.8.0 - https://znc.in)
15:02:00*beatmox joined #nim
15:04:34*Arrrrrrrr quit (Remote host closed the connection)
15:05:37FromDiscord<mratsim> I have to check also the codegen for ref but it might be that the union trick is unnecessary
15:06:50FromDiscord<mratsim> but it's easier to avoid reallocating with an union that autoinfers the maxsize
15:07:14FromDiscord<mratsim> instead of disruptek tricks to reparent the frames.
15:07:14Zevvit all feels pretty elaborate and complicated somehow
15:07:15Zevvbut hey
15:07:31FromDiscord<mratsim> it's complicated because I'm exhaustively checking for stuff
15:07:40Zevvyeah I understand :)
15:09:02FromDiscord<mratsim> do you know if there is already a way to do "continuation contains CPS call"?
15:09:11FromDiscord<mratsim> the "isFinished" issue is bugging me.
15:09:36Zevvyeah same here, I don't know yet
15:09:54Zevvwhere's disruptek, is he now asd?
15:11:32ZevvI think we had "Contains CP call" once, but the logic was crude
15:11:35Zevvbecause, what's a CPS call
15:12:38FromGitter<gogolxdong> @mratsim is your cps lock-free and gc-free?
15:12:49Zevvall CPS is lock-free
15:12:53ZevvCPS does not know what a lock is
15:13:18FromGitter<gogolxdong> good to know
15:14:01FromDiscord<mratsim> If I have a say it's also GC free, and allows you to do your own memory management in your scheduler (asyncdispatch, chronos, weave threadpool)
15:14:24Zevvand disruptek and me are keeping him from concentrating on that too much
15:14:51FromDiscord<mratsim> CPS is a technique to transform code into callback hell in the backend.
15:15:00FromGitter<gogolxdong> not on gc-free?
15:15:15FromDiscord<mratsim> they want to use ref meeeh
15:15:24Zevvno. because according to my calculations, approximately 94.7% of the users don't care about that
15:15:44Zevvand, hey, we don't GC in 2020
15:15:46Zevvwe ARC
15:15:53Zevvoooh, "heap free" you mean
15:15:53FromDiscord<mratsim> given that 70% of statistics are made-up i don't believe you
15:16:34FromDiscord<mratsim> I want composability, and that requires allowing people to choose how they want the memory to be managed.
15:16:53Zevvcomposability++
15:16:57FromDiscord<mratsim> anyway, I think the problem is solved
15:18:13FromDiscord<mratsim> provide "object of RootObj" continuations, and convenience proc to produce type-erased ref object of RootObj for schedulers
15:18:34FromDiscord<mratsim> and for manual memory management, provide a "sizeofContinuation" shim so that they can properly do allocation.
15:18:52Zevvso, that was kind of what you started with, right
15:19:49FromDiscord<mratsim> yes the original code is OK if we remove the ref.
15:21:55FromDiscord<mratsim> Also there is no "alloca" issue I think.
15:21:55FromDiscord<mratsim> what I don't understand is your "typed" continuations, I don't see overhead in the untyped continuations.
15:23:59Zevv"typed"?
15:24:48FromDiscord<mratsim> the typed branch that broke everything
15:25:06Zevvyou mean why we want to go typed in the first place?
15:25:37asdyou can't infer types in the env w/o typed.
15:25:44Zevvbecause of `var i: int = lo`
15:25:46Zevvright
15:25:47asd^
15:25:54Zevvdisruptek, can you *please* renick
15:26:17FromDiscord<mratsim> ah
15:26:22FromDiscord<mratsim> it's about typed macro
15:26:25Zevvyes
15:26:34FromDiscord<mratsim> I thought it was about having Continuation[T] instead of Continuation
15:26:39FromDiscord<mratsim> okay makes sense
15:26:39Zevvbut the AST we get then is half baked and broken in interestng ways
15:27:27FromDiscord<mratsim> When I need types in a macro, the first thing I do is an AST rebuilder to remove all the symbols, the overloads, the "in" that became "contains"
15:27:30cmc[m]<FromDiscord "<sealmove> nice. ok, now I have "> I made an unfinished invoice generator with a plugin system, this is pretty much what you want, it also has a nimble script
15:27:51FromDiscord<mratsim> or i split the code into typed and untyped and i do as much as possible in untyped.
15:28:09Zevvmratsim: yeah, my hunch was that we could do that as well, but I never got it to work
15:28:10FromDiscord<mratsim> until the code is called in generic procs that is, but that doesn't happen for CPS.
15:28:27asdit's hard to create a type without having types.
15:28:28Zevvso this is primarily about collecting the env frames with the right type in there
15:28:59FromDiscord<mratsim> this is my basic AST rebuilder https://github.com/mratsim/weave/blob/master/weave/parallel_macros.nim#L19-L71
15:29:17Zevvyeah I saw that. It makes me cry
15:29:41*PMunch quit (Quit: leaving)
15:30:09Zevvoh no, it's not that one
15:30:10FromDiscord<mratsim> and another one that extract the proper overload depending on the parameter types https://github.com/numforge/laser/blob/master/laser/lux_compiler/frontend/lux_sigmatch.nim#L16-L57
15:30:12Zevvthis one does not make me cry
15:30:51FromDiscord<Clyybber> asd: why are you asd
15:31:08FromDiscord<mratsim> sad
15:31:28cmc[m]<FromDiscord "<sealmove> nice. ok, now I have "> @sealmove Here is the code, it also has a nimble file to compile the dynamic lib plugins. The code doesn't run with current nim but you should be able to extract the relevant parts, look for "format" capocasa.net/nimvoice.zip
15:33:00FromDiscord<sealmove> It seems what I am trying to do is impossible after all :|
15:33:37FromDiscord<mratsim> Also one thing really annoying is the typedesc becoming NimNode in macro and no way to turn a NimNode into a typedesc
15:39:53*asd is now known as sad
15:40:34sadi'm thinking about the continuation wrapping a ref to the env.
15:40:42*sad is now known as asd
15:41:27FromDiscord<mratsim> it's better to have it inline, so that on stack there is zero alloc and for schedulers there is only one
15:41:53asdas i said, i don't disagree. but, one thing (think) at a time.
15:42:05FromDiscord<mratsim> I solved that problem
15:42:16*Torro quit (Quit: bye)
15:42:31FromDiscord<mratsim> you can play with the different versions here: https://github.com/disruptek/cps/blob/mratsim-public-api-proposal/mratsim/ex04_type_erasure.nim
15:46:07asdunion breaks js.
15:46:49asdit's a clever solution to the net problem, but 1) it doesn't work today, 2) i worry about it working tomorrow.
15:46:55FromDiscord<Clyybber> we want to keep cps agnostic of that, no?
15:47:46FromDiscord<mratsim> I've said that for ref we use plain inheritance
15:48:06FromDiscord<mratsim> but unions avoid having all the lines of code for reparenting that are very hard to follow
15:48:25asdwell, the reparenting can be rewritten.
15:48:34FromDiscord<mratsim> and they also are properly sized to avoid creating new objects if the new frame doesn't fit
15:48:45asdalso, i would sooner dump inheritance than dump js.
15:48:58FromDiscord<mratsim> I don't want to dump js
15:49:08asdi'm just saying, for comparison...
15:49:09FromDiscord<mratsim> having proper VTable would be really nice
15:49:12asdagree.
15:49:18FromDiscord<mratsim> it's littered in my code
15:49:19*asd is now known as disruptek
15:49:55FromDiscord<Clyybber> type erasure for js can be done in a js specific way
15:50:08FromDiscord<Clyybber> later
15:50:18FromDiscord<mratsim> https://github.com/disruptek/cps/blob/mratsim-public-api-proposal/mratsim/ex04_type_erasure.nim#L37-L38↵https://github.com/disruptek/cps/blob/mratsim-public-api-proposal/cps/core/public_api.nim#L16
15:50:22disruptekmaybe the better solution is to keep inheritance as a ct option so that it continues to work in tests.
15:50:34FromDiscord<mratsim> I plan to keep both
15:50:36FromDiscord<Clyybber> yeah; all this shouldn't be set in stone
15:50:41FromDiscord<mratsim> you can't do union with ref types
15:50:56FromDiscord<mratsim> I'm pretty sure that's broken
15:51:16disruptekno, i'm talking about removing the reparenting for complexity reasons.
15:51:51disruptekthis is just an escape hatch for if we decide to dump inheritance.
15:52:25disrupteki wish more of your branch's changes were behind a ct flag.
15:53:11disruptekor, like, 6 flags. 😁
15:53:31FromDiscord<mratsim> yeah but that would significantly hinder my ability to explore the design space in a short time
15:53:55disrupteknot my problem. 🤣
15:53:58FromDiscord<mratsim> that's also why I removed mutant, it had a lot of code.
15:54:06FromDiscord<mratsim> well, i solved my problem.
15:54:09FromDiscord<mratsim> 😛
15:54:12disruptekyou mean, you removed un-mutant?
15:54:19FromDiscord<mratsim> yes
15:54:29disruptekbecause, y'know, i think we need un-mutant.
15:54:37disruptekthere's a reason we didn't just embrance mutant instantly.
15:54:58FromDiscord<mratsim> do you remember it? 😉
15:55:00disruptekwe can probably keep both, though.
15:55:42FromDiscord<mratsim> unmutant is likely to introduce a lot of copy if we want the base continuation to be object of RootObj
15:55:49disruptekas i said before, i want to be able to return a B from an A continuation.
15:55:57FromDiscord<mratsim> we can't trust =sink fully yet
15:56:05disruptekthat's a separate problem.
15:56:18FromDiscord<mratsim> but for what use-case?
15:56:29disruptekcomposition.
15:56:57disruptekbut i need to shovel snow and consume coffee. bbiab.
15:57:08FromDiscord<mratsim> you can already compose. "jield" is basically taking the CPS continuation and switching it to the caller continuation.
15:57:35FromDiscord<mratsim> and the "resume" is switching the caller continuation to switch to the CPS one.
15:58:00FromDiscord<mratsim> and this is enough to represent all control flow.
15:58:43FromDiscord<mratsim> switching to any continuation is similar to asymmetric coroutines (that can only return to the caller) vs symmetric coroutines
15:59:32FromDiscord<mratsim> you can implement symmetric coroutines in terms of asymetric coroutines, by storing the current continuation in a scheduler, exit and pop the one you want from the scheduler and resume it.
16:02:17FromDiscord<Clyybber> disruptek: Ok, taste.nim should work again
16:02:55FromDiscord<mratsim> Ultimately we can provide a lua "switchTo(Continuation)" syntax sugar but we shouldn't expose the low-level continuation parameter.
16:03:23Zevvi dont really care, i can live with both
16:03:43Zevvso we're sert then: for the ref types we just use what we had, which also is fine for js
16:03:45FromDiscord<mratsim> I'd rather have a very small API and provide an example for swapping to arbitrary continuation.
16:04:16Zevvfor the object type mratsim does whatever tricks he finds are needed, but the ref people are not impacted by that
16:04:20FromDiscord<mratsim> yes, though I'd like to see if it's possible to avoid the reparenting business.
16:04:21Zevvthat sums it up?
16:04:28Zevvfair enogugh
16:04:30FromDiscord<Clyybber> Why don't we built this small API on top? So that we can keep doing these low-level fun things
16:04:43Zevvthats basically what mrarsim did
16:04:50FromDiscord<mratsim> otherwise we hide a variant and no union and no reparenting and no need to guess the size.
16:04:59Zevvhe hides the gory details in 3 exports, basically
16:05:25FromDiscord<Clyybber> My point is that we should keep unmutant in reserve
16:05:26FromDiscord<mratsim> disruptek likes the gor
16:05:40Zevvgood for him.
16:05:43FromDiscord<Clyybber> it shouldn't be too hard to keep it around no?
16:05:49Zevvim agnostic to gore
16:05:54FromDiscord<mratsim> it's a lot of noisy code
16:06:03FromDiscord<Clyybber> Zevv: Did your tzevv pass for you?
16:06:11Zevvonce it did
16:06:11FromDiscord<Clyybber> Fails with invalid ast () for me
16:06:38Zevvbut disruptek kept breaking so many things that i long gave up on that
16:06:38Zevvthe repo is a total wreck as it is now
16:07:00Zevvwe just kept the fuel tank from igniting
16:07:04*oculux quit (Ping timeout: 260 seconds)
16:07:17Zevvso mratism could do some forensics and hide the bodies
16:07:19FromDiscord<mratsim> yeah, I repaired one example, iterator, (somewhat) and only worked with that.
16:07:46Zevvthats mratsim. he solves problems.
16:08:13FromDiscord<mratsim> I just want to finish the coroutines API as well, get on reimplementing the stdlib as a showcase, agree on the public API and then we can reset the stuff when we confirm that's OK for everyone.
16:08:47FromDiscord<mratsim> basically this: https://github.com/disruptek/cps/tree/mratsim-public-api-proposal/cps/stdlib
16:09:19FromDiscord<mratsim> Codename: Unyielding↵_Resistance is futile, you will be assimilated_
16:10:35FromDiscord<Clyybber> disruptek: Oh, I think your testes is trying to tell me that taste is failing; at least it compiles now. Compiles as in doesn't crash the compiler :p
16:11:43*clyybber joined #nim
16:12:04clyybberdisruptek: ping ^
16:12:07*clyybber quit (Client Quit)
16:12:34FromDiscord<mratsim> I have a strange codegen bug for you btw: with inheritance, the thing that works on JS and for ref types, Nim doesn't close some "}": https://github.com/disruptek/cps/blob/mratsim-public-api-proposal/mratsim/ex04_type_erasure.nim#L122-L131
16:12:45FromDiscord<mratsim> this is blocking 😉
16:13:04Zevvmratsim: funny you dare touching the stdlib already
16:13:17ZevvI was thinking of silently creating a shadow implementation as well
16:13:19FromDiscord<mratsim> why?
16:13:27Zevvbecause it well cause Resistance, likely
16:13:42Zevvso I thought it safer to just do it and then show it when it's in a reasonable working state
16:15:15ForumUpdaterBotNew thread by Nim_zwei: How to sum the values of a table?, see https://forum.nim-lang.org/t/7299
16:16:13*waleee-cl joined #nim
16:16:20FromDiscord<mratsim> I've said it to dom but we will likely have 2 "color" in our stdlib in the future for strutils and sequtils.↵One with in-place mutation, with dup for chaining. Advantage of convenience, reasonably fast, but multiple pass over the data.↵One with streams thanks to coroutines, chain is native.
16:17:01FromDiscord<mratsim> That is unless timetheecour aliassym doesn't introduce a third way with chainable inline iterators
16:18:37FromDiscord<mratsim> or we can separate into strutils, strstreams, striters and sequtils, seqstreams, seqiters
16:19:38Zevvone thing at a time
16:24:18*filcuc joined #nim
16:29:29Zevvclyybbeer: what's the taste-the-tast then
16:30:17Zevvclyybber: I just checked: tzevv is ok in 0.0.13
16:38:00disruptektaste test is tests/taste.
16:39:02disruptekclyybber: nice! kinda huge.
16:39:53Zevvheey he's back \o/ hooray
16:41:24disruptekhmm. it doesn't work.
16:45:34*saem joined #nim
16:48:46disruptekmratsim: my use-case is that i'm in continuation A and i want to emit an "error" continuation B as opposed to continuing with A.
16:50:15disruptekclyybber: why don't my procs have return types now?
16:50:51*rockcavera joined #nim
16:55:39disruptekclyybber: in the cps macro, you result = transform; result = workaround(n). don't you want to workaround(result)?
16:56:23FromDiscord<Clyybber> oh yeah lol
16:56:32disruptekwell, that crashes the compiler.
16:57:55disruptekplease try to newNimNode(kind, n) so we keep the lineinfo.
17:06:34disruptekzevv: we should come to a decision about inheritance, i guess.
17:07:03Zevvso, what's the cost to throw it out
17:08:05Zevvdo you have warm feelings about inheritence?
17:08:15disruptekof course not.
17:08:39Zevvsurprise
17:09:30disruptekit produces "correct by construction" type associations with single source of truth for any given symbol.
17:09:57Zevvsure. but this is generated code.
17:10:04ZevvI'm willing to believe it's alternate truth
17:10:08disrupteki agree. but what else does it do for us?
17:10:24ZevvI don't know yet
17:10:42Zevvbut we keep it if we want to go js, right?
17:10:53disruptekwe don't have a liftlocals pass like normal folks. we do it iteratively.
17:11:00disruptekduring the recursion.
17:11:25disrupteki don't know how it affects js.
17:12:15Zevvyour single source of truth does help debugability I suppose
17:13:12*audiofile quit (Ping timeout: 272 seconds)
17:14:41disruptekif this was one of my private projects, i'd refactor it to an A/B impl with plain objects and let the tests keep them both honest.
17:15:29Zevvwell, it *is* one of your private projects if you want it to be
17:15:33disruptekthey are never going to be full equivalent, so the best solution would be a separate abstraction.
17:18:20Zevvactually I just can't tell the implications at this time
17:18:34disruptekyes, that's the problem.
17:19:05disruptekit's not an equivalent abstraction. so we should make one that /is/.
17:19:10FromDiscord<mratsim> I think we should keep inheritance just for the base cotninuation for type erasure
17:19:20FromDiscord<mratsim> but all the inner inheritance are unnecessary I think
17:19:37Zevvbut does it hurt
17:19:40FromDiscord<mratsim> you can just: https://github.com/disruptek/cps/blob/mratsim-public-api-proposal/mratsim/ex04_type_erasure.nim#L105-L109
17:20:02FromDiscord<mratsim> personally I find it hard to find which frame has what fields with inheritance.
17:20:46disruptekwhy is that important?
17:20:54ZevvOn the on hand the nice thing is that the inheritence reflects the scopes and all. On the other hand, I don't care about that, since it will be correct-by-default
17:20:55FromDiscord<mratsim> debugging.
17:21:04Zevvyeah, that was my point above here
17:21:07Zevvdebugability
17:21:09FromDiscord<mratsim> just generate the frame after the function
17:21:15FromDiscord<mratsim> after the function name
17:21:24FromDiscord<mratsim> instead of env_1234 for every scope
17:21:34FromDiscord<mratsim> frame_while_loop_1234
17:21:38Zevvwe lose some potential for smaller frames
17:21:52Zevvstuff can drop out of scope, but we keep it around
17:23:04FromDiscord<mratsim> but don't we always need to use the bigger frame anyway?
17:23:08disruptekwe could eventually have a shrink operation.
17:23:11disruptekno, we don't.
17:23:13FromDiscord<mratsim> to avoid realloc
17:23:14Zevvmratsim: no we don't
17:23:24*a_chou joined #nim
17:23:41Zevvyou can have something in an inner scope, and something else in a following inner scope
17:23:48Zevvthese can take the same location in memory because they do not exist at the stame time
17:23:52Zevvjust like they would on the real stack
17:24:17Zevvwe deduce the max possible frame size at compile time, and the inheritance brings it all "naturally"
17:24:18*a_chou quit (Client Quit)
17:24:28Zevvfor C, unions and casting would do as well, but we lose JS
17:24:40FromDiscord<mratsim> I would expect that if the compiler sees that they have the same size and the previous object is destroyed, it reuses the space, especially if it's var inpu mutated in place
17:25:04Zevvit's not destroyed. It's reusing the same block. Are we talking about the same thing here?
17:25:07ZevvHmm diner time, bbl
17:25:11FromDiscord<mratsim> but I think the more important thing here is nailing usability
17:25:21FromDiscord<mratsim> destroyed as in frame replaced by another
17:25:28disruptekwell, i don't care about people trying to debug cps.
17:25:32FromDiscord<mratsim> because if we show how wide it's applicable
17:25:44FromDiscord<mratsim> then maybe we get better way for type erasure.
17:26:09disruptekmy concern is really more about longevity of the solution.
17:26:23FromDiscord<mratsim> I care because we will have bug and maintenance for a couple months to do, and we need help given how it involves non-local control flow
17:26:29disrupteki don't want to find that we overlooked something and in fixing it, we have to break the entire stdlib. 🤣
17:26:39FromDiscord<mratsim> yes
17:27:35FromDiscord<mratsim> that's why I think we need to forget about the internals for now, we can use what we have, and only change what is preventing us for moving ahead.
17:29:49disrupteki agree, but only if the abstraction is tight enough. i'm not sure about mutant, still.
17:49:52Zevvwhy not
17:51:15disruptekbecause i don't understand the ergonomics of the continuation chain when we have to substitute a new continuation. do we just substitute the env? the whole continuation with our metadata? what does the user enter into their editor?
17:51:53Zevvbut is the alterative copying?
17:52:00disruptekno.
17:52:26Zevvthen I'm once again missing something
17:52:40disruptekunlikely.
17:53:01disruptek!mutant is the cps you knew and loved.
17:53:12disruptekmutant is continuations without a return-type.
17:53:40Zevvyeah and you're not sure about that?
17:53:50disruptekcorrect.
17:54:07Zevvok, what alternative *are* you sure about then?
17:54:22disrupteki'm sure !mutant works.
17:55:29Zevvyou're not talking about creating a new continuation & env at each suspend, right
17:55:35Zevvlike the very first thing we had
17:56:19Zevvreturn Env_xxxx(fn: ..., ...)
17:56:21disruptek!mutant works by simply returning the input continuation, generally, after changing the fn pointer.
17:57:09disruptekyou can chain to literally /any/ other continuation.
17:57:50Zevvright
17:58:32disruptekyou can also chain to nothing at all. without modifying memory.
17:58:45disruptekthis is not the case with mutant.
17:59:57Zevvhmm true
18:00:03Zevvand that might prove handy
18:04:07disruptekit seems a little nuts to assert that we will never support continuations with immutable input.
18:11:20Zevvwhich reminds me. We never did boxing
18:13:41*Arrrrrrrr joined #nim
18:15:23disruptekwhat would it buy us?
18:18:44Zevvlifting pointers to lacals
18:18:46Zevvlocals
18:18:55Zevvnot your typical use case
18:18:58*filcuc quit (Ping timeout: 256 seconds)
18:20:14disruptekiirc i couldn't think of a use at all.
18:26:08Zevvjust sayin'
18:26:18Zevvt'was in the cpc paper
18:28:02disruptekthe papers were inspirational, but that is all.
18:29:09FromDiscord<cybertim> which ircbot is being used to connect discord and irc for this channel? anyone knows?
18:29:32ForumUpdaterBotNew thread by Xigoi: Compile to a single C file?, see https://forum.nim-lang.org/t/7300
18:30:00disruptekcybertim: i think it's in yardanico's repos.
18:30:24FromDiscord<dk> What's the best alternative to `std/marshal` that also works on JS backend?
18:30:52FromDiscord<dk> `jsony` seems to not to work with case fields, so it doesn't even work with `Option[T]`
18:30:53disruptekcybertim:
18:30:56disruptek!repo ircord
18:30:56disbothttps://github.com/Yardanico/ircord -- 9ircord: 11Discord <-> IRC bridge in Nim 15 12⭐ 2🍴
18:31:14disruptek!repo jason
18:31:15disbotquery failed 😢
18:31:19disruptek!repo disruptek/jason
18:31:19disbotquery failed 😢
18:31:21disruptek!repo disruptek/jason
18:31:22disbotquery failed 😢
18:31:32Zevvtry saying "please"
18:31:37disruptekdisbot: please tell me when github is back?
18:31:38disbotconcentrate and ask again.
18:31:46disruptekdisbot: please, ffs, tell me when github is back?
18:31:47disbotsigns point to yes.
18:32:15disruptek!repo disruptek/jason
18:32:15disbothttps://github.com/disruptek/jason -- 9jason: 11JSON done right 🤦 15 38⭐ 1🍴
18:36:34disruptekgithub is rapidly acquiring the hallmarks of a microsoft product.
18:36:55FromDiscord<cybertim> thanks for the bot info 🙂
18:38:21*leorize quit (Remote host closed the connection)
18:39:41*leorize joined #nim
18:41:11Oddmongernim strings become arrays in js, and it seems by design (https://forum.nim-lang.org/t/1826#11425) , but maybe there is another option 5 years later ?
18:41:41disruptek!repo nodejs
18:41:42disbothttps://github.com/juancarlospaco/nodejs -- 9nodejs: 11NodeJS Standard Library for Nim 15 39⭐ 1🍴 7& 4 more...
18:43:06disrupteki could be wrong, but i think they are fixed in there.
18:43:15Oddmongerof course, i could use toString() …
18:43:41disruptekthis is a good application for term-rewriting macros, and i don't say that lightly.
18:44:48Oddmongeris the «term rewriting macro» the thing evoked by araq in the link above ?
18:45:13disrupteki dunno; links are a thing other people enjoy.
18:46:07Oddmongerah, riddles again
18:47:35disruptekthe answer is `no`.
18:47:49Zevvaw now you sound like an eight ball
18:48:11disruptekan eight ball does sound good right about now.
18:53:08Oddmongerso the macro in js in not «free» i guess ? (as there is no compile time), so would it be a real benefit versus just concatenates the array to a string with a js function ?
18:54:06disruptekyes.
18:54:43disruptekthe macro gets executed in nim's compile-time, so it rewrites a string to toString(string).
18:54:49disruptekor whateverthefuck you need.
18:55:58*saem_ joined #nim
18:56:06*saem_ waves
18:56:42Oddmongerah ok, so it's putting the js dust under the carpet , but the time to sweep will still be the same at the end
18:57:34disrupteki doubt it. if you care that js treats strings as Strings, then you probably want this.
18:57:55disruptekanyway, who the fuck sweeps under their carpets?
18:57:55Oddmongeryes i do agree i need this
18:58:33Oddmongerpeople with a magic carpet
18:59:02Oddmongerthank you for the answer, now i know i must read the macro part of the nim doc
18:59:13Oddmongeri had successfully avoided until now
18:59:24disruptekit will doubtless help your nim programming.
19:09:46FromDiscord<acek7> disruptek do you ever sleep
19:10:15disrupteki have to wait for you to turn your head.
19:13:27FromDiscord<acek7> hows the GUI dev coming in nim, been a few months since i checked in on it
19:13:51Zevvstill in a sorry state
19:14:13FromDiscord<Recruit_main707> there is fidget
19:14:15Zevvwe got figlet
19:14:18Zevvoh fidget sorry
19:14:43disruptekit's getting rewritten, so... yeah, don't bother messing with it.
19:15:03FromDiscord<acek7> fidget made any good progress? I had some issues it didnt like some of the stuff i designed and tried to implement lol
19:15:08FromDiscord<acek7> oh rewritten then
19:15:52*nyd quit (Ping timeout: 265 seconds)
19:17:27*nyd joined #nim
19:22:48*Jesin quit (Quit: Leaving)
19:25:15FromDiscord<acek7> since alot of people here like Nim, are anyone big fans of the languages it takes inspiration from. Such as python etc.
19:26:15*Jesin joined #nim
19:29:51FromDiscord<mratsim> @acek7 Nim takes more from Pascal, Modula2 and Oberon than from Python
19:30:28FromDiscord<mratsim> then again Python is inspired by the same for the syntax, but they didn't take all like the record declaration
19:30:37FromDiscord<mratsim> in fact Nim was bootstrapped from Pascal
19:31:03FromDiscord<exelotl> I never really learned python, but I did use turbo pascal for a year in school
19:31:29FromDiscord<exelotl> probably mentioned this before but I was really impressed how such an old language got so many things right
19:31:40ForumUpdaterBotNew thread by Mantielero: Problem related with scope, see https://forum.nim-lang.org/t/7301
19:31:50FromDiscord<exelotl> like, it predates C, but it has a proper module system, a rock solid type system, nested procedures, etc.
19:32:26FromDiscord<exelotl> makes me feel like C has no business being as successful and influential as it is...
19:33:06FromDiscord<acek7> i just said python since its syntax is similar, never used any of the others thats kinda why i asked if anyone used the others because im curious what brought people in
19:35:28FromDiscord<mratsim> I wanted Python, with types and speed.
19:35:44FromDiscord<haxscramper> In my experience it is closer to C++ and LISP. I don't have experience with pascal so can't really commen on this
19:36:16FromDiscord<haxscramper> But some books that I've read and used ALGOL as example language had very similar syntax
19:37:19FromDiscord<haxscramper> Even closer than python for most parts, except for `end` for blocks of course. As for 'why' - because nim is what C++ should have been from the start
19:38:34FromDiscord<haxscramper> Syntax has nothing to do with anything, and for other parts I believe this holds true - mostly procedural, struct-oriented with optional support for some `OOP` and `FP` concepts
19:39:19FromDiscord<haxscramper> (edit) "Syntax has nothing to do with anything, and for other parts I believe this ... holds" added "[nim being C++ 'done right']"
19:41:21*nyd quit (Quit: nyd)
19:41:37FromDiscord<mratsim> syntax has everything to do with C++ 😛
19:41:46FromDiscord<mratsim> or avoiding C++
19:42:25FromDiscord<haxscramper> I'm not so sure about that. E.g. if you can cut down on verbosity of the language, making it easier to express some concepts
19:43:11FromDiscord<mratsim> @disruptek, @zevv, believe me, you do not want to do immutable continuations
19:43:31FromDiscord<mratsim> That is likely one of the design mistakes of Scheme and it had a lot fo discusions ontheir mailing list
19:43:49FromDiscord<haxscramper> I can't really pinpoint exact part of C++ syntax that I really don't like, it is just a little more bloated that I would like, but that's all.
19:43:52disruptekthis isn't scheme.
19:44:02FromDiscord<mratsim> if you don't consume the continuation and allow it to be duplicated, you will introduce time travelling in Nim
19:44:09disrupteksweet.
19:44:17FromDiscord<mratsim> let's say your continuation ends up by closing a database
19:44:25FromDiscord<mratsim> if it's immutable, you will close it twice
19:44:32FromDiscord<mratsim> "enter the room once and leave twice"
19:44:47disruptekdon't use an immutable input, then.
19:44:49FromDiscord<mratsim> this require an expensive scheme called "unwind" in scheme garbage collector
19:45:08FromDiscord<mratsim> it's much easier to reason about one-shot continuation
19:45:22disruptekjust because you can't reason about it doesn't mean i can't.
19:45:43FromDiscord<mratsim> and no one found a use case for multishot continuations (copyable continuations) except as a challenge for the "non-deterministic program"
19:46:09FromDiscord<mratsim> if we really want that flexible this should be added later.
19:46:13FromDiscord<mratsim> flexibility
19:46:29disruptekwell, i won't be adding it later. i have it already.
19:46:37FromDiscord<mratsim> it's unergonomic
19:46:43disruptekyou don't have to use it.
19:46:44FromDiscord<mratsim> we shouldn't expose the raw Cont
19:47:04disruptekhow do you handle recursing over a view?
19:47:06FromDiscord<mratsim> not should we ask users to write their own Cont type, this can be autogenerated
19:47:16disruptekyou can do that in your branch.
19:47:34FromDiscord<mratsim> not sure what you mean. But one-shot delimited continuation can model all control flow.
19:47:51disruptekyou have a view that you don't own. how do you write an iterator against it?
19:48:01FromDiscord<mratsim> so captureing, suspending and resuming a continuation should be all we need
19:48:22FromDiscord<mratsim> openarray are value types now
19:48:35FromDiscord<mratsim> you can store that in the coroutine
19:49:05*abm joined #nim
19:49:49disruptekfine, not an openarray.
19:49:53disrupteksome other immutable type.
19:50:32FromDiscord<mratsim> types are either, not owned, uncopyable or unmovable
19:50:52disrupteki'm gonna pass on that.
19:50:56FromDiscord<mratsim> if uncopyable, whell you just need the user not to use it anymore so that it's moved in the coroutine
19:51:22FromDiscord<mratsim> unmovable, it's likely that you just shouldn't use it beyond what it's intended for
19:52:08FromDiscord<mratsim> but I really don't see any reason to expose the raw continuation and even less to make it immutable.
19:52:46FromDiscord<mratsim> I'd rather have a simple, coherent story without gaping caveats for the first iteration that solves 99.9% of the problem domain
19:53:24disruptekyou can do that without sacrificing immutability, but suit yourself.
19:53:38disrupteki don't really care what you use in weave.
19:53:49FromDiscord<mratsim> I'm not taking about Weave
19:54:08FromDiscord<mratsim> I'm talking about streams, sequtils, strutils, asyncstreams, futures.
19:54:10disrupteki don't really care what you use.
19:55:00ZevvDoes this affect your CSP dreams somehow?
19:55:24disruptekis immutability somehow important? yes.
19:55:32Zevvhow
19:55:43disrupteki plan to use cps on values that are immutable.
19:57:26FromDiscord<mratsim> http://scheme-reports.org/mail/scheme-reports/msg02780.html↵http://www.atdot.net/~ko1/pub/ContinuationFest-ruby.pdf↵↵look for "dynamic-wind" as well. the continuation should be destroyed, not immutable.
19:57:50disruptekbelieve it or not, i actually don't care about scheme's impl.
19:57:54FromDiscord<mratsim> there is no problem to use CPS as is on immutable value, they are copied or moved into the continuation
19:58:17disruptekyeah, nah.
19:58:19Zevvyeah, you're not giving up the immutability of your data, right?
19:58:36disruptekno way.
19:58:54Zevvno, I mean, you can still use mutant CPS with unmutable data?
19:59:01FromDiscord<mratsim> yes
19:59:08disrupteknot without modifying memory.
19:59:11FromDiscord<mratsim> you mutate the continuation not the input
19:59:48FromDiscord<mratsim> it's better if you show an example.
20:00:25*habamax quit (Ping timeout: 246 seconds)
20:00:27FromDiscord<mratsim> when you pass "counter(1, 2)" 1 and 2 are immutable, they don't even have an address
20:02:21disrupteknimph's tests demonstrate a --gc:arc bug with json parsing.
20:05:33FromDiscord<mratsim> I have found the ultimate ARC+CPS repo: https://github.com/awwx/arc-cps
20:10:24disruptekhmm, it's not json, it's something even more fun.
20:11:11disrupteki'm too old for this shit.
20:12:26*Arrrrrrrr quit (Remote host closed the connection)
20:14:49FromDiscord<dk> Is there a variant of `asyncfutures.or` that takes a `varargs` instead of exactly two arguments
20:15:02disruptekit's easy to write.
20:16:15disruptek!repo disruptek/rest
20:16:16disbothttps://github.com/disruptek/rest -- 9rest: 11REST comfort 15 0⭐ 0🍴
20:16:23disruptekpretty sure i have one in there.
20:17:31disruptekasync is so 2006.
20:18:46Zevvdude 158 repos
20:18:49saem_disruptek: (this is purely for my curiosity) in regards to the immutability conversation above are you're referring to a situation such as, I as a potential author of tock (fn in the readme) want to ensure that any state captured within the continutation (which is really mine) doesn't get mutated/corrupted by a dispatcher or whatever?
20:19:52Zevv!repo yourang
20:19:53disbothttps://github.com/disruptek/yourang -- 9yourang: 11Thread-safe performant async I/O for Linux 15 5⭐ 0🍴
20:19:55Zevvyou never told me that
20:19:59disruptekit's more along the lines of, /someone gave me this immutable thing and i want to look at it with an operation that may have a continuation in it/
20:20:10disrupteki didn't finish yourang.
20:20:27FromDiscord<dk> @disruptek thanks
20:20:32ZevvI never actually /used/ io_uring, only read about it and looked at the headers
20:21:31Zevvdisruptek: but your continuation will hold a copy of your original memory by default right
20:21:50disruptekwhat?
20:21:58FromDiscord<mratsim> or a move if the mutation completely owns it
20:22:01Zevvright
20:22:39disrupteklet's put it like this: i want to impl my continuations using strictFuncs.
20:22:47Zevvhmmm.
20:23:09Zevvbut you will not /implement/ your continuations. CPS will do that for you
20:23:21Zevvbut if you CPS a structFunc function...
20:23:43FromDiscord<mratsim> in the template generated to access the env, we can do some trickery to prevent compilation if an originally immutable parameter is accessed in a mutable way
20:23:47disruptekcps will merely rewrite my control-flow. i still want to compose using strictFunc.
20:24:14ZevvI really need more real life code and examples to think about this stuff
20:24:24FromDiscord<mratsim> mutant continuations doesn't prevent strict func, I don't see the problem.
20:24:31disruptektoys are pointless.
20:25:17FromDiscord<mratsim> the only issue I see is that originally immutable parameters as declared by the user, can be used in a mutable manner in the continuation due to the rewrite.
20:25:28FromDiscord<mratsim> and the compiler will not catch that
20:25:49FromDiscord<mratsim> but we can probably modify the template call to catch that.
20:25:52disrupteki will break your toys, but first i have to try to work around this arc memory corruption.
20:26:02Zevvfair nuff
20:26:08Zevvcan I assist in that?
20:26:10disruptekzevv: yourang is not a liburing wrapper.
20:27:01disruptekie. it using the syscalls directly.
20:27:17Zevvyea I know
20:27:25disruptekif you wanna corrupt your memory, nimph/tests/tpackage.nim ftw
20:28:21Zevvhow does it manifest?
20:28:46disruptekcorrupted package object in the packages group that we parse from json.
20:29:01disruptekPackage is ref object
20:35:21disrupteki bet it's move(x, x)
20:35:28disruptekyep.
20:35:31disruptekgah, so dumb.
20:36:08*hnOsmium0001 joined #nim
20:36:33Zevvow so
20:36:35Zevvhow
20:36:48FromDiscord<acek7> anyone here a fan of .net c# stuff
20:36:55Zevvnope
20:36:59disruptekgroup[x.toLowerAscii] = group[x] # corruption
20:37:16Zevvuhm wait what
20:37:22FromDiscord<mratsim> I like that they introduced Monads and Continuations to the imperative world but otherwise no.
20:37:32FromDiscord<mratsim> sorry async/await
20:37:37FromDiscord<mratsim> not continuations
20:37:46FromDiscord<mratsim> I'm too deep in the pit
20:40:40disrupteki would rather write c# than java, except that, y'know, i'd rather have access to the jvm than .net. so, there's that.
20:43:33Zevvso where's shashlick gone
20:43:38Zevvhe just went into thin air
20:43:53disruptekhe's taking a break from his oss hobby.
20:43:54Zevvargh FUCK dependencies, in the broadest sense
20:44:36Zevvoh sorry
20:45:11disrupteknimph no longer supports nim-1.0 for nimterop reasons. 🤷
20:49:16*narimiran quit (Ping timeout: 240 seconds)
20:51:11FromDiscord<mratsim> sent a long message, see http://ix.io/2K8y
20:51:13FromDiscord<mratsim> I'll write something on the repo
20:52:51ZevvI think we considered stuff like this once. We considered so many stuffs
20:54:04Zevvbut
20:54:07disruptekor, you just do what we did. 😉
20:54:33Zevvif we inject the 'fake' locals with templates, can't we just make things ro there
20:54:55disruptekwe don't use templates anymore.
20:54:59Zevvooh
20:55:03Zevvwe rewrite again?
20:55:09Zevvthe templates were my best idea
20:55:18disruptekwe just rewrite all the syms.
20:55:22Zevvpfff
20:55:51disruptekat least, that's my recollection.
20:57:16FromDiscord<mratsim> in Weave I use the wrapper proc techniques, though everything is immutable in Weave.
21:03:19FromDiscord<mratsim> @zevv, I think this describes @disruptek immutability issues with mutant and a solution: https://github.com/disruptek/cps/issues/44
21:03:24disbotPreventing immutable parameters from becoming mutable. ; snippet at 12https://play.nim-lang.org/#ix=2K8E
21:04:34Zevvor you just inject "let a = c.a"
21:04:37Zevvbut whatever
21:04:55FromDiscord<mratsim> if c.a is array[32, byte] that's expensive.
21:05:44FromDiscord<mratsim> using with {.byaddr.} I think we can still mutate as well.
21:05:54FromDiscord<mratsim> not sure, @Clyybber ? ^
21:06:44*l1x joined #nim
21:15:02FromDiscord<mratsim> tested, let byaddr doesn't prevent mutation through the alias.
21:15:21*saem quit (Quit: Connection closed for inactivity)
21:15:21*saem_ is now known as saem
21:17:33Zevvha
21:19:35FromDiscord<mratsim> it's like ref, you cannot change the pointer but you can change what is underneath
21:19:45FromDiscord<mratsim> but the proc indirection would work
21:20:21FromDiscord<mratsim> it would also cleanly separate CPS stuff in the wrapper from user stuff in the inner proc.
21:23:11FromDiscord<mratsim> an alternative is to use distinct types, but I think it only works if you know all the proc you need to support:↵↵https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/laser/tensor/datatypes.nim#L19-L20
21:23:20FromDiscord<mratsim> https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/laser/tensor/datatypes.nim#L200-L210
21:30:10*lritter quit (Quit: Leaving)
21:45:14*Vladar quit (Quit: Leaving)
22:05:55*oculux joined #nim
22:31:34FromGitter<deech> Can't think of why this is in any way helpful but apparently you can have a proc with empty constraints like: `proc p[]() = ...`
22:46:32*leorize quit (Quit: WeeChat 2.9)
22:56:26planetis[m]macros.
23:09:59planetis[m]also `case;else: discard` is possible again because of macros
23:23:02FromDiscord<bark> I've debugged a segfault down to a single line, where if I comment/uncomment, the segfault doesn't/does occur... it's a setForegroundColor call 🤔
23:30:02FromDiscord<bark> I am probably messing up with something gc related 🤔
23:31:03disruptekcode or it didn't happen.
23:34:38FromDiscord<bark> I just realized I put ref values behind pointer arithmetic, so something weird was bound to happen sooner or later
23:35:22FromDiscord<bark> i mean not directly, but a large object where one of its kinds could have been a ref value
23:36:05FromDiscord<bark> so i'll go with didn't happen
23:47:38*vicfred joined #nim
23:54:55*tane quit (Quit: Leaving)
23:56:17saemAnd all done with GDB related changes for now.
23:56:29saemPR: https://github.com/nim-lang/Nim/pull/16479
23:56:30disbotAttempts at improving nim-gdb.py
23:56:57saemon to nimsuggest findProjectNimFile