<< 15-08-2025 >>

00:11:53FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=BREoVBHu
00:13:16FromDiscord<heysokam> supossedly inherited, but actually not? or am I misunderstanding something đŸ€” https://media.discordapp.net/attachments/371759389889003532/1405705866363146422/image.png?ex=689fcd1b&is=689e7b9b&hm=bc8ed39ebc33c72b0e4b739d9355e8784a9234a3d881c7ecf075782fdaa0de14&
00:13:47FromDiscord<leorize> did you set poUsePath option?
00:14:02FromDiscord<heysokam> all defaults, whatever they are
00:14:58FromDiscord<leorize> I think you already pasted what the defaults are
00:17:15FromDiscord<heysokam> yep, poUsePath was what was missing, ty leo
00:17:40FromDiscord<heysokam> spawned too many processes, and crashed my computer :whoops: 😄
00:25:47FromDiscord<heysokam> is there any existing function on the stdlib to parse escaped strings?
00:26:14FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=BcllmaWo
00:26:59FromDiscord<leorize> there wouldn't be any one function to do that
00:27:01FromDiscord<Elegantbeef> https://nim-lang.org/docs/strutils.html#unescape%2Cstring%2Cstring%2Cstring
00:27:06FromDiscord<leorize> everyone does escaping a tiny bit differently
00:33:30FromDiscord<heysokam> much better, ty ty https://media.discordapp.net/attachments/371759389889003532/1405710957879234640/image.png?ex=689fd1d9&is=689e8059&hm=0320a1d415f2921c69fd4011ad44f42496f69f5a62055715f3755bbe93507b69&
01:00:42FromDiscord<mayendradwika> guys what recommend a project for a newbie
01:01:26FromDiscord<mayendradwika> i do cli
01:33:19FromDiscord<Robyn [She/Her]> text adventure↔(@mayendradwika)
02:47:01*amadaluzia quit (Ping timeout: 276 seconds)
02:52:21FromDiscord<zumi.dxy> sent a code paste, see https://play.nim-lang.org/#pasty=jhjcyuHm
02:54:07*amadaluzia joined #nim
02:56:16FromDiscord<leorize> nope
02:56:38FromDiscord<leorize> you technically can use `range[A..B]`
02:57:02FromDiscord<leorize> but always beware of returning that, because it is viral
02:57:14*amadaluzia quit (Read error: Connection reset by peer)
02:57:16FromDiscord<heysokam> In reply to @zumi.dxy "quick question if I've": https://play.nim-lang.org/#pasty=ftGxAJIO
02:57:34*amadaluzia joined #nim
02:57:38FromDiscord<leorize> say someone do `let x = something(); echo x.succ`, if something returns B, this code will crash
02:57:40FromDiscord<heysokam> wdym by viral, leo?
02:58:50*amadaluzia quit (Remote host closed the connection)
02:59:01FromDiscord<leorize> the guarantee of your return range infected the consumer and now a variable they put that value into will also carry that restriction
02:59:29FromDiscord<leorize> it's the same reason `len()` doesn't return `Natural`, for example
02:59:37FromDiscord<zumi.dxy> range is its own type right?↔like here it can't be decomposed into `One`?
02:59:47FromDiscord<leorize> because `x.len - 1` will crash on empty
03:00:01*amadaluzia joined #nim
03:01:01FromDiscord<leorize> you can convert range back to the base type implicitly↔(@zumi.dxy)
03:03:39FromDiscord<zumi.dxy> yeah I'll suppose I'll have to remember to do `let x: One = thing()` instead of `let x = thing()`
03:04:43FromDiscord<zumi.dxy> also since it's a range I guess that also means I'll have to sort my enum accordingly?
03:05:18FromDiscord<zumi.dxy> holeful enums are out of the question I assume
03:05:25FromDiscord<leorize> yes
03:14:26*rockcavera quit (Remote host closed the connection)
03:17:34*amadaluzia quit (Quit: You)
03:56:23FromDiscord<tomexmachina> the current state of Nim's concurrency model (what one should and shouldn't use) is very confusing. I used Nim a lot pre-2.0, and made extensive use of async patterns. Now I have a need for threads. If anyone can point me to a recent docs or post that will provide concrete direction, I'd appreciate it.
04:12:53FromDiscord<leorize> ~~the answer is to cry~~
04:20:29FromDiscord<tomexmachina> https://forum.nim-lang.org/t/13322#80966
04:20:44FromDiscord<tomexmachina> (edit) "https://forum.nim-lang.org/t/13322#80966" => "https://forum.nim-lang.org/t/13322"
04:21:30FromDiscord<tomexmachina> i guess it's await moderation or something
04:25:31FromDiscord<tomexmachina> here you go: https://gist.github.com/bitnom/43ec702b130048ddf18d1243d44ba306
04:27:25FromDiscord<leorize> so even deep research couldn't figure out cps \:p
04:28:39FromDiscord<tomexmachina> In reply to @leorize "so even deep research": should I point it to some URLs and tell it to revise?
04:29:11FromDiscord<tomexmachina> It's fine to have all these issues. I just need to know them well
04:30:13FromDiscord<leorize> not that I blame it, tbh
04:30:14FromDiscord<leorize> fyi we already achieved an async/threading runtime with cps
04:30:14FromDiscord<leorize> the catch\: it doesn't work with nim \>2.0
04:31:54FromDiscord<leorize> the reason I don't blame it is because most of these information are not directly linked to nim and/or stuck in discord
04:32:10FromDiscord<leorize> you can give it these and see if it could figure something out↔● https://github.com/nim-works/cps↔● https://github.com/disruptek/insideout
04:40:29FromDiscord<tomexmachina> updated: https://gist.github.com/bitnom/43ec702b130048ddf18d1243d44ba306
04:41:32FromDiscord<tomexmachina> plz lmk if it's doing some dumb shit
04:41:54FromDiscord<Elegantbeef> It's AI it's dumb
04:42:35FromDiscord<tomexmachina> In reply to @Elegantbeef "It's AI it's dumb": sure, but sometimes it pretends good enough to be useful
04:51:23FromDiscord<tomexmachina> damn so do I go pre 2.0 or use libraries? and which libraries? Malebolgia isn't a one size fits all threading library from what I can tell. I don't even remember what I would be giving up pre-2.0
05:26:15FromDiscord<tomexmachina> I don't want to rust. i'll do anything 😭
05:39:27FromDiscord<Robyn [She/Her]> In reply to @tomexmachina "damn so do I": Could use Nimskull + Cps
05:49:09FromDiscord<tomexmachina> In reply to @battery.acid.bubblegum "Could use Nimskull +": I barely remember it but I had it starred. it's in good shape?
06:13:28FromDiscord<zumi.dxy> it's in active development yeah↔seems to be somewhat experimental last I checked↔and there's the whole "won't be compatible with nim" thing, may or may not be a consideration
08:18:14*skippy8 joined #nim
08:47:20*beholders_eye joined #nim
10:53:56FromDiscord<xtrayambak> Is there a way to ensure that a destructor to `X` is called for cleanup even if a `ref X` or `ptr X` is passed to another thread?
11:03:57*SchweinDeBurg quit (Ping timeout: 260 seconds)
11:13:58*SchweinDeBurg joined #nim
11:14:33*zgasma quit (Quit: Lost terminal)
11:40:24FromDiscord<0xfab_10> not sure how stable `ref`s are in multithread but you could always implement your own atomically reference counted container for heap allocated objects
11:41:07FromDiscord<albassort> In reply to @xtrayambak "Is there a way": i highly doubt it, IPC between threads can be very leaky, really, no matter what answer you get, i really recommend you test it
11:41:08FromDiscord<0xfab_10> kinda like this https://github.com/fabricio-p/nanobeam/blob/main/src/nanobeam/arc.nim
11:41:15FromDiscord<albassort> @Phil did some testing relevant
11:41:20FromDiscord<albassort> (edit) "@Phil did some testing relevant ... " added "a year ago or smth"
11:42:37FromDiscord<albassort> me personally, every single object I pass between threads I do the following↔1. allocate shared↔2. deepcopy and destroy if applicable ↔3. free on the other end
11:42:43FromDiscord<albassort> (edit) "me personally, every single object I pass between threads I do the following↔1. allocate shared↔2. deepcopy and destroy if applicable ↔3. free on the other end ... " added "when not in use"
11:43:51FromDiscord<albassort> also nim's allocator doesn't usually free memory back to the system, keep that in mind
11:44:17FromDiscord<albassort> (or didn't?)
11:45:02FromDiscord<0xfab_10> there's `--useMalloc`
11:45:13FromDiscord<0xfab_10> I think that one does? not sure
11:46:34*przmk quit (Ping timeout: 252 seconds)
11:51:19FromDiscord<Phil> Nim's allocator and memory passing are 2 separate issues
11:51:26FromDiscord<Phil> When you work with threads, you must useMalloc or you're in for leaks
11:51:58FromDiscord<Phil> Nim's default allocator just does not work well in multithreaded scenarios, this might've been fixed in the meantime, but it was a strong issue when I played around with threads
11:53:52FromDiscord<Phil> Memory passing in general... I couldn't find a decent answer to this really. At least I couldn't get anything beyond a non-trivial program to run without address and thread sanitizer yelling at me.↔Personally I'd always go with the deepcopy approach. Don't even bother trying to move ownership unless you really know what you're doing (I didn't), deepcopying is far, far, far easier and safer
11:54:13FromDiscord<Phil> (edit) "approach. Don't" => "approach for passing data from thread A to thread B. ↔Don't"
11:56:21*nils` quit (Ping timeout: 276 seconds)
11:58:52*beholders_eye quit (Ping timeout: 276 seconds)
12:00:01*przmk joined #nim
12:00:20FromDiscord<xtrayambak> In reply to @albassort "i highly doubt it,": yeah, I just ended up turning it into a manual `close()` proc
12:10:55*beholders_eye joined #nim
12:11:25*przmk quit (Remote host closed the connection)
12:11:54*przmk joined #nim
12:44:43*amadaluzia joined #nim
13:05:21*beholders_eye quit (Ping timeout: 248 seconds)
13:07:09*beholders_eye joined #nim
13:40:16FromDiscord<albassort> hey guys wtf is std/tasks
13:41:36FromDiscord<albassort> it says its for parallelized programs but parallelism isn't demonstrated in the example and i doubt it calls jump
13:47:27FromDiscord<nervecenter> In reply to @albassort "hey guys wtf is": Looks like it's primitives for isolating procedures but not actually dispatching them to threads
13:47:38FromDiscord<nervecenter> Nim's parallelism story is very fragmented right now
13:47:57FromDiscord<albassort> taskman goes brr
13:48:15FromDiscord<albassort> i have been doing a lot of parallelism in nim for years, it works
13:48:22FromDiscord<albassort> but... uhh
13:48:27FromDiscord<nervecenter> oh, then you know more than me
13:48:30FromDiscord<albassort> works is as far as i would put it
13:49:24FromDiscord<albassort> we have async and asyncdispatch but its leaky and bug prone esp when used with threads and causes deep ownership issues, i prefer using taskman when possible but it leaves the IO problem yet unsolved 😭
14:00:34FromDiscord<Phil> In reply to @albassort "works is as far": It only works if asan and tsan say you have no error
14:27:04*beholders_eye quit (Ping timeout: 276 seconds)
14:31:21*nils` joined #nim
14:31:55*skippy8 quit (Ping timeout: 260 seconds)
14:35:24FromDiscord<griffith1deadly> In reply to @albassort "we have async and": weave io?
14:53:57FromDiscord<odexine> In reply to @isofruit "It only works if": technically not necessarily, it doesnt work if asan and tsan says you have an error (and you check if its not spurious) but the converse doesnt hold true
14:54:11FromDiscord<odexine> oh wait im supposed to be dead oooooooo im a ghost đŸ‘»
15:06:39FromDiscord<thearchivalone> In reply to @Elegantbeef "https://github.com/beef331/nimassimp/ is what I": Are you still using this? How usable is it right now?
15:30:11FromDiscord<albassort> In reply to @isofruit "It only works if": nah valgrind says all freed that should be freed then its good enough for me
15:37:00FromDiscord<Phil> In reply to @albassort "nah valgrind says all": That only tells you that you don't leak memory, it does not tell you if you have dataraces.↔And dataraces mean potentially random crashes that will be impossible to debug
15:37:22FromDiscord<Phil> If you don't wanna do tsan, do hellgrind which is the equivalent tool in valgrind 😛
15:38:10FromDiscord<albassort> Phil, let me tell you something
15:38:15FromDiscord<albassort> im afraid to check
15:38:27FromDiscord<albassort> because then i'll just gaslight myself into writing everything in C
15:38:29FromDiscord<Phil> I know, I was as well and eventually failed on getting tsan correct for complex topics
15:38:58FromDiscord<albassort> people hate C but im fond of her height
15:56:29FromDiscord<naitsabot> sent a code paste, see https://play.nim-lang.org/#pasty=PBlJwLUa
16:00:04*zgasma joined #nim
16:06:46FromDiscord<Robyn [She/Her]> In reply to @albassort "we have async and": could try and use selectors when IO stuff is needed
16:32:27FromDiscord<nasuray> In reply to @naitsabot "Am i going crazy?": ignore the `src/` in the docs that's some artifact with how it's being built/included in the compiler repo. When you compiled the second version did the compiler pick up the flag `--noNimblePath` anywhere?
16:53:00FromDiscord<lainlaylie> `nimble setup` generates a config that adds that flag. i think `nimble build` also calls nim with that flag
16:53:17FromDiscord<lainlaylie> make sure youve required it in your nimble file
17:00:08*beholders_eye joined #nim
17:05:21FromDiscord<thearchivalone> Anyone else using Nimble as a self contained build tool? I'm surprised at how easy it was to bootstrap from an old version to a new one and embed it in my current project. It just downloads most of the things needed and then builds itself (making worrying about sharing builds for multiple platforms less of an issue). It still has work to be done and could be optimized quite a bit. Haha
17:08:31FromDiscord<Robyn [She/Her]> I just don't use Nimble :p
17:14:15FromDiscord<thearchivalone> I am but a simple man. 😛
17:17:39FromDiscord<heysokam> In reply to @bugcrowd_tao "Anyone else using Nimble": I did, and abandoned it. Not worth the trouble as a build tool. its only really a package manager
17:17:58FromDiscord<albassort> In reply to @battery.acid.bubblegum "I just don't use": ??
17:18:21FromDiscord<heysokam> I created confy and moved all my stuff to it, if you want to check it out↔https://github.com/heysokam/confy
17:25:35FromDiscord<thearchivalone> As someone who loves Buck for the same reasons, you just introduced chaos into my life. That may be a future addition now
17:27:41FromDiscord<thearchivalone> Buck was one of Facebook's answers to problems they had with multiple build systems, especially what Google offered, and it was love at first sight for me when I do anything with C or C++
17:28:30FromDiscord<Elegantbeef> The best build system is `.fish`, if you need anything more complex I don't want to see your code
17:29:32FromDiscord<thearchivalone> Fish, the shell script interpreter?
17:29:43FromDiscord<Elegantbeef> Yes
17:29:53FromDiscord<thearchivalone> ❀
17:30:31FromDiscord<thearchivalone> Fish is so fun (but also something I put way too much time into years back to the point of getting nothing done)
17:30:48FromDiscord<Elegantbeef> I'm only slightly joking, I do not want to see anything complicated that cannot be replicated by a shell script and 30 minutes
17:31:03FromDiscord<Elegantbeef> Build systems should be simple and not require a degree in esoteric languages to get into
17:31:47FromDiscord<thearchivalone> i agree
17:32:21FromDiscord<thearchivalone> They also need to be flexible and allow multiple languages to be used in a project (at least for me)
17:34:16FromDiscord<Elegantbeef> Myself I try to avoid any foreign language dependencies except C since I can compile it from inside Nim
17:35:34FromDiscord<albassort> rust deps are ok
17:35:38FromDiscord<albassort> but annoying to implement
17:36:07FromDiscord<Elegantbeef> Yea I don't overly like them cause now it requires me to figure out where and when to install and build them
17:36:18*fallback quit (Server closed connection)
17:37:06*zgasma quit (Quit: Lost terminal)
17:37:10FromDiscord<Elegantbeef> It also means needing the Rust compiler aswell
17:40:41*zgasma joined #nim
17:51:56*fallback joined #nim
18:14:35*zgasma quit (Quit: Lost terminal)
18:38:55FromDiscord<Robyn [She/Her]> In reply to @albassort "??": Yeah I've stopped using Nimble, to work on my own package manager from scratch, so I can stop using Nimble :p
18:40:18FromDiscord<aintea> isn't nimble being worked on for nim 3 ?
18:40:52FromDiscord<Robyn [She/Her]> I'm moving to Nimskull, personally
18:41:18FromDiscord<Robyn [She/Her]> so I can't even use Nimble anymore anyway
18:42:11FromDiscord<Robyn [She/Her]> But if I do use Nim 3, I'd rather just implement support for my w.i.p PM
18:49:22FromDiscord<heysokam> In reply to @battery.acid.bubblegum "Yeah I've stopped using": how's progress on this? I'm really curious what you come up with
18:55:30FromDiscord<Robyn [She/Her]> In reply to @heysokam "how's progress on this?": honestly I'd say that i have made some progress, i actually just need to implement the manifest validation logic
18:55:46FromDiscord<Robyn [She/Her]> I have all the pieces there, just not hooked up, yk?
18:55:52FromDiscord<heysokam> I see 🙂
18:56:05FromDiscord<heysokam> is the repo public? I'd love to keep an eye on it!
18:56:33FromDiscord<Robyn [She/Her]> though my PM will require some patches to the compiler for scoped paths (so I can selectively expose a directory under a different module name, to specific modules)
18:56:52FromDiscord<Robyn [She/Her]> In reply to @heysokam "is the repo public?": Yeah it is! https://github.com/Luyten-Orion/FaePkg
18:57:39FromDiscord<Robyn [She/Her]> I plan on making an accompanying build system library for it too, just to try and unify Fae into a bit more of a feature complete thing
18:57:47FromDiscord<Robyn [She/Her]> I'm sorta basing it off of Cargo a decent bit
18:58:29FromDiscord<heysokam> its a great reference to imitate
18:58:34FromDiscord<heysokam> cargo is really well designed
18:59:02FromDiscord<Robyn [She/Her]> yeah :)
18:59:10FromDiscord<Robyn [She/Her]> also pretty, too
19:03:28*beholders_eye quit (Ping timeout: 260 seconds)
19:05:23*beholders_eye joined #nim
19:06:49FromDiscord<naitsabot> In reply to @nasuray "ignore the `src/` in": That seems to be it! ↔I cannot for the life of me figure out why I added it when initializing the project (part of my config) haha
19:41:15FromDiscord<randomstranger0812> Nim 3?↔Is that a Thing?
19:46:35FromDiscord<heysokam> In reply to @randomstranger0812 "Nim 3? Is that": https://github.com/nim-lang/nimony/blob/master/doc/differences.md
19:48:52FromDiscord<randomstranger0812> Oh vey
19:49:31FromDiscord<randomstranger0812> Just got used to 2.x
19:54:21FromDiscord<Robyn [She/Her]> In reply to @randomstranger0812 "Just got used to": Nim 3 shouldn't really have many differences
19:54:39FromDiscord<Robyn [She/Her]> It's moreso a rewrite of the current internals
20:22:16FromDiscord<griffith1deadly> plugins my beloved part
20:22:23FromDiscord<griffith1deadly> and not zero terminated strings
20:23:17FromDiscord<Robyn [She/Her]> Nimony is removing that? Why?↔(@griffith1deadly)
20:23:44FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=vmAjCVDg
20:24:01FromDiscord<griffith1deadly> (edit) "https://play.nim-lang.org/#pasty=wRsWPWIc" => "https://play.nim-lang.org/#pasty=fKRmbmzx"
20:24:47FromDiscord<griffith1deadly> i can make stringzilla native integration now (simd strings)
20:25:38FromDiscord<Robyn [She/Her]> Hm, fair point honestly↔(@griffith1deadly)
20:34:53FromDiscord<heysokam> What I read myself:↔> People misuse casting, so we are getting rid of the ergonomics of strings-cstrings altogether
20:35:05FromDiscord<heysokam> It feels like attacking the wrong problem
20:46:00*beholders_eye quit (Ping timeout: 252 seconds)
20:47:06FromDiscord<Robyn [She/Her]> I think some helpers may be introduced too, to prevent ppl abusing casting
20:47:18FromDiscord<Robyn [She/Her]> So seq char or seq byte to strings and vice versa, maybe
20:47:37*beholders_eye joined #nim
20:50:45FromDiscord<heysokam> If you wanted to write a CLI application that takes control of drawing in the entire as a framebuffer,↔do you guys know what I need to look up to learn how to do it without just spamming to stdout every frame?
20:58:17FromDiscord<Robyn [She/Her]> In reply to @heysokam "If you wanted to": Use std/selectors to poll for updates to the screen and only redraw when necessary
21:00:20FromDiscord<leorize> I like how you dream
21:00:33*amadaluzia_ joined #nim
21:01:09FromDiscord<Robyn [She/Her]> In reply to @leorize "I like how you": huh? :p
21:01:15FromDiscord<leorize> spamming to stdout is the name of the game, since that's the wire format
21:01:21FromDiscord<randomstranger0812> Isnt that what ncurses dods
21:01:29FromDiscord<Robyn [She/Her]> does this not work on Windows bc windows doesnt assign file descriptors for stdin/stdout?
21:01:29FromDiscord<leorize> you can't poll the terminal in almost all OS↔(@Robyn [She/Her])
21:01:40FromDiscord<Robyn [She/Her]> In reply to @leorize "you can't poll the": you can't poll stdin?
21:01:42*amadaluzia quit (Ping timeout: 276 seconds)
21:02:10FromDiscord<leorize> yep, because stdin is synchronous when attached to a terminal
21:02:41FromDiscord<Robyn [She/Her]> ah
21:24:06*andy-turner joined #nim
21:25:07*andy-turner quit (Remote host closed the connection)
21:25:25*andy-turner joined #nim
21:28:29*andy-turner quit (Client Quit)
21:55:24*beholders_eye quit (Ping timeout: 272 seconds)
21:56:51*beholders_eye joined #nim
22:03:37*amadaluzia_ quit (Quit: You)
22:52:07*beholders_eye quit (Ping timeout: 260 seconds)
22:54:04*beholders_eye joined #nim
23:53:57*beholders_eye quit (Ping timeout: 276 seconds)