<< 26-05-2024 >>

00:05:50FromDiscord<Robyn [She/Her]> Definitely looks really nice
00:33:43FromDiscord<Robyn [She/Her]> Hey Beef does micros have anything for stripping out empty `PragmaExpr`s?
00:34:30FromDiscord<Robyn [She/Her]> I don't know why but whenever I touch macros, it has the issue of complaining about the pragma when I modify the AST
00:34:34FromDiscord<Elegantbeef> Nope
00:35:42FromDiscord<Robyn [She/Her]> Damn, can you at least tell me if this is actually a common thing and not me being an idiot?
00:36:10FromDiscord<Elegantbeef> Just do `name = name[0][0]` 😄
00:37:59*beholders_eye quit (Ping timeout: 252 seconds)
00:38:49FromDiscord<Robyn [She/Her]> Yeah that's what I'm doing, just was wondering if I did something weird to cause it
00:39:09FromDiscord<Elegantbeef> Type sections do not remove their `{..}`
00:39:38FromDiscord<Elegantbeef> You can get `name` using \`pragmaexprs
00:41:20FromDiscord<Robyn [She/Her]> Thanks Beef :)
00:44:28FromDiscord<Elegantbeef> Actually if you have a typedef you can change the name probably
00:44:45FromDiscord<Elegantbeef> if not PR welcome 😛
00:46:06FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Actually if you have": Yeah, that's what `micros/typedefs` has :)
00:50:58*def- quit (Quit: -)
00:52:29*def- joined #nim
01:00:01*nazgulsenpai quit (Quit: ZNC 1.8.2 - https://znc.in)
01:01:41*cnx quit (Ping timeout: 240 seconds)
01:02:58*nazgulsenpai joined #nim
01:03:16*cnx joined #nim
01:10:06*krux02_ quit (Remote host closed the connection)
01:29:28*lucasta joined #nim
01:42:21FromDiscord<Robyn [She/Her]> Random question: Where are examples of when concurrency could be useful in a parser?
01:44:42*rockcavera quit (Remote host closed the connection)
01:46:21*rockcavera joined #nim
01:49:30*def- quit (Quit: -)
01:49:56*def- joined #nim
02:02:29FromDiscord<that_dude.> sent a code paste, see https://play.nim-lang.org/#pasty=ZcTPYfUr
02:02:34FromDiscord<that_dude.> There is no way this could ever break
02:07:27FromDiscord<Robyn [She/Her]> In reply to @that_dude. "Thanks for the suggestions": No worries! But god that does not seem very future proof lmao
02:07:39FromDiscord<that_dude.> Lol
02:07:40FromDiscord<Robyn [She/Her]> I do recommend using inheritance or something to at least provide a structure
02:07:52FromDiscord<Robyn [She/Her]> That, or maybe custom pragmas with macros?
02:08:05FromDiscord<that_dude.> I went into the generated c files to reverse engineer the struct layouts to find the actual data buffers
02:08:17FromDiscord<that_dude.> Cus I just wanted to copy from one buffer to the other
02:08:34FromDiscord<Robyn [She/Her]> Lord that is an abomination of code
02:08:45FromDiscord<that_dude.> Lol
02:13:37FromDiscord<zumi.dxy> That's a lotta ~~damage~~ casts
02:14:12FromDiscord<zumi.dxy> More casts than someone with a broken leg
02:19:46NimEventerNew Nimble package! nim_lk - Nix lockfile generator, see https://git.sr.ht/~ehmry/nim_lk
02:55:24FromDiscord<amarevite> sent a code paste, see https://play.nim-lang.org/#pasty=GTwsYWQJ
02:55:53FromDiscord<Elegantbeef> object variants for heterogenous collections
02:58:26FromDiscord<Elegantbeef> https://internet-of-tomohiro.pages.dev/nim/faq.en#type-how-to-store-different-types-in-seqqmark
02:58:29FromDiscord<Elegantbeef> As I always link
03:09:42FromDiscord<amarevite> sent a long message, see https://pasty.ee/fRGSKova
03:13:15FromDiscord<stoneface86> sent a code paste, see https://play.nim-lang.org/#pasty=kZRqUoWo
03:21:59*lucasta quit (Quit: Leaving)
03:22:07FromDiscord<Elegantbeef> They probably want `[0i32, 0f32, "", true]` to work
03:22:11FromDiscord<Elegantbeef> Which mean use a tuple
03:23:52FromDiscord<stoneface86> ah
03:36:27FromDiscord<amarevite> i specifically need to process an arbitrary number of elements that are of those types (but not necessarily all of the same type)↵if tuples are what i need here, i havent used tuples in this way before↵can i take a variable length tuple as input and iterate over all the tuple elements?
03:37:25FromDiscord<Elegantbeef> take in a `tuple` and iterate it using `fields`
03:38:11FromDiscord<Elegantbeef> Scroll up and I did something similar
04:12:25*def- quit (Quit: -)
04:13:09*def- joined #nim
04:17:33*def- quit (Client Quit)
04:19:12*def- joined #nim
04:55:17*Guest27 joined #nim
04:55:32*Guest27 quit (Client Quit)
04:58:23FromDiscord<amarevite> this was exactly what i needed, thank you↵is there a way to enforce that the tuple only contains `OscData` fields or will i have to determine that inside the proc and throw an error if any of the fields are not of type `OscData`
04:58:31NimEventerNew thread by Niminem: Nim YT video about writing "Nim-less Nim", see https://forum.nim-lang.org/t/11648
05:02:03FromDiscord<Elegantbeef> `when field isnot ... : {.error: ....}`
05:02:50FromDiscord<Elegantbeef> You also could use a concept
05:02:57FromDiscord<Elegantbeef> But those are a bit experimental, though I love them
05:03:25FromDiscord<Elegantbeef> https://github.com/beef331/traitor/blob/master/traitor.nim#L99-L108 concept method
05:08:32*def- quit (Quit: -)
05:09:39*def- joined #nim
05:10:07FromDiscord<amarevite> i think thats over my head but it looks cool
05:10:15FromDiscord<amarevite> ill stick with `when field isnot`
05:12:30FromDiscord<Elegantbeef> Yea concepts are great they allow user defined duck typing and allow you to constrain types based off shapes
05:15:01*def- quit (Quit: -)
05:20:11*def- joined #nim
05:54:49*def- quit (Quit: -)
05:55:22*def- joined #nim
06:05:24*def- quit (Quit: -)
06:06:18*def- joined #nim
06:52:42*def- quit (Quit: -)
06:53:02*def- joined #nim
06:53:03NimEventerNew thread by mantielero: Issue with some C++ code that; maybe a bug?, see https://forum.nim-lang.org/t/11649
07:11:33*def- quit (Quit: -)
07:30:13*def- joined #nim
07:35:55*def- quit (Quit: -)
07:54:41*def- joined #nim
07:55:58*rockcavera quit (Remote host closed the connection)
08:10:56*marcus quit (Remote host closed the connection)
08:12:54*marcus joined #nim
08:37:42*rockcavera joined #nim
08:41:00NimEventerNew Nimble package! businessdays - Business Days (or Working Days) calculator., see https://github.com/GeK2K/businessdays
08:50:35*rockcavera quit (Remote host closed the connection)
08:59:36*dtomato quit (Quit: The Lounge - https://thelounge.chat)
09:01:35*dtomato joined #nim
09:08:55FromDiscord<ShalokShalom> best name ever
09:09:14FromDiscord<Elegantbeef> Rika deserves some credit
09:09:41FromDiscord<ShalokShalom> Good call, Rika 😄
09:11:08FromDiscord<ShalokShalom> Do you think its suitable, to transpile multiple dispatch to it?
09:11:08FromDiscord<ShalokShalom> I am currently looking for a way to translate such code to several languages, including Nim
09:11:10FromDiscord<Elegantbeef> Given that it only works with single `Atom` no
09:11:23FromDiscord<Elegantbeef> Unless you want `a, b: Traitor[...]`
09:13:02*xet7 joined #nim
09:13:20FromDiscord<goerge_lsd> who good with threads and stuff. Need to run various checksum algos at the same time (parallel), in single file read pass. A pattern like. - Read a work buffer. Let's say 64kB, and a bit ahead, so I don't waste time on disk read. Each thread get the new buffer data and calls the digest update function for that specific algo - when work is finished on all threads, they get the next piece of buffer, and more data is read from the disk to
09:13:47FromDiscord<goerge_lsd> weave/malebolgia/taskpool - or other? ( they say threadpool is deprecated)
09:14:27FromDiscord<goerge_lsd> Ideally threads should share the buffer, since it's read only, so no copying around
09:23:58FromDiscord<odexine> In reply to @ShalokShalom "Good call, Rika 😄": :ChiguPien: :ChiguPien: :ChiguPien: :ChiguPien: :ChiguPien: :ChiguPien:
09:24:20FromDiscord<odexine> Only thing I deserve credit for, ever, lol
09:26:09FromDiscord<goerge_lsd> Also, how do you signal this to the Thread without respawning it.. channels ?
09:27:10FromDiscord<goerge_lsd> (edit) "Also, how do you signal this to the Thread without respawning it.. channels ? ... " added "Thread needs to know address of new data to work on, main thread needs to know thread finished working."
09:27:35FromDiscord<Elegantbeef> Atomics are probably more sensible
09:28:33FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=wmYxFVer
09:28:39FromDiscord<Elegantbeef> atleast if we're using `createThread`
09:29:06FromDiscord<Elegantbeef> The solutions you brought up would make this easier afaik, but I do not multi thread
09:33:08FromDiscord<goerge_lsd> then how do you explain this @ElegantBeef https://github.com/beef331/nimtrest/blob/1d09e1e9044b0cc2dd9d3aa8768794272a842591/rcu.nim#L102
09:42:45FromDiscord<goerge_lsd> I guess the context data could live on the thread no problem, all it needs is the result to return. So the buffer is only thing that needs to be shared. Not very familiar with atomics, what does the bool signals here ?
09:42:55FromDiscord<tauruuuuuus> In reply to @isofruit "Define "evaluating". If you": Was trying to do something like https://media.discordapp.net/attachments/371759389889003532/1244224236227137629/image.png?ex=6654559e&is=6653041e&hm=a7c7b185507428cb416b49126cf67e2683993e8f73f27f669aa2e34be7d70a23&
09:43:26FromDiscord<tauruuuuuus> Or in general, reason with `static NimNode`s from untyped, I don't know if it makes sense
09:43:30FromDiscord<Phil> Show me how you planned on using that
09:43:37FromDiscord<tauruuuuuus> I'll do a gist
09:43:38FromDiscord<Phil> Note that inside a macro you don't use const
09:43:42FromDiscord<Phil> It is implicitly at compiletime
09:43:50FromDiscord<Phil> Similarly, procs working with nimnodes are implicitly only compiletime
09:43:57FromDiscord<tauruuuuuus> Give me one sec..
09:44:28FromDiscord<tauruuuuuus> In reply to @isofruit "Similarly, procs working with": I had a feeling it was like that since other stuff I did in the past worked implicitly like you're saying, maybe I'm reaching the limit of what I want to do
09:44:40FromDiscord<Phil> The macro disappears for the runtime, it is only used to generate code once and after that code has been vomitted out it is gone
09:45:59FromDiscord<Phil> Generally, you can regard it like so: The macro is a trigger / an entry point to your code-generation factory.↵It eats a NimNode and from there you just generate a NimNode to return (or you use that only to store the other NimNode in a compileTime-table somewhere).
09:46:21FromDiscord<Phil> (edit) "the other NimNode" => "data " | "somewhere)." => "somewhere for use with macros later)."
09:48:12FromDiscord<tauruuuuuus> Got it, let me give you a bit of context
09:48:13FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=RrhwuCNt
09:49:36FromDiscord<tauruuuuuus> So long story short, I don't know ho much embedded experience you have, but I have been working on a module for putting stuff in `progmem` sections by generating some code on gcc-platforms
09:50:39FromDiscord<tauruuuuuus> I have something working splendidly with macros and `quote do`, but I really like using macro-pragmas and wanted something that I could use like `let x {.progmem.} = ...`, I worked on it and I managed to make it work, but only with literals
09:51:26*deadmarshal_ quit (Remote host closed the connection)
09:51:47FromDiscord<Phil> In reply to @tauruuuuuus "So long story short,": I know nothing, but functionally for macro stuff you really don't need to know the specific usecase, rather you only need to know:↵1) What is the usage/input supposed to look like?↵2) What is the output supposed to look like?
09:51:54FromDiscord<Phil> So you want to pragma annotate assignments?
09:52:28FromDiscord<tauruuuuuus> Now I was interested in making it work also with some other stuff, mainly function calls of compile time stuff (staticRead...),and I was thinking of leveraging `parseStmt` for it, but it seems that it only works correctly when it is fed a `const` or compile-time provable stuff..as of now instead of expanding the staticRead output into the c-generated code, it literally expands "staticRead(...)"
09:52:41FromDiscord<tauruuuuuus> https://github.com/Abathargh/avr_io/blob/progmem-exp-non-literals/src/avr_io/progmem.nim#L342↵That is my current code
09:53:31FromDiscord<tauruuuuuus> https://media.discordapp.net/attachments/371759389889003532/1244226905603837963/image.png?ex=6654581a&is=6653069a&hm=886cf95c41862d0c411bcb40161883ce8830dc5aa114446dd7354f7bd4de2a49&
09:53:35FromDiscord<Phil> Show me what doesn't work
09:54:21FromDiscord<tauruuuuuus> This is a nim project using the linked code, giving that error https://media.discordapp.net/attachments/371759389889003532/1244227114626973738/image.png?ex=6654584c&is=665306cc&hm=7fbebe5c02358783cf7938f71fbac8d3fd2a6561d11c722a7540ad4202c4ff85&
09:54:42FromDiscord<odexine> This macro prolly ought to be typed
09:54:44FromDiscord<odexine> Not untyped
09:55:33FromDiscord<Phil> Do you expect staticRead("test.wav") to have been evaluated before it gets eaten by the macro?
09:56:38FromDiscord<Phil> Because this works, but the order of operations you want I don't think is possible.↵Macros go before source code evaluation afaik, even if it is compile-time source code.
09:58:26FromDiscord<Phil> Hm, you can make it work I guess, just not as part of an assignment like that
09:58:48FromDiscord<Phil> Oh hey, wait you can
09:59:12FromDiscord<Phil> It's more that you're hiding the assignment but you can force staticRead to be evaluated before the macro can eat it
09:59:20FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=cViSDOtz
10:02:05FromDiscord<Phil> Basically the above is still a literal assignment strictly speaking, you're just resolving staticRead into a literal string before the macro can catch it.↵Is that even remotely helpful to you? @tauruuuuuus
10:04:51*def- quit (Quit: -)
10:08:48FromDiscord<tauruuuuuus> So essentially this has to be changed into a typed macro, and then I can make do with treeRepr?
10:09:01FromDiscord<pmunch> In reply to @tauruuuuuus "I have something working": You might want to have a look at the progmem module in Ratel which does exactly this
10:09:06FromDiscord<tauruuuuuus> I think I hit the wall of my nim macro knowledge, never messed with typed macros..
10:09:38FromDiscord<Phil> Ah, no, typed is just sth I generally prefer
10:09:42FromDiscord<Phil> The above also works with untyped
10:09:59*deadmarshal_ joined #nim
10:10:21FromDiscord<Phil> In reply to @tauruuuuuus "I think I hit": Typed and untyped are pretty similar, typed just has the additional benefits that when you e.g. have typed, you now have sth called "Symnodes" where you can jump to the nimnode that is the type definition by using getImpl()
10:11:14FromDiscord<Phil> And more generlly it allows you to jump into the code-places where things are defined that your code-piece - that is eaten by the macro - uses.
10:13:45*xet7 quit (Ping timeout: 268 seconds)
10:14:54FromDiscord<tauruuuuuus> In reply to @pmunch "You might want to": Oh great, let's see if I can understand from the master himself! I'll take a look
10:16:00FromDiscord<tauruuuuuus> In reply to @isofruit "Typed and untyped are": I'll have to study that, thanks for the references..I really love this kind of level of control that macros give, it is for sure a leap in complexity tho
10:16:16FromDiscord<tauruuuuuus> I'll update you on what I manage to do
10:22:29*def- joined #nim
10:49:25*def- quit (Quit: -)
10:54:01*coldfeet joined #nim
11:07:22*def- joined #nim
11:37:41*coldfeet quit (Remote host closed the connection)
11:42:55*coldfeet joined #nim
11:47:25*def- quit (Quit: -)
11:47:41*def- joined #nim
11:53:04*coldfeet quit (Remote host closed the connection)
11:59:16*coldfeet joined #nim
12:02:09*coldfeet quit (Remote host closed the connection)
12:21:28*coldfeet joined #nim
12:33:06*coldfeet quit (Remote host closed the connection)
12:36:34*xet7 joined #nim
12:46:30FromDiscord<Robyn [She/Her]> Micros doesn't have a simple way to check if a procedure is exported, damn
12:46:43FromDiscord<Robyn [She/Her]> Gonna add that myself, then
12:46:48FromDiscord<Robyn [She/Her]> (edit) "procedure" => "type"
12:48:00FromDiscord<Robyn [She/Her]> Hey Beef, `exported` seems to be used already as a proc to create exported names, should I also name my proc `exported` since it has no params or do you have a different suggestion?
12:48:34FromDiscord<Robyn [She/Her]> `isExported` obviously looks ugly :P
12:51:34*def- quit (Quit: -)
13:00:56FromDiscord<Robyn [She/Her]> In reply to @isofruit "Typed and untyped are": Typed doesn't work on pragmas that modify a type definition though 😔
13:01:21FromDiscord<Robyn [She/Her]> It creates an error about a malformed AST because of an empty pragma expr
13:28:37*def- joined #nim
13:33:25NimEventerNew thread by throwaway567843: Nim Killer Fullstack App, see https://forum.nim-lang.org/t/11651
13:57:19*beholders_eye joined #nim
14:15:43*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
14:16:07*SchweinDeBurg joined #nim
14:16:44*coldfeet joined #nim
14:22:10*coldfeet quit (Remote host closed the connection)
14:22:38FromDiscord<ShalokShalom> I doubt that↵(@odexine)
14:22:52FromDiscord<odexine> bet? 1/2jk
14:26:27*beholders_eye quit (Read error: Connection reset by peer)
14:30:47FromDiscord<ShalokShalom> I am very sure.
14:32:08*beholders_eye joined #nim
14:32:35*def- quit (Quit: -)
14:34:00*def- joined #nim
14:39:15NimEventerNew Nimble package! gitty - Easily create .gitignore files from your terminal, see https://github.com/chrischtel/gitty
14:45:49*beholders_eye quit (Read error: Connection reset by peer)
14:46:27*def- quit (Quit: -)
14:47:14*def- joined #nim
14:47:24FromDiscord<Robyn [She/Her]> Time to make a git client in Nim called 'got'
14:47:31FromDiscord<Robyn [She/Her]> Or 'gottem' as the full name :)
14:51:43*beholders_eye joined #nim
15:00:07FromDiscord<saint.___.> In reply to @chronos.vitaqua "Time to make a": Haha
15:05:48*beholders_eye quit (Read error: Connection reset by peer)
15:09:00NimEventerNew thread by AntonioFS: Code correction in Visual Studio Code., see https://forum.nim-lang.org/t/11652
15:11:17*beholders_eye joined #nim
15:11:57*beholders_eye quit (Read error: Connection reset by peer)
15:17:37*beholders_eye joined #nim
15:19:04*rockcavera joined #nim
15:27:54*beholders_eye quit (Read error: Connection reset by peer)
15:34:05*beholders_eye joined #nim
15:40:44FromDiscord<saint.___.> @morgan How's the nim clap thing coming along?
15:44:23*def- quit (Quit: -)
15:46:27*def- joined #nim
15:49:23*def- quit (Client Quit)
15:50:24*def- joined #nim
15:51:37*beholders_eye quit (Read error: Connection reset by peer)
15:57:43*beholders_eye joined #nim
16:00:05*ntat joined #nim
16:10:09*coldfeet joined #nim
16:12:13*coldfeet quit (Remote host closed the connection)
16:29:37FromDiscord<morgan> In reply to @saint.___. "<@277133333773811712> How's the nim": nim clap as in the bindings is coming along well. offbeat which is my framework on top of it, im still struggling with gui lol, but it makes a usable plugin otherwise
16:47:19FromDiscord<saint.___.> In reply to @morganalyssa "nim clap as in": Oh wow, the framework is for making pluings?
16:47:37FromDiscord<saint.___.> (edit) "pluings?" => "plugins? Sorta like your own juce / iPlug?"
16:48:04*krux02 joined #nim
16:51:09FromDiscord<pmunch> Clap?
16:55:31FromDiscord<Robyn [She/Her]> All I know is that it's an audio related thing
17:22:17FromDiscord<morgan> In reply to @saint.___. "Oh wow, the framework": yea sorta like it. big thing is it handles everything for parameters for you. save/load, telling the daw about them, handling input events, optional smoothing, some callbacks related to smoothing
17:22:48FromDiscord<morgan> In reply to @pmunch "Clap?": an audio plugin format. if you've ever heard of vst, it's like that
17:44:47FromDiscord<Robyn [She/Her]> Hm, line 118 doesn't work but line 119 does? I don't understand why https://play.nim-lang.org/#pasty=ILtEkdxD
17:48:40*beholders_eye quit (Read error: Connection reset by peer)
17:49:57FromDiscord<serif7> Has anyone here used `winim`? I can't seem to find what should be commonly used functions like `SetCurrentDirectory()` or constants like `EXIT_SUCCESS`. There's no way they aren't in the library but VSCode doesn'
17:50:03FromDiscord<serif7> (edit) "doesn'" => "doesn't recognize them"
17:50:15FromDiscord<serif7> im searching the codebase right now for them
17:54:36*beholders_eye joined #nim
17:57:03FromDiscord<pmunch> In reply to @chronos.vitaqua "Hm, line 118 doesn't": They do different things?
17:57:32FromDiscord<pmunch> One line only goes one layer deep, while the other appears to go two
17:59:06FromDiscord<Robyn [She/Her]> Wait it is?
17:59:20FromDiscord<Robyn [She/Her]> I didn't realise oof, thanks for pointing it out
18:03:26FromDiscord<morgan> In reply to @morganalyssa "yea sorta like it.": basically right now, you define the parameters, the plugin info, do a few setup things, define the process callback, and it works. the framework handles any number of parameters with whatever settings and is pretty easy to use i think (although i will very likely change things as i get more in and work on it more)
18:05:55FromDiscord<morgan> params have two callbacks, one on the event value with the prototypical use of decibel conversion, and one after smoothing (and for lerp smoothing, only while it is interpolating) that can be used to set whatever user data, with the prototypical use being smooth filter coef changes
18:07:36FromDiscord<morgan> each of them has an example plugin (well the dsp and controls are the same)
18:08:13FromDiscord<morgan> offbeat's example is much smaller since it handles a ton for you, while nim-clap's is a fair bit longer
18:08:39FromDiscord<morgan> offbeat currently doesn't support synths yet tho, but it will eventually
18:09:58FromDiscord<morgan> so nim-clap can do whatever you want (assuming you only need implemented extensions) but you gotta do more work to do it, offbeat handles a lot for you, but you're limited by whatever it doesn't yet support
18:11:28FromDiscord<Elegantbeef> @goerge_lsd how do I explain what?
18:11:50FromDiscord<goerge_lsd> i linked some code of yours where you used threads, in reply that you don't thread : P
18:12:13FromDiscord<Elegantbeef> Notice how that's not a proper repo and just in my junk drawer
18:12:39FromDiscord<goerge_lsd> well, anyone around that does thread ? Otherwise I'll have to get unlazy and post on the forums for help
18:13:06FromDiscord<goerge_lsd> or any LLM that's good for nim ? : D
18:13:17FromDiscord<Elegantbeef> There are no good LLMs
18:13:22FromDiscord<Elegantbeef> For anything
18:13:35FromDiscord<griffith1deadly> cursor ide good for nim in pro version, but not ideal
18:14:25FromDiscord<Elegantbeef> Weave and malebolgia should be fine for your problem afaik
18:26:40*beholders_eye quit (Read error: Connection reset by peer)
18:28:41FromDiscord<ShalokShalom> Dont know about Nim, but Claude 3 Opus is a god send for me, its absolutely amazing.↵(@goerge_lsd)
18:28:41FromDiscord<ShalokShalom> Use it via the Cody extension for VSCode and pay for it. Free version is almost as good (Claude 3 Sonnet)
18:29:02FromDiscord<ShalokShalom> (use it with Julia)
18:31:41*def- quit (Quit: -)
18:32:09*def- joined #nim
18:32:29*beholders_eye joined #nim
18:32:46FromDiscord<tapeda> I'm suspicious how anyone I ever hear rave about LLM's for code when pressed on it have only used it for superficial boilerplate to save 30 keystrokes here and there
18:33:47FromDiscord<tapeda> Claude 3 is definitely great if you have arthritis and a walking cane and can't type fast anymore, even then it seems like it would get frustrating when you use your mic to dictate it to change a certain line and it just gives you the same code again again
18:35:03FromDiscord<serif7> Does anyone here write nim for windows?
18:35:50Amun-Ra(as a secondary target)
18:36:37FromDiscord<serif7> what does secondary target mean?
18:37:25Amun-Ratbh it's really quaternary/quinary
18:37:41Amun-Rait means I just test whether it compiler or not
18:37:48FromDiscord<serif7> Ah
18:38:01Amun-RaI support mainly Linux and oter POSIX compliant OS-es
18:38:08Amun-Raother*
18:38:29FromDiscord<serif7> What kind of code are you writing where it might compile in windows but you don't specifically write for it?
18:39:39Amun-RaI mean I tend to write OS independent code, I just don't use windows at all
18:40:03Amun-RaI run the code on wine and call it a day
18:43:08FromDiscord<serif7> Fair enough
18:43:47Amun-Ramy bigger project, the one I stated learning nim, is (not yet released) image/anim viewer
18:44:03Amun-Rait supports almost 300 image formats
18:44:34Amun-Rabiggest*
18:48:53FromDiscord<.lisuwu_> In reply to @serif7 "Does anyone here write": i do, i use it as main language really
18:49:18FromDiscord<.lisuwu_> and if i ever make new project, it's going to be in nim unless it's too inconvenient to use nim
18:49:28FromDiscord<.lisuwu_> (edit) "and if i ever make new project, it's going to be in nim unless it's too inconvenient to use nim ... " added "(for my small brain)"
18:50:24FromDiscord<serif7> oh thank god. Do you ever have issues with `winim`? I seemingly can't find common functions like `SetCurrentDirectory()`. I'm sure this is just my inexperience because there's no way it's not there
18:51:07FromDiscord<Robyn [She/Her]> Maybe that's because there's a function for that in `std/os`?
18:51:20FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "Maybe that's because there's": winim also has that
18:51:22FromDiscord<Robyn [She/Her]> (Note: I don't use or develop for WIndows at all)
18:51:25FromDiscord<.lisuwu_> In reply to @serif7 "oh thank god. Do": oh sorry but i don't really use `winim` package myself, i have only made OS-independent code
18:51:30FromDiscord<Robyn [She/Her]> (edit) "WIndows" => "Windows"
18:51:32FromDiscord<griffith1deadly> just need github search
18:52:37FromDiscord<serif7> I looked into that, not sure github supports it? Again I am probably wrong
18:53:05FromDiscord<serif7> I usually just download the repo and use ripgrep but im on windows and dont want to
18:55:49FromDiscord<.lisuwu_> @serif7 https://github.com/khchen/winim/blob/master/winim/inc/winbase.nim#L1925
18:56:27FromDiscord<.lisuwu_> it seems like the author has decided to put functions in nim files named after where it would be in C header, in this case SetCurrentDirectory is in winbase.h, so it is in inc/winbase.nim in winim
18:56:36FromDiscord<.lisuwu_> (edit) "winim" => "winim, could be useful to keep note of"
18:57:06FromDiscord<serif7> Thanks! I just figured out how to use code search as well
18:57:20FromDiscord<.lisuwu_> (edit) "SetCurrentDirectory" => "SetCurrentDirectory(A/W)"
18:58:12FromDiscord<serif7> for some reason VSCode still isn't picking it up
18:58:30FromDiscord<.lisuwu_> In reply to @serif7 "for some reason VSCode": did you restart VSCode after installing winim ?
18:58:47FromDiscord<.lisuwu_> well that might be dumb suggestion, but..
19:00:08FromDiscord<serif7> Yeah that's not it. Another odd thing is the simple hello world I did with `MessageBox` isn't working anymore
19:00:09FromDiscord<serif7> odd
19:00:52FromDiscord<.lisuwu_> yeah sorry, can't help with that then, never used winim myself
19:02:31FromDiscord<serif7> Damn. Thanks anyway
19:02:41FromDiscord<serif7> What OS independent code do you write?
19:03:29FromDiscord<.lisuwu_> some quick "tool"s,
19:03:59FromDiscord<.lisuwu_> some quick "tool"s, some servers for games, sometimes just coding random things for fun
19:04:50FromDiscord<.lisuwu_> boring stuff really
19:05:53FromDiscord<serif7> Gotcha
19:06:03FromDiscord<.lisuwu_> what do you usually code?
19:06:10FromDiscord<serif7> I'm glad you don't have to deal with the win32 api
19:07:25FromDiscord<serif7> In reply to @.lisuwu_ "what do you usually": networking stuff. It's for a job. I'm also thinking of making a game engine (but not a game. one rabbithole at a time)
19:07:38FromDiscord<Robyn [She/Her]> In reply to @serif7 "Yeah that's not it.": Are you using choosenim, by any chance?
19:08:20FromDiscord<Robyn [She/Her]> There's a known bug with ghost processes because of how it proxies the binaries, could be one reason why the LSP is bugging out?
19:08:24FromDiscord<serif7> Yeah, that's what I used. I read afterward that scoop might be better.
19:08:42FromDiscord<Robyn [She/Her]> Unfortunately the author of it has abandoned Nim so there's no fix
19:08:48FromDiscord<serif7> I didnt even know ghost processes were a thing
19:08:54FromDiscord<serif7> choosenim is abandonware?
19:09:05FromDiscord<Robyn [She/Her]> In reply to @serif7 "I didnt even know": I don't think I'm using the right term :P
19:09:58FromDiscord<Robyn [She/Her]> Basically, `LSP -> Choosenim Proxy Binary -> Nim Binary`, then the LSP crashes and the plugins kills the process spawned by it (`Choosenim Proxy Binary`) but `Nim Binary` is still running
19:10:05FromDiscord<Robyn [She/Her]> In reply to @serif7 "choosenim is abandonware?": I think it is, yeah
19:10:37FromDiscord<serif7> so should I uninstall and reinstall with some other method?
19:10:56FromDiscord<Robyn [She/Her]> Yeah, it might help with the LSP a bit
19:10:56FromDiscord<serif7> Is there a 'blessed' method for windows? the official docs said choosenim
19:11:39FromDiscord<Robyn [She/Her]> Don't think so, 'scoop' seems to be outdated too, unfortunately
19:11:49FromDiscord<serif7> christ
19:11:55FromDiscord<Robyn [She/Her]> I do all my dev in WSL anyway so I'm not much help, sorry
19:12:02FromDiscord<Robyn [She/Her]> (edit) "anyway" => "anyway,"
19:12:11FromDiscord<sOkam! 🫐> In reply to @serif7 "networking stuff. It's for": that second rabbit hole is actually a good reason to drive your engine into a very specific/narrow set of features, in order to scope-control its feature set, though 🤷‍♂️
19:12:28Amun-Raserif7: I played a little with winapi and used MessageBoxA successfully, but I always write my own bindings
19:12:57FromDiscord<sOkam! 🫐> even minimal engines are huge. so scoping down the features into a very specific game is actually really good
19:13:24FromDiscord<serif7> In reply to @chronos.vitaqua "I do all my": I should probably just use WSL
19:13:26FromDiscord<sOkam! 🫐> saves a lot of dev time, that would otherwise be spent coding things "just in case I/someone needs them"
19:13:42FromDiscord<sOkam! 🫐> and are never used
19:13:45FromDiscord<serif7> but I need my code to work with the native API so idk if that's even a good option
19:14:17FromDiscord<.lisuwu_> In reply to @serif7 "Is there a 'blessed'": i never had issue with downloading binaries directly, might wanna do same
19:14:22FromDiscord<serif7> In reply to @heysokam "that second rabbit hole": I'll keep this in mind. This is a bucket list project for me and I should probably scope it small so it actually happens at some point
19:14:46FromDiscord<.lisuwu_> (edit) "issue" => "issues" | "issueswith downloading ... binaries" added "and using"
19:15:02FromDiscord<sOkam! 🫐> In reply to @serif7 "I'll keep this in": yeah definitely. just have an idea, even if you don't necessarily start it per se. otherwise you will end up coding things that the game doesn't need
19:15:53FromDiscord<.lisuwu_> (edit) "might wanna do same" => "i think you'll be able to use it just fine this way"
19:16:14FromDiscord<sOkam! 🫐> "game without an engine" type of mindset is the best strat for this, imo↵you end up making an engine, but the most minimal one possible
19:16:26FromDiscord<serif7> In reply to @.lisuwu_ "i never had issues": ok, gotta figure out how to uninstall choosenim (I hate windows...)
19:21:46FromDiscord<serif7> I think I can just change my vscode settings to use a manually installed binary
19:22:50FromDiscord<Robyn [She/Her]> https://play.nim-lang.org/#pasty=pgulQHCv I can't figure out what to do with this to get it to work, I would've thought this would allow me to get the enum type and stuff, but seems like I was wrong?
19:26:11FromDiscord<danielsokil> sent a code paste, see https://play.nim-lang.org/#pasty=EmrTmvBJ
19:26:22FromDiscord<demotomohiro> In reply to @serif7 "Yeah that's not it.": Any windows apis that takes strings have `A` or `W` prefix.↵So you probably need to add these prefix when you search or call a function.
19:28:04FromDiscord<serif7> this is giving me an aneurysm
19:28:28Amun-Ra yes, FooBar is just a define for FooBarA or FooBarW depending on whether unicode is set or not
19:29:10FromDiscord<serif7> this is the thing I hate the most about windows, uninstalling anything is a goose hunt
19:29:16FromDiscord<serif7> I may just use linux...
19:29:37FromDiscord<serif7> Use a virtual machine or wine for testing
19:32:23Amun-Rayou can always call A ones for US-ASCII strings
19:32:53Amun-Rafor W ones you have to tinker with dreader WideStrs
19:33:00Amun-Raded*
19:34:08FromDiscord<danielsokil> sent a code paste, see https://play.nim-lang.org/#pasty=mGUIyzTS
19:35:56FromDiscord<Robyn [She/Her]> In reply to @chronos.vitaqua "https://play.nim-lang.org/#pasty=pgulQHCv I can't f": Hey Beef, any clue why I can't access `MOptionKind` (generated from the type def)?
19:40:07FromDiscord<serif7> Ok new question, does anyone here use nim on NixOS?
19:44:24FromDiscord<Elegantbeef> @Robyn [She/Her] what's with the AST you emit?
19:44:38FromDiscord<Elegantbeef> Like you do not emit a case object
19:48:49FromDiscord<huantian> In reply to @serif7 "Ok new question, does": Yes but not recently
19:49:48FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Like you do not": Still implementing it
19:50:01FromDiscord<Robyn [She/Her]> But just was testing as I was going
19:50:21FromDiscord<Elegantbeef> This might be an issue with generics since the scope is not instantiated
19:51:26FromDiscord<Robyn [She/Her]> I don't get what you mean exactly, do you mean like, `MOption[T]` means the actual body isn't created until you create generic with that type?
19:51:33FromDiscord<Elegantbeef> Probably
19:51:45FromDiscord<Robyn [She/Her]> Ughhh... All my plans are gone
19:52:08FromDiscord<Elegantbeef> I mean it's easy enough to test, remove the incorrect body from the generic
19:53:04FromDiscord<Elegantbeef> Worth noting that you now can return a single type section in type section macros iirc
19:54:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=bNePINGq
19:54:34FromDiscord<Elegantbeef> With the enum added before `None`
19:54:42FromDiscord<Elegantbeef> As an aside I do appreciate you naming it `spore`
19:54:59FromDiscord<Phil> In reply to @tapeda "I'm suspicious how anyone": Seriously, that's the big draw for me. It saves me typing out those 5-15 lines of code every time.↵And that adds up to the point you start greatly appreciating it.↵Particularly if you're in an environment with boilerplate-y code here or there (in exchange for great flexibility etc.) it reduces the need to write the boilerplate yourself
19:55:11FromDiscord<Phil> (edit) "draw" => "pull"
19:56:09FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "I mean it's easy": I don't get what you mean exactly? My brain is mush
19:56:21FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "As an aside I": The lib was gonna be called `cordyceps` 😔
19:56:29FromDiscord<Robyn [She/Her]> Because `skinsuit` and `fungus`
19:56:52FromDiscord<cheatfate> In reply to @danielsokil "Trying to use nimcrypto,": I think you forgot to import algorithm itself while importing only bcmode.nim
19:57:04FromDiscord<Elegantbeef> iirc you can turn `type Option[T] {.spore.} = ...` into the above typesection
19:57:27FromDiscord<cheatfate> (edit) "bcmode.nim" => "bcmode.nim, there is present an example of ECB usage."
19:57:38FromDiscord<cheatfate> (edit) "usage." => "usage - examples/ecb.nim"
19:58:31FromDiscord<Elegantbeef> So you do not need to do this type hiding for anything but procs
20:02:01FromDiscord<Robyn [She/Her]> Aaah okay, I'll try that
20:02:01FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=mvZBNUvE
20:02:04FromDiscord<Elegantbeef> It's hastily done
20:02:56FromDiscord<Elegantbeef> But yea
20:02:56FromDiscord<Elegantbeef> Also will say if you want to PR this to fungus and micros it'd be good
20:03:32FromDiscord<Elegantbeef> If you want to use the CacheTable I use and add the type there and fit my "spec" you can just make a submodule and call it a day
20:03:55FromDiscord<Elegantbeef> As long as you have a field named `kind` and are in the fungus table you should be fine iirc
20:04:43FromDiscord<Elegantbeef> https://github.com/beef331/fungus/blob/master/src/fungus.nim#L78-L79
20:05:50FromDiscord<Elegantbeef> Basically for your type here iirc it's `(Option, [NoneKind, SomeKind], [None, Some], ["", "SomeData"]`
20:06:43FromDiscord<Elegantbeef> If you are wondering why you'd want to do that, you get acces to `from`, `match`, `adtEqual`, `$`
20:07:04FromDiscord<Elegantbeef> All with no cost to you and a low repeated payment of 29.99
20:07:22FromDiscord<Elegantbeef> Of course you do not even need to PR to fungus to enable that
20:07:43FromDiscord<Elegantbeef> You could have a `cordycepsSubscribeToFungus` flag which does that
20:08:42FromDiscord<Robyn [She/Her]> It works :)
20:09:30FromDiscord<Elegantbeef> I also highly suggest marking everything as exported
20:10:07FromDiscord<Elegantbeef> More often than not someone will want the types exposed
20:10:28FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "I also highly suggest": I was planning on exporting the type if the user marks their type as exported, that way I have the intended semantics
20:10:31FromDiscord<Elegantbeef> So it makes a lot more sense to always export
20:10:42FromDiscord<Robyn [She/Her]> I was planning on making a PR to `micros`
20:10:42FromDiscord<Elegantbeef> I guess that works
20:10:57FromDiscord<Elegantbeef> I did not have the ability to do that with fungus for obvious reasons
20:12:03*ntat quit (Quit: Leaving)
20:13:11FromDiscord<Elegantbeef> Well when you publish your repo I'll probably archive fungus 😛
20:15:47FromDiscord<Robyn [She/Her]> Damn, a lib of mine actually replacing Beef's lib? Damn
20:16:18FromDiscord<Robyn [She/Her]> Though, in my lib I should prolly disallow inheritance of objects
20:17:38FromDiscord<danielsokil> sent a code paste, see https://play.nim-lang.org/#pasty=JHHjpLZh
20:18:15FromDiscord<danielsokil> (edit) "https://play.nim-lang.org/#pasty=gMSwKBAB" => "https://play.nim-lang.org/#pasty=XIUHuuPw"
20:18:53FromDiscord<danielsokil> Such a relief
20:18:58FromDiscord<danielsokil> (edit) "relief" => "relief, lol"
20:19:14FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "So you can probably": Will this also always expose `init` though?
20:40:17NimEventerNew thread by Cnerd: Proc inheritance for distinct type in Nim 2.0.0, see https://forum.nim-lang.org/t/11654
20:41:54FromDiscord<danielsokil> Has anyone recreated the golang `defer` as a macro in Nim?
20:43:59FromDiscord<demotomohiro> I don't know what golang `defer` do, but Nim has `defer` statement: https://nim-lang.org/docs/manual.html#exception-handling-defer-statement
20:44:16*Jhonny2x4 quit (Quit: Jhonny2x4)
20:44:31*Jhonny2x4 joined #nim
20:44:35*Jhonny2x4 quit (Client Quit)
20:44:45FromDiscord<danielsokil> Oh nice, did not know Nim had it, does exactly what go does.
20:44:56FromDiscord<danielsokil> So clean open/close io near each other
20:45:22FromDiscord<Elegantbeef> even cleaner to use destructors
20:45:26FromDiscord<danielsokil> sent a code paste, see https://play.nim-lang.org/#pasty=iahBmfac
20:45:26*Jhonny2x4 joined #nim
20:45:33FromDiscord<danielsokil> In reply to @Elegantbeef "even cleaner to use": link?
20:46:07FromDiscord<Elegantbeef> Nim 2.0 has destructors one can define in the module they define it means you do not need to manually manage resources
20:46:08FromDiscord<Elegantbeef> Most of the stdlib does not use them
20:46:09FromDiscord<Elegantbeef> https://nim-lang.org/docs/destructors.html
20:48:33FromDiscord<tapeda> In reply to @isofruit "Seriously, that's the big": That's fair, in this sense it's like a slightly semantically-ambiguous clipboard.. Still doesn't exactly feel like a revolution(Though this may be a interface problem more than anything, chat and autocomplete seem like the mvp more than the best possible ux)
20:51:49FromDiscord<Phil> Personally, given where the tech is at, I think autocomplete is the best usecase currently.↵At least for coding.↵For anything more expansive the thing would need to be vastly more reliable and produce vastly more consistent readable quality
20:51:55FromDiscord<Phil> And that is just not in the cards right now
20:52:40FromDiscord<Phil> I agree though that it isn't really a revolution at the moment, just an improvement
20:53:25FromDiscord<danielsokil> In reply to @Elegantbeef "Nim 2.0 has destructors": Could you show a practical example, socket closing, etc
20:54:39FromDiscord<Elegantbeef> I mean you cannot use it with sockets cause the stdlib didn't use them
20:54:46FromDiscord<danielsokil> In reply to @danielsokil "Could you show a": Ah makes sense
20:54:57FromDiscord<danielsokil> The `=destroy` hook seems useful, for custom data structures
20:55:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=QTPkiQdw
20:55:39FromDiscord<Elegantbeef> Probably would want to disable `=copy` and `=sink`
20:55:52FromDiscord<Elegantbeef> But yes the stdlib should use it
20:55:59FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Most of the stdlib": Stdlib rewrite time? /j
20:56:55FromDiscord<Robyn [She/Her]> Oh Beef, what would `unpack` do on something declared as `void`?
20:57:09FromDiscord<Elegantbeef> `discard`
20:57:30FromDiscord<Robyn [She/Her]> I feel like that'd cause issues, wouldn't an explicit error be better?
20:57:51FromDiscord<Elegantbeef> I mean depends what you do
20:57:52FromDiscord<Robyn [She/Her]> `SporeUnpackDefect` or something?
20:58:10FromDiscord<Elegantbeef> `option.unpack(someProcThatTakesInX)` should work
20:58:16FromDiscord<Elegantbeef> shouldn't work\
20:58:25FromDiscord<Elegantbeef> `option.unpackIt(it.doThing())` should work fine
20:58:57FromDiscord<Robyn [She/Her]> Wait this is a non-issue
20:59:16FromDiscord<Elegantbeef> It is still a type, so yes not much of a problem
20:59:19FromDiscord<Robyn [She/Her]> Wouldn't `unpack` return `Some[int]` from `Option[int]`?
20:59:27FromDiscord<Robyn [She/Her]> And same with `None`?
20:59:58FromDiscord<Elegantbeef> No unpack cannot return a runtime delimited value
21:00:03FromDiscord<Elegantbeef> It makes a case statement and dispatches
21:00:38FromDiscord<Robyn [She/Her]> I'm struggling to phrase my thoughts hold on
21:00:44FromDiscord<Elegantbeef> `unpack` should likely call a proc with T from `Name: T`
21:00:51FromDiscord<Elegantbeef> Or with the branch type
21:01:17FromDiscord<danielsokil> Do we have Option type builtin?
21:01:43FromDiscord<Elegantbeef> `std/options`
21:02:02FromDiscord<Elegantbeef> If you want to consider that built in, sure
21:02:03FromDiscord<Elegantbeef> I don't
21:02:33FromDiscord<danielsokil> In reply to @Elegantbeef "If you want to": Def does not have first class support
21:02:34FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=xnYozpra
21:02:53FromDiscord<Elegantbeef> That does not work robyn
21:02:59FromDiscord<Elegantbeef> Cause the branches return different types
21:03:05FromDiscord<Robyn [She/Her]> Oh
21:03:11FromDiscord<Elegantbeef> `unpack` has to emit a case statement that operates on the data
21:03:17FromDiscord<Robyn [She/Her]> So then `unpack` will call a proc, as you said then
21:03:25FromDiscord<Elegantbeef> It makes more sense to do`unpackIt`
21:03:36FromDiscord<Elegantbeef> `unpack` does not make sense either cause the proc is different per branch 😄
21:03:52FromDiscord<Elegantbeef> `option.unpackIt(someProc(it))` is the only thing that makes sense
21:04:00FromDiscord<Robyn [She/Her]> I thought that would've worked in a template though
21:04:07FromDiscord<Elegantbeef> Unless you make `option.unpack(bleh)` a template that does `bleh(it)`
21:04:14FromDiscord<Elegantbeef> No cause the type system is still branched at runtime
21:04:22FromDiscord<Elegantbeef> > Def does not have first class support↵What does this even mean
21:06:05*def- quit (Quit: -)
21:06:39FromDiscord<danielsokil> In reply to @Elegantbeef "> Def does not": Can I wrap a function that could throw an error into an Option, or Either?
21:07:03FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "No cause the type": Ah okay then
21:07:52FromDiscord<Robyn [She/Her]> `unpackIt` it is, but I don't know how those templates work so I'm gonna need to figure it out
21:08:14FromDiscord<Elegantbeef> You could very easily
21:08:17FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=sPYOxbfy
21:08:20FromDiscord<Elegantbeef> Whoops
21:08:22*def- joined #nim
21:08:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=ofPeGUbZ
21:09:15*lucasta joined #nim
21:09:29FromDiscord<danielsokil> Big fan of https://fsharpforfunandprofit.com/posts/recipe-part2/
21:11:17*def- quit (Client Quit)
21:11:26FromDiscord<danielsokil> sent a code paste, see https://play.nim-lang.org/#pasty=YXIdwdqv
21:11:55FromDiscord<Elegantbeef> It is look at the results package in the nimble registry
21:12:07FromDiscord<Elegantbeef> Though I think it's pointless to go from exceptions to results
21:12:14FromDiscord<Elegantbeef> But no one asked so I'll sit on my hands
21:12:25*def- joined #nim
21:12:38FromDiscord<Robyn [She/Her]> In reply to @danielsokil "Can I wrap a": There's no `Either` in the stdlib, so you'll want to rely on the `results` package aha
21:14:51FromDiscord<danielsokil> In reply to @Elegantbeef "Though I think it's": I just find it cleaner to return `Result[SuccessReturnType, ErrString]`
21:15:22FromDiscord<Elegantbeef> I find both noisy, and find that exception tracking less obtrusive 😄
21:15:57FromDiscord<Elegantbeef> Nim has one thing over every other exception based language that I know of, it has exception tracking and you can force exceptions to be handled
21:16:01FromDiscord<Robyn [She/Her]> In reply to @danielsokil "I just find it": Enums would be more useful as an error return type
21:16:20FromDiscord<Elegantbeef> Robyn do you mean enums or "enums"
21:16:23FromDiscord<Robyn [She/Her]> Especially with sum types :)
21:16:30FromDiscord<Robyn [She/Her]> (edit) "Especially with" => "Or rather,"
21:16:31FromDiscord<danielsokil> In reply to @Elegantbeef "Nim has one thing": Compiler switch to enforce?
21:16:33FromDiscord<Elegantbeef> Fuck robyn means "enums"
21:16:38FromDiscord<Robyn [She/Her]> Lmao
21:16:41FromDiscord<Robyn [She/Her]> Sum types are great
21:16:43FromDiscord<Elegantbeef> Not even a compiler switch
21:16:50FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=OTruFLFA
21:17:05FromDiscord<Elegantbeef> That forces you to handle all exceptions that procedures inside main calls
21:17:18FromDiscord<Elegantbeef> Keep applying that down the tree until you handled all exceptions you want to
21:17:23FromDiscord<danielsokil> Yes, but when I call file.open, it does not force me to handle the error
21:17:25FromDiscord<Elegantbeef> Sumtypes are great but don't call them enums
21:17:31FromDiscord<Elegantbeef> I refuse to call them enums
21:17:40FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Sumtypes are great but": That's why I'm saying sum types
21:17:57FromDiscord<Elegantbeef> Sure it does not force you, if you want code to be error free mark them `{.raises: [].}` 😄
21:18:17FromDiscord<danielsokil> In reply to @Elegantbeef "Sure it does not": Mark what exactly?
21:18:56FromDiscord<danielsokil> sometimes it's not clear if an stdlib proc will throw or is pure
21:19:47FromDiscord<sOkam! 🫐> @danielsokil #1 award for nickname closest to mine ever, lol. you even did the O thing too!
21:19:52FromDiscord<Elegantbeef> You can even do `{.push, raises: [].}`
21:19:59FromDiscord<Elegantbeef> So the entire module forces you to have no raises
21:20:01FromDiscord<Elegantbeef> I have the dumb view that errors are procedure bound and not type bound 😄
21:20:10FromDiscord<Elegantbeef> All procedures
21:20:14FromDiscord<danielsokil> In reply to @heysokam "<@413289167007514624> #1 award for": I'm an undercover bot
21:20:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=jAEOdCKS
21:20:54FromDiscord<danielsokil> sent a code paste, see https://play.nim-lang.org/#pasty=sqRKVeOO
21:21:18FromDiscord<Elegantbeef> It is cause Nim rightly does exception tracking
21:21:42FromDiscord<danielsokil> Dam, that is greatttttt https://media.discordapp.net/attachments/371759389889003532/1244400089699581982/Screenshot_from_2024-05-26_17-21-23.png?ex=6654f965&is=6653a7e5&hm=6e6793d760ab2e713b2a2e877f8f777e0785a82a9ba6a2a52652007adb5a7471&
21:21:49FromDiscord<Elegantbeef> It also has effect tracking so you can even mark procedures with your own custom effects and prevent it
21:22:12FromDiscord<Elegantbeef> So you could do like `forbids: [IoSideEffect]`
21:22:18FromDiscord<Elegantbeef> And then you could not have any IO in a procedure
21:22:40FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#effect-system all documented here
21:22:40FromDiscord<danielsokil> Yes, I want to write Haskell code in Nim, hahahahaa
21:23:12FromDiscord<danielsokil> Could I enforce `{.push raises: [].}` as a compiler flag? For all modules?
21:23:33FromDiscord<Elegantbeef> You could but then any thing that relies on the stdlib surely would not compile
21:23:45FromDiscord<danielsokil> Pls
21:23:48FromDiscord<Elegantbeef> It would not be a compiler flag
21:24:09FromDiscord<Elegantbeef> it'd be `--include: file` and your file would be `{.push raises: [].}`
21:24:26FromDiscord<danielsokil> That works
21:24:50FromDiscord<Elegantbeef> Plus it means you cannot write any code which raises without a `{.pop.}`
21:24:51FromDiscord<Elegantbeef> "But I never want exceptions"
21:25:04FromDiscord<Elegantbeef> The issue like i said is you would not be able to use any of the stdlib
21:25:20FromDiscord<danielsokil> Why not, just handle the exceptions, no?
21:25:21FromDiscord<Elegantbeef> Hell `system` probably does not compile
21:26:07FromDiscord<Elegantbeef> cause procedures like `open` exist
21:26:45FromDiscord<danielsokil> So they won't compile, even If I don't use them?
21:27:06FromDiscord<Elegantbeef> Well yea Nim is statically checked
21:27:16FromDiscord<Elegantbeef> It's not like Zig where only used symbols are semantically checked
21:27:19FromDiscord<Elegantbeef> Cause that's bad
21:27:42*def- quit (Quit: -)
21:28:08*def- joined #nim
21:28:12FromDiscord<danielsokil> In reply to @Elegantbeef "it'd be `--include: file`": I'm assuming this could be done with `nim.cfg`
21:28:19FromDiscord<Elegantbeef> Well `config.nims`
21:28:21FromDiscord<Elegantbeef> But yes
21:29:18FromDiscord<Elegantbeef> Generally nim.cfg is only really used for local configs faik
21:29:44FromDiscord<Elegantbeef> But yea even system likely won't compile
21:29:50FromDiscord<Elegantbeef> Surely something raises an exception in there
21:30:16FromDiscord<danielsokil> In reply to @Elegantbeef "Well `config.nims`": Close enough, I haven't messed with Nim, since v1.2
21:31:48FromDiscord<danielsokil> In reply to @Elegantbeef "Well `config.nims`": That works:↵switch("include", "src/base.nim")
21:32:45FromDiscord<danielsokil> I see what you mean, libs I depend on also won't compile
21:32:58FromDiscord<danielsokil> If they don't handle all exceptions
21:33:10FromDiscord<Elegantbeef> You can just do `--include:"src/base.nim"` 😉
21:33:21FromDiscord<Elegantbeef> Sometimes I do not speak out my arse
21:34:09FromDiscord<danielsokil> So what is the alternative solution?
21:34:25FromDiscord<Elegantbeef> Put that in any file you want to handle all the exceptions in
21:35:04FromDiscord<Elegantbeef> Exceptions bubble up so it's not like an exception will not be caught
21:35:17FromDiscord<danielsokil> ah, so the {.push raises: [].} also applies for deps?
21:35:24FromDiscord<Elegantbeef> No
21:35:41FromDiscord<Elegantbeef> It only applies to your code
21:35:56FromDiscord<danielsokil> In reply to @danielsokil "ah, so the {.push": Well I'm getting a compiler error from a dep
21:35:58FromDiscord<Elegantbeef> But since code you depend upon raises, you will get an error where it raises and you can handle it
21:36:18FromDiscord<Elegantbeef> Exceptions are bubbled up so it retroactively works with deps cause they can raise and do not handle them
21:38:04FromDiscord<danielsokil> sent a code paste, see https://play.nim-lang.org/#pasty=UePZJCev
21:38:41FromDiscord<danielsokil> https://github.com/enthus1ast/nimIpAddresses/blob/master/ipAddresses.nim#L42
21:38:55FromDiscord<Elegantbeef> It's an iterator which is practically a template
21:39:04FromDiscord<Elegantbeef> So the line information is there but it's in your code
21:39:28FromDiscord<danielsokil> That is the error message from a dep I'm using
21:39:31FromDiscord<Elegantbeef> Think devel made errors inside iterators correct
21:41:06FromDiscord<danielsokil> sent a code paste, see https://play.nim-lang.org/#pasty=IMNnctOd
21:42:00FromDiscord<danielsokil> So it does seem that --include applies to deps
21:42:14FromDiscord<Elegantbeef> Well yea
21:42:22FromDiscord<Elegantbeef> `--include` is included in all files
21:42:37FromDiscord<Elegantbeef> including system
21:46:03FromDiscord<danielsokil> So it's tricky, `{.push raises: [].}` will force me to handle errors from procs I'm consuming.↵↵But underlying deps could still throw: https://github.com/enthus1ast/nimIpAddresses/blob/master/ipAddresses.nim#L42
21:46:17FromDiscord<Elegantbeef> Which is a non issue
21:46:22FromDiscord<Elegantbeef> Cause you cannot raise inside procs
21:48:29FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=wnIhquWD
21:49:35FromDiscord<danielsokil> Okay this is already very useful, enjoy working together with the compiler
21:50:07FromDiscord<danielsokil> Where could I learn more about `{.push raises: [].}`?
21:50:46FromDiscord<Elegantbeef> I already linked it!
21:51:04FromDiscord<danielsokil> In reply to @danielsokil "Okay this is already": Reminds me of Safe Haskell, https://wiki.haskell.org/Safe_Haskell
21:52:13FromDiscord<danielsokil> In reply to @Elegantbeef "*I already linked it!*": Ah right, effect-system
21:52:54FromDiscord<danielsokil> Once I receive my stimulants from India, I will dive into the manual, lol
21:54:10FromDiscord<Elegantbeef> Drugs r bad
21:54:34FromDiscord<danielsokil> In reply to @heysokam "<@413289167007514624> #1 award for": European descent?
21:55:03FromDiscord<danielsokil> In reply to @Elegantbeef "Drugs r bad": Lol, it's a miracle everyone is not on drugs
21:56:34FromDiscord<danielsokil> In reply to @danielsokil "So it's tricky, `{.push": Ohh, I get it now, underlying errors propagate up to the procedure I'm calling.
22:04:46*beholders_eye quit (Read error: Connection reset by peer)
22:10:24*beholders_eye joined #nim
22:19:18FromDiscord<sOkam! 🫐> In reply to @danielsokil "European descent?": for the nickname? nah. i am eu, but nothing to do with the name ✍️
22:19:51FromDiscord<Robyn [She/Her]> https://play.nim-lang.org/#pasty=FvwAhvOM
22:20:28FromDiscord<Robyn [She/Her]> Now ref objects don't work anymore if I define them 😔
22:20:54FromDiscord<Robyn [She/Her]> Probably should explicitly disallow them anyway but they would've been neat
22:21:08FromDiscord<Elegantbeef> What?
22:21:54FromDiscord<Robyn [She/Her]> You can't make `MOption` a `ref object`
22:22:16FromDiscord<Robyn [She/Her]> `/home/chronos/Projects/Cordyceps/src/cordyceps.nim(215, 21) Error: object constructor needs an object type [object declared in /home/chronos/.nimble/pkgs2/micros-0.1.16-9452155bea9280923b9a5654037eb92513ec8e7c/micros/definitions/typedefs.nim(10, 9)]`
22:22:27FromDiscord<Robyn [She/Her]> It gives this unhelpful error
22:23:50FromDiscord<Elegantbeef> you have a `= ref`
22:24:04FromDiscord<Elegantbeef> If the body is ref make it `ref TypeSpore[T]`
22:25:40FromDiscord<Robyn [She/Her]> Oooooh
22:32:23FromDiscord<Robyn [She/Her]> Thanks Beef :)
22:32:51FromDiscord<danielsokil> Thats sum gud beef
22:32:55FromDiscord<Robyn [She/Her]> I'm gonna implement some tests for what I have rn then I'll continue working on this tomorrow
22:33:10FromDiscord<Robyn [She/Her]> In reply to @danielsokil "Thats sum gud beef": Beef is a macro mage :)
22:34:00FromDiscord<Robyn [She/Her]> Uuuugh I hate tests
22:39:22*beholders_eye quit (Read error: Connection reset by peer)
22:45:12*beholders_eye joined #nim
23:15:06FromDiscord<Robyn [She/Her]> Hey Beef, remember the issue about types needing to be instantiated and stuff? https://play.nim-lang.org/#pasty=HOkmWOmv line 173 to 187 are the issue here, there's no way for me to define the procedure and access it outside of the body
23:17:09*def- quit (Quit: -)
23:17:13FromDiscord<Elegantbeef> I mean `Some` is not a type anyway
23:17:23*def-- joined #nim
23:17:33FromDiscord<Elegantbeef> Whether that's causing the issue though...
23:17:33FromDiscord<Robyn [She/Her]> Wdym?
23:17:47*def-- is now known as def-
23:17:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=XTDOSHvM
23:17:55FromDiscord<Elegantbeef> `None[T]`
23:18:04FromDiscord<Elegantbeef> `None(kind: ..)` is also invalid
23:18:10FromDiscord<Robyn [She/Her]> Oh yeah I should've thought about that
23:18:17FromDiscord<Elegantbeef> That should be `None( MOption[T](kind: ...))`
23:18:20FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "`None(kind: ..)` is also": Yeah it should be `MOption`
23:19:02FromDiscord<Elegantbeef> Well `None[T](MOption[T](...))`
23:21:04*def- quit (Client Quit)
23:21:21*def- joined #nim
23:22:36FromDiscord<Robyn [She/Her]> So I need to generate generic params for the proc too? Fun...
23:24:10FromDiscord<Robyn [She/Her]> I'll do this tomorrow
23:26:06*rockcavera quit (Remote host closed the connection)
23:28:37FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#pasty=cYWAFAhV
23:30:06*rockcavera joined #nim
23:30:17FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#pasty=oxbreZus
23:30:19FromDiscord<codic> is this a bug ?
23:30:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=RWTaptnN
23:31:23FromDiscord<codic> oh im stupid i forgot i wrote that lol
23:31:30FromDiscord<codic> its been years since i touched this codebase extensively
23:31:34FromDiscord<codic> sry for the dumb question
23:52:27FromDiscord<amarevite> In reply to @Elegantbeef "https://internet-of-tomohiro.pages.dev/nim/faq.en#t": im trying to use this because i want to be able to return a sequence of various types from a proc, but i cannot instantiate my base type↵i really thought it would be easier than this to work with a series of elements of varying types↵the tuples worked for a proc input, but i cant get it to work for the output
23:53:57FromDiscord<Elegantbeef> Yea Nim does not have any auto boxing so you need variants
23:54:42FromDiscord<Elegantbeef> You can use Leorize's union package https://github.com/alaviss/union to make the variant for you