<< 22-11-2025 >>

07:01:01FromDiscord<systemblue_2010> hey please help me how to use concept in nim
09:28:06*xet7 joined #nim
09:57:14FromDiscord<TӨMΛ ☠> Is there a way to efficiently sum all fields of such tuple? `tuple[L, LU, U, RU, R, RD, D, LD: int]`
09:57:41FromDiscord<TӨMΛ ☠> Or, at least to make it less code-clunky, like iterating over it?
09:57:47FromDiscord<tauruuuuuus> In reply to @afonso.lima "I was playing with": I was wondering the same a couple of days ago, I would love a flag that enforces it a compile time, or to just always enforce it when using case..of
09:57:48FromDiscord<TӨMΛ ☠> Also congrats Buckwheat 🥳
10:53:04*SchweinDeBurg quit (Quit: WeeChat 4.8.0-dev)
10:55:34*SchweinDeBurg joined #nim
11:26:42*beholders_eye joined #nim
11:52:56*xet7 quit (Remote host closed the connection)
11:57:24*SchweinDeBurg quit (Quit: WeeChat 4.8.0-dev)
11:57:34*SchweinDeBurg joined #nim
12:30:35FromDiscord<afonso.lima> sent a code paste, see https://play.nim-lang.org/#pasty=uEaRnJUB
12:36:04FromDiscord<afonso.lima> sent a code paste, see https://play.nim-lang.org/#pasty=ZZCBGAsB
13:00:51FromDiscord<lainlaylie> add that, along with strictDefs, to the list of flags that really should be on by default...
13:10:31*beholders_eye quit (Ping timeout: 264 seconds)
13:34:54*beholders_eye joined #nim
13:39:02*alexdaguy joined #nim
14:45:03FromDiscord<TӨMΛ ☠> sent a code paste, see https://play.nim-lang.org/#pasty=JkcpWqkN
14:45:47FromDiscord<TӨMΛ ☠> Sorry for a lot of commented out code, but it's quite a WIP file overall. No matter how much I tried to abstractify it, it repeats the same error pretty much
15:08:10FromDiscord<lainlaylie> isn't it because spawning a proc that returns void gives you a void, not a flowvar
15:08:44FromDiscord<lainlaylie> https://nim-lang.org/docs/manual_experimental.html#parallel-amp-spawn
15:08:59FromDiscord<lainlaylie> > spawn always takes a call expression of the form f(a, ...). Let T be f's return type. If T is void, then spawn's return type is also void, otherwise it is FlowVar[T].
15:09:25FromDiscord<mjsdev> Seems legit
15:11:37FromDiscord<lainlaylie> sent a code paste, see https://play.nim-lang.org/#pasty=QQSiALaA
15:13:39FromDiscord<n7itro> sent a code paste, see https://play.nim-lang.org/#pasty=xtwoPOxd
15:51:32*beholders_eye quit (Ping timeout: 265 seconds)
16:34:50FromDiscord<kiloneie> How come, error messages, have no syntax highlight ?
17:11:29*TheTechRobo quit (Quit: Ping timeout (120 seconds))
17:11:50*TheTechRobo joined #nim
17:39:56FromDiscord<lainlaylie> do other language compilers' error messages tend to have syntax highlighting?
17:46:54FromDiscord<mjsdev> I feel like that's mostly a Python thing? Wouldn't surprise me if Rust does it too, they love their highlighting.
17:54:12FromDiscord<mr_rowboto> In reply to @mjsdev "I feel like that's": Rust's error output is merry christmas.
17:54:45FromDiscord<mr_rowboto> I don't like rust at all, but given the syntax's complexity, one has to give it to them that their compiler's output is just great.
18:25:21FromDiscord<Buckwheat> @mr_rowboto hey you're the one who did that Futhark tutorial repo right?
18:28:54FromDiscord<mr_rowboto> 😄
18:28:56FromDiscord<mr_rowboto> yeah
18:29:08FromDiscord<mr_rowboto> In reply to @Buckwheat "<@176460389662457856> hey you're the": yeah
18:29:16FromDiscord<Buckwheat> small world! I literally just wrote a patch for Futhark yesterday to fix the build on FreeBSD
18:29:27FromDiscord<mr_rowboto> 😄
18:29:30FromDiscord<mr_rowboto> cool!
18:29:48FromDiscord<mr_rowboto> my tutorial is extremely simple tho
18:29:56FromDiscord<Buckwheat> I gotta test the build on OpenBSD soon too, and maybe on NetBSD, I imagine I might have to patch their builds too
18:29:56FromDiscord<mr_rowboto> it's aimed to total newbs like I was
18:30:07FromDiscord<Buckwheat> was still more concise to the majority of other tutorials out there↵(@mr_rowboto)
18:30:25FromDiscord<mr_rowboto> That was tha aim, to bootstrap anyone being hype concise.
18:30:33FromDiscord<Buckwheat> I don't think the one on the Futhark page is very good, which is a shame because Futhark's goal is smoothing out C/Nim interop
18:30:39FromDiscord<mr_rowboto> Mission accomplished then 🥹
18:30:57FromDiscord<Buckwheat> admittedly, I am a better C programmer than a Nim programmer, so... that probably did not help with the one on the Futhark page
18:31:11FromDiscord<mr_rowboto> In reply to @Buckwheat "I don't think the": Me neither, but don't tell PMunch hahaha
18:31:32FromDiscord<Buckwheat> trust me, I won't! I'll just quietly keep submitting any fixes I have for it
18:31:34FromDiscord<mr_rowboto> I mean futhark is GREAT, absolutely great. But I struggled quite a bit with the main page.
18:31:42FromDiscord<mr_rowboto> I ended up just reading someone elses code.
18:32:08FromDiscord<mr_rowboto> (edit) "elses code." => "else's code to understand how to make it work."
18:32:09FromDiscord<Buckwheat> yeah, and really I want to use Nim more, I mostly use Go and C, but I really like Nim for what it is and what it can do, but I always want my languages to have good C interop
18:32:37FromDiscord<mr_rowboto> In reply to @Buckwheat "trust me, I won't!": He'll probably read anyways, because he's here 😂
18:33:01FromDiscord<Buckwheat> ah... maybe then you and I should convince PMunch into letting us provide a more concise Futhark example?
18:33:05FromDiscord<mr_rowboto> In reply to @Buckwheat "yeah, and really I": loooool
18:33:13FromDiscord<mr_rowboto> That's was exactly my path.
18:33:24FromDiscord<Buckwheat> after I test OpenBSD to see if I need to fix up the build on that
18:33:34FromDiscord<Buckwheat> chances are, might be a similar patch to the one I wrote for FreeBSD
18:33:35FromDiscord<mr_rowboto> C is my favorite language, but I usually coded in C#
18:33:50FromDiscord<Buckwheat> my condolences, C# is pain, coming from someone who has a vague grasp on Java
18:33:52FromDiscord<mr_rowboto> Then one day I tried Rust, despised it... had an affair with Zig... then Go
18:34:04FromDiscord<mr_rowboto> and from Go I ended up here
18:34:05FromDiscord<Buckwheat> I'm not a Rust fan either, I think the language is snake oil
18:34:20FromDiscord<mr_rowboto> Go is good, but... constrained
18:34:31FromDiscord<mr_rowboto> I can't do anything besides "if (error )
18:34:36FromDiscord<mr_rowboto> (edit) ""if" => "`if" | ")" => "ble)`"
18:34:44FromDiscord<Buckwheat> I'm most comfortable with Go when it comes to high-level languages in all honesty
18:34:50FromDiscord<mr_rowboto> In reply to @Buckwheat "my condolences, C# is": Oh, it's not bad at all.
18:34:55FromDiscord<mr_rowboto> Java is much more painful than C#
18:34:56FromDiscord<mr_rowboto> By far.
18:35:01FromDiscord<Buckwheat> but it's probably because of how used I am to C that I like Go
18:35:12FromDiscord<Buckwheat> really easy for a C programmer to get into Go
18:35:13FromDiscord<mr_rowboto> C#'s interop would be best in class if nim didn't exist.
18:35:29FromDiscord<mr_rowboto> In reply to @Buckwheat "really easy for a": I can see why.
18:35:38FromDiscord<Buckwheat> I thought the only interop C# had was with PowerShell and I think VB?
18:35:45FromDiscord<mr_rowboto> Nooooo
18:35:53FromDiscord<Buckwheat> I know PowerShell has C# interop
18:35:55FromDiscord<mr_rowboto> It was built from the ground up to be able to interop with native stuff.
18:36:21FromDiscord<mr_rowboto> C# is great, a misunderstood beast.
18:36:26FromDiscord<Buckwheat> right, I never really tinkered with C# outside of Unity Engine
18:36:39FromDiscord<mr_rowboto> In reply to @Buckwheat "right, I never really": That's where I've used it the most.
18:36:50FromDiscord<Buckwheat> and my experiences with C# developers was mainly limited to uhh... skids, skids who thought they were John Carmack
18:37:02FromDiscord<mr_rowboto> But I have integrated C/C++ with it.
18:37:19FromDiscord<Buckwheat> seems that C#'s best suited for any sort of Game Dev, if you don't want to suffer the pains of C++↵(@mr_rowboto)
18:37:28FromDiscord<mr_rowboto> Exactly.
18:37:35FromDiscord<mr_rowboto> That's exactly the point.
18:37:47FromDiscord<Buckwheat> yeah and I think that's where it seems to shine best
18:38:03FromDiscord<mr_rowboto> "I want cache coherence, OOP and multiplatform... and a GC... and reflection..."
18:38:26FromDiscord<mr_rowboto> _no wonder why I ended up here_
18:38:36FromDiscord<Elegantbeef> > "\>and reflection↵> ↵↵Well buy a fucking mirror cause reflection is dumb \:P
18:38:52FromDiscord<mr_rowboto> _exactly the same, but without a vm, and with macros_
18:39:03FromDiscord<Buckwheat> heh, I think the reason I ended up with an interest in Nim was more due to my interests in reverse engineering↵(@mr_rowboto)
18:39:06FromDiscord<mr_rowboto> In reply to @Elegantbeef "> "\>and reflection >": It is.
18:40:03FromDiscord<mr_rowboto> The only times that I've used reflection were with stuff that couldn't be solved in any other way, and it actually pissed me off.
18:40:19FromDiscord<mr_rowboto> At least nim has this "compile time reflection" thing. Less stupid.
18:40:48FromDiscord<mr_rowboto> In reply to @Elegantbeef "> "\>and reflection >": Now that I think of this.↵SAYS THE GUY WHO BUILT HIS WHOLE ECS LIVE ON TOP OF COMPILE TIME REFLECTION :catbash:
18:40:56FromDiscord<mr_rowboto> (edit) "LIVE" => "LIB"
18:41:14FromDiscord<mr_rowboto> :catbash:
18:41:30FromDiscord<Buckwheat> also just the language itself fascinates me in that it's quite sugared up but produces really nice binaries
18:41:30FromDiscord<Buckwheat> not too heavy and quite performant
18:41:30FromDiscord<Elegantbeef> That's not reflection
18:41:31FromDiscord<Elegantbeef> Macros are not reflection!
18:41:46FromDiscord<mr_rowboto> In reply to @Elegantbeef "Macros are not reflection!": You are inspecting tuple NAMES
18:41:55FromDiscord<mr_rowboto>
18:42:01FromDiscord<Elegantbeef> Nah I'm writing custom compiler passes \:P
18:42:05FromDiscord<mr_rowboto> haha
18:42:19FromDiscord<mr_rowboto> Literally _inspecting and building types_
18:42:32FromDiscord<Buckwheat> I'm getting Primeagen vibes from this, guy discovers type safety, "I call it negative space programming!"
18:42:37FromDiscord<Elegantbeef> I do actually think that reflection should only refer to runtime introspection, but to each their own
18:43:06FromDiscord<Buckwheat> joking of course, I'm a literally who
18:43:25FromDiscord<mr_rowboto> In reply to @Elegantbeef "I do actually think": yeah, tbh I'm just joking
18:45:02FromDiscord<Buckwheat> should work on another project sometime, all of my stuff gets posted to my 2nd profile and I don't post anything to my main anymore
18:49:19*alexdaguy quit (Ping timeout: 240 seconds)
18:50:39FromDiscord<Buckwheat> maybe that's my fault for dividing my projects between 2 profiles
18:51:14*alexdaguy joined #nim
18:56:00*alexdaguy quit (Ping timeout: 252 seconds)
19:11:14FromDiscord<griffith1deadly> In reply to @Elegantbeef "Macros are not reflection!": it's introspection
20:01:36FromDiscord<mjsdev> _goes back to writing dynamic types_
20:02:33FromDiscord<russ4806> sent a long message, see https://pasty.ee/MYPTpKaA
20:03:48FromDiscord<russ4806> (edit) "https://pasty.ee/IfqAAQUp" => "https://pasty.ee/AyjOWTGg"
20:03:49FromDiscord<Buckwheat> going to presume you have the actual libcrypto DLL it's failing to load?
20:04:48FromDiscord<russ4806> Nope. I do not have it, nor do I want to have it. What surprised me was that I thought that `httpclient` with `-d:ssl` on Windows wouldn't need to dynamically link to anything.
20:05:35FromDiscord<russ4806> (Or at least not dynamically link to something that isn't a standard system DLL on Win10+)
20:06:24FromDiscord<Buckwheat> not exactly sure if Windows provides a system DLL for this, but also I'm curious what the constraint is that prevents you from using third-party DLLs
20:06:27FromDiscord<russ4806> (edit) "(Or at least ... notexpect" added "I did" | "dynamically link" => "expect it" | "something" => "require a DLL" | "isn't" => "does not exist as"
20:07:38FromDiscord<russ4806> My use case, by definition, is to be able to only require single files.
20:08:13FromDiscord<Buckwheat> that's a tough case on Windows, I hope you realize. unless you want to write your own libcurl.
20:08:28FromDiscord<russ4806> Or only those things that are on any system by default. `libcurl` is not one of these (e.g. Alpine Linux). I just tested windows and hit libcrupto.
20:09:43FromDiscord<russ4806> I certainly do not want to write libcurl. 😄 But... I'd be willing to write a barebones https fetcher with something like `Mbed-TLS`. Just trying to avoid it if I don't have to.
20:10:15*beholders_eye joined #nim
20:10:33FromDiscord<Buckwheat> more than likely with TLS on Windows regardless of the route you take, seems like you're going to need third-party libraries regardless
20:10:35FromDiscord<russ4806> The funny thing is that Puppy seems like it would be perfect... except for needing `libcurl` on Linux. I've not tested it on windows yet.
20:11:26FromDiscord<Buckwheat> at bare minimum, you could use OpenSSL, but again, that's a C library I'm certain so that complicates things
20:11:56FromDiscord<russ4806> In reply to @Buckwheat "more than likely with": Well that would be unfortunate. Not needed it so far on Linux. Only will if I switch to Puppy... which might possibly put me into a weird state where Linux is actually my problem case, and not Windows. 👀 ↵I'll test with puppy now to see if that is actually true.
20:12:22FromDiscord<Buckwheat> even then, the majority of Linux distros from what I know tend to package libcurl in them, but I can be very wrong
20:12:34FromDiscord<russ4806> In reply to @Buckwheat "at bare minimum, you": Alpine does not, so that knocks out most containers.
20:12:56FromDiscord<russ4806> Er.. wrong quote in response.
20:13:15FromDiscord<Buckwheat> even then, I'm sure Alpine does have it in its repos, positive of that
20:13:59FromDiscord<Buckwheat> a single requirement for a relatively niche Linux distro isn't the end of the world, especially since you're just asking for libcurl
20:14:45FromDiscord<russ4806> In reply to @Buckwheat "even then, I'm sure": It definitely does. But that would be a pre-condition for people to install to have my app work. Fails my one criteria of "works anywhere". 😄
20:15:00FromDiscord<russ4806> In reply to @Buckwheat "a single requirement for": Alpine is far from niche. It is, by far, the basis for most Docker containers.
20:15:15FromDiscord<Buckwheat> if your criteria is "works anywhere", should be writing in Java (semi-joking)↵(@russ4806)
20:15:36FromDiscord<Buckwheat> forgot the keyword of relatively in there↵(@russ4806)
20:15:49FromDiscord<russ4806> In reply to @Buckwheat "if your criteria is": Not if I add "compiled executable must be < 100 kB all-in, and have no additional dependencies". 😉
20:16:11FromDiscord<Buckwheat> then perhaps you need to pick up POSIX?
20:16:18FromDiscord<Buckwheat> though POSIX doesn't exactly work for Windows
20:16:38FromDiscord<Buckwheat> (but that's not the POSIX standard's fault, that's Microsoft's fault)
20:17:51FromDiscord<russ4806> Nim is perfect for it. Just need to get around this annoying SSL wrinkle. I looked at many options... C, C#, Go, Rust, etc. Entertained cosmopolitan as well... but that breaks under WSL so nope.
20:17:55FromDiscord<Buckwheat> either way, seems like you're going to have to do a lot of edge case testing, or you're gonna have to reinvent the wheel here
20:18:17FromDiscord<Buckwheat> POSIX is a standard, not a language↵(@russ4806)
20:18:52FromDiscord<Buckwheat> it's how you actually make software compatible across multiple platforms (primarily UNIX-based)
20:18:52FromDiscord<russ4806> We;ll see. I think it will be fine. Trying conditional use of puppy with windows, and `httpclient` with `-d:ssl` on Linux. Will report back.
20:19:28FromDiscord<russ4806> In reply to @Buckwheat "POSIX is a standard,": I wasn't going to comment on the "POSIX" thing. Figured someone else might. 😄
20:19:34*TheTechRobo2 joined #nim
20:19:59FromDiscord<Buckwheat> surprisingly it's not a thing people are aware of anymore, it's personally the basis of all the work I ever do↵(@russ4806)
20:20:50FromDiscord<russ4806> I try and stay posix compliant all the time... but... it's tough. Especially in shell scripts. Bashisms are too easy to reach for. 😒
20:21:01*TheTechRobo quit (Ping timeout: 264 seconds)
20:21:01*TheTechRobo2 is now known as TheTechRobo
20:21:05FromDiscord<Buckwheat> heh, that's where you gotta bring in the UNIX philosophy too ;D
20:21:42FromDiscord<russ4806> This whole nim project I'm doing is essentially that... doing one thing well (and not relying on anything else, to boot).
20:21:45FromDiscord<russ4806> Loving nim so far.
20:22:30FromDiscord<Buckwheat> Nim is a thing that I like as a tinker toy, and I only really use it for certain specific cases, but it's neat to work with and I like the tight knit community
20:23:05FromDiscord<Buckwheat> been a little motivated recently after my patch submission to Futhark to get more involved in helping out within the community
20:24:03FromDiscord<Buckwheat> should also swap the SSD in my Thinkpad to my OpenBSD one to do a quick build test there and see if I need to patch that up too, damn me and my laziness
20:27:07FromDiscord<russ4806> It is definitely niche, but absolutely perfect for what I want right now: a tiny piece of self-contained bootstrap code that I can easily cross-compile.
20:29:15FromDiscord<Buckwheat> fair enough I suppose. perhaps taking the time to learn something like CMake is a bit of an ask.
20:30:23FromDiscord<russ4806> it's way more than that. I'm fine with cmake. Nim is just too clean and perfect for a small task like mine. A great match. Now I've been looking for other such matches. 😄
20:31:23FromDiscord<Buckwheat> don't think that exists outside of Nim, I've yet to find ANYTHING remotely similar. most sugared syntax compiled languages aren't as slim
20:45:35FromDiscord<russ4806> Awesome... conditionally using puppy on windows, and `httpclient` with `-d:ssl` for non-Windows worked perfectly. 😄
20:45:58FromDiscord<russ4806> As an added bonus, the slightly bigger windows build snuck under 100 kB
20:46:42FromDiscord<wakanakisarazu> Nim is damn amazing
20:48:30FromDiscord<Buckwheat> glad you found a fix for that↵(@russ4806)
20:48:52FromDiscord<wakanakisarazu> Made a 18kb (optimized, compressed) init system in this bad boy. It is multi-lang, so we have some C as well, but not much. Nim's metaprogramming means it's so easy to grab hardware specs at compile time. ↵↵Like imagine, you detect hardware at compile time and mutate code paths to optimize the binary before it's even built, that's what I'm trying to do anyway. Nim gotta be my favourite language, wish it had more support
20:49:13FromDiscord<Buckwheat> it's definitely really neat for what it is, just a shame I can't personally come up with other use cases for it besides the hyperspecific one I use it for↵(@wakanakisarazu)
20:51:09FromDiscord<wakanakisarazu> In reply to @Buckwheat "it's definitely really neat": What do you mean, it has many uses, does it not?
20:51:19FromDiscord<Buckwheat> keyword is personally↵(@wakanakisarazu)
20:51:31FromDiscord<Buckwheat> as in, I don't have many uses for it besides a hyperspecific one
20:51:32FromDiscord<wakanakisarazu> I see
20:52:07FromDiscord<russ4806> sent a code paste, see https://play.nim-lang.org/#pasty=ezXRitMg
20:52:17FromDiscord<russ4806> (edit) "https://play.nim-lang.org/#pasty=QxgSxOEA" => "https://play.nim-lang.org/#pasty=SvjxfNwn"
20:52:32FromDiscord<Buckwheat> networking is one of those few use cases I use Nim for too↵(@russ4806)
20:53:29FromDiscord<mjsdev> sent a code paste, see https://play.nim-lang.org/#pasty=WkEVLVUd
20:54:44FromDiscord<Buckwheat> quite neat, never played a whole lot with web things in Nim
20:56:17FromDiscord<wakanakisarazu> In reply to @russ4806 "I have a couple": What I noticed about Nim is that the code isn't really the problem, but how many different libs and functions you use/import actually increases size, not just code density
20:56:19FromDiscord<mjsdev> I've only had to write an entire dynamic type system, a string evaluable scripting language, etc...
20:56:51FromDiscord<mjsdev> And yes, you can modify the templates without recompile
20:57:35FromDiscord<Buckwheat> that's probably also what makes it a little tricky for me to fully add Nim to my personal programming toolbox, and maybe also why my primary interest with Nim is in Futhark since I'd admittedly a more competent C programmer than I am a Nim programmer↵(@wakanakisarazu)
20:57:46FromDiscord<wakanakisarazu> In reply to @russ4806 "I have a couple": Http stuff is quite chunky. ↵↵The only reason my init system is so small (17-18kb at its absolute smallest) is because I use a lot of POSIX functions and low level bindings, also I spam lto and -O3/Os
20:57:49FromDiscord<russ4806> In reply to @wakanakisarazu "What I noticed about": Yep. The relocating that `-ffunction-sections -fdata-section` really helps improve dead code removal as well, if trying to cut size down to the bone. Wondering if anyone has any more size cutting success stories?
20:57:55FromDiscord<Buckwheat> since if I really need some more oomph in Nim, and it's something I can easily write in C, I can just do that and smooth the interop over with Futhark
20:58:46FromDiscord<wakanakisarazu> In reply to @russ4806 "Yep. The relocating": I have another one, disable the Garbage collector
20:58:53FromDiscord<Buckwheat> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1441895408304652439): that's probably also what makes it a little tricky for me to fully add Nim to my personal programming toolbox, and maybe also why my primary interest with Nim is in Futhark since I'm admittedly a more competent C programmer than I am a Nim programmer
20:58:56FromDiscord<wakanakisarazu> And disable panics/runtime checks
20:59:33FromDiscord<russ4806> Awesome. Trying those now (after I figure out the compiler switches :D)
21:00:01FromDiscord<russ4806> `--gc:none`
21:00:55FromDiscord<mjsdev> uhhh... unless you wrote your code without the garbage collector, you probably shouldn't disable the garbage collector
21:01:12FromDiscord<Buckwheat> that was pretty much the thing I was thinking
21:01:26FromDiscord<Buckwheat> I'm quite literally looking up as we speak how manual memory management works in Nim (never dug that deep)
21:01:33FromDiscord<russ4806> testing will tell! 😉 Had the wrong switch, though.
21:01:53FromDiscord<Buckwheat> ah, not much different from other languages' manual memory stuffs
21:02:20FromDiscord<Buckwheat> just means you have to double triple quadruple check you don't have any footguns when writing your code
21:03:18FromDiscord<Buckwheat> strangely though, if you dealloc a variable that's `nil`, it crashes, as opposed to how in C if you free anything that's `NULL`, it's perfectly fine
21:03:34FromDiscord<Buckwheat> wonder why that is?
21:03:54FromDiscord<mjsdev> You _may_ be able to get away with just using refc (which if I understand correctly does reference counting only)
21:04:26FromDiscord<russ4806> sent a code paste, see https://play.nim-lang.org/#pasty=ccTPdIBZ
21:04:27FromDiscord<Buckwheat> not entirely sure, I only ever do high-level things in high-level languages and keep my manual memory management to C
21:05:07FromDiscord<russ4806> I'm 100% sure reference counting will be fine in my use case. The app lifetime is short (usually). Not doing a tonne. But... will test once I figure out how to disable it.
21:05:12FromDiscord<Buckwheat> https://nim-lang.org/docs/mm.html↵I think this is what you're after? I could be wrong↵(@russ4806)
21:05:33FromDiscord<russ4806> In reply to @Buckwheat "https://nim-lang.org/docs/mm.html I think this": Thanks! That's perfect.
21:06:56FromDiscord<mjsdev> Well, if the app lifetime is short, you probably could just use no gc
21:07:03FromDiscord<mjsdev> just let it eat up all the memory then exit
21:07:30FromDiscord<Buckwheat> woohoo, memory leaks!
21:07:35FromDiscord<mjsdev> atomicArc is the only viable thing for the crazy stuff I'm doing...
21:07:56FromDiscord<mjsdev> In reply to @Buckwheat "woohoo, memory leaks!": It's hard to call it a "leak" if you never intended to free it up
21:09:42FromDiscord<Buckwheat> pfffff touche
21:10:45FromDiscord<russ4806> sent a code paste, see https://play.nim-lang.org/#pasty=wXYlBHsL
21:11:33FromDiscord<Buckwheat> that's probably the tax you have to pay when disabling that part of Nim, you may need to rewrite portions to allow manual memory management
21:12:08FromDiscord<russ4806> Also `markAndSweep` 😢
21:12:41FromDiscord<Buckwheat> probably not worth it to totally get all hung up about it either
21:13:07FromDiscord<Buckwheat> perfection isn't possible and you don't have to be John Carmack to write a fairly solid piece of software
21:13:23FromDiscord<Buckwheat> just matters that your solution sucks less than the alternatives ;D
21:16:24FromDiscord<russ4806> Totally worth it. `--mm=arc` saved me 1.6 kB on Linux, and 1 kB on Windows. HUUUUGE.
21:16:30FromDiscord<russ4806> I'm taking that win. Now to figure out how to disable panics/runtime checks (but I wonder if `-d:danger` does that already?)
21:17:07FromDiscord<Buckwheat> ...please do rigorous testing in Valgrind and a debugger before you ship it
21:18:11FromDiscord<russ4806> Not having the cycle collector is meh for me here. The app barely stays alive... but will be checking.
21:18:36FromDiscord<dromedariodechapeu> sent a code paste, see https://play.nim-lang.org/#pasty=mRcunQSF
21:22:44FromDiscord<russ4806> sent a code paste, see https://play.nim-lang.org/#pasty=bfeDHtUn
21:23:05FromDiscord<Buckwheat> can't really test this if we don't have the rest of the context like the CPU object↵(@dromedariodechapeu)
21:24:11FromDiscord<dromedariodechapeu> sent a code paste, see https://play.nim-lang.org/#pasty=OhMVAMAG
21:24:48FromDiscord<Buckwheat> yeah I think russ' solution might be the fix here, try that out
21:25:29FromDiscord<russ4806> In reply to @wakanakisarazu "And disable panics/runtime checks": Looking into this it seems like `-d:danger` does this... and I'm already doing it. Did I miss something?
21:26:57FromDiscord<demotomohiro> In reply to @dromedariodechapeu "i'm having problems with": `array[65536, string]` might causing stack over flow as it is `sizeof(string) 65536` is large.
21:28:57FromDiscord<demotomohiro> Maybe `array[65536, char]` or `array[65536, int8]` is what you actually want if you need an array of 1byte ints.
23:13:48*FromDiscord quit (Remote host closed the connection)
23:14:01*FromDiscord joined #nim