<< 02-03-2025 >>

00:02:44*vicfred joined #nim
00:04:49*xet7 joined #nim
00:11:59*vicfred quit (Quit: leaving)
00:12:17*vicfred joined #nim
00:28:42FromDiscord<Elegantbeef> Went full on Canadian
00:28:48FromDiscord<Elegantbeef> @that_dude.
00:29:08FromDiscord<that_dude.> Sorry I don't know what you mean by that
00:29:16FromDiscord<Elegantbeef> I'm impressed someone noticed within a week
00:29:22FromDiscord<Elegantbeef> What's the Canadian TLD? 😛
00:30:33FromDiscord<that_dude.> Got it, I was looking for your blog, and the google result + discord search both still had the `.com` variant
00:30:43*vicfred quit (Quit: leaving)
00:31:06FromDiscord<Elegantbeef> One day I'll add a writeup about hot code reload
00:31:07*vicfred joined #nim
00:31:40FromDiscord<that_dude.> I wanted to refresh myself on concepts before I asked Araq questions lol
00:32:16FromDiscord<Elegantbeef> About implementation or usage?
00:32:46FromDiscord<that_dude.> How they fit into the ecosystem of the language since I think he was introducing afaict a new .requires pragma
00:33:22FromDiscord<Elegantbeef> Ah his plan is to make `concept`s some mixin instead of how they are now afaict
00:34:29FromDiscord<that_dude.> Seems reasonable to me I think. I was just curious on his vision behind the updates
00:36:20FromDiscord<Elegantbeef> I also don't touch on new concepts in my writeups as they're buggy and not overly useful in my endeavours
00:43:10FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Ah his plan is": huh, how would that be different compared to the current impl
00:51:41FromDiscord<nixfreak> Hi Elegantbeef is this library usable ? Been looking for an inotify for nim. I want to use nim to replace some bash scripts.
00:59:44FromDiscord<nixfreak> https://github.com/beef331/potato/blob/master/src/potato/inotifyevents.nim
01:07:45FromDiscord<janakali> sent a code paste, see https://play.nim-lang.org/#pasty=KupvfXLP
01:20:45FromDiscord<Elegantbeef> nixfreak I used it for reflector and it seems right
01:21:41FromDiscord<Elegantbeef> https://github.com/beef331/reflector/blob/master/reflector.nim has some niceties in that regard
01:57:11*Jjp137 quit (Quit: Leaving)
01:58:45*Jjp137 joined #nim
02:05:41*xet7 quit (Ping timeout: 248 seconds)
02:06:21*mahlon quit (Quit: PotatoTech)
02:17:47*xet7 joined #nim
02:37:11*beholders_eye quit (Ping timeout: 244 seconds)
03:04:30*vicfred quit (Quit: leaving)
03:04:48*vicfred joined #nim
03:06:53*LuxuryMode joined #nim
03:15:55FromDiscord<ajusa> If you're around beef, how does https://github.com/beef331/micros/blob/master/src/micros/introspection.nim work with default values? I assume it would include the default value types in the tuple?
03:16:20FromDiscord<nixfreak> Can you post this on a paste?↵(@janakali)
03:16:29FromDiscord<Elegantbeef> Don't know I rarely use them
03:17:25FromDiscord<ajusa> I'll try it out, I realize you wrote it a while ago. Thanks!
03:21:24FromDiscord<Elegantbeef> If you mean optionals it doesnt
03:26:54*vicfred quit (Ping timeout: 252 seconds)
03:55:04*vicfred joined #nim
04:03:56*vicfred quit (Quit: leaving)
04:24:50FromDiscord<janakali> @nixfreak I get error 500 from pastyy on Nim playground, so check this: https://pastebin.com/5MPCTHD8
04:35:33FromDiscord<janakali> same on wandbox: https://wandbox.org/permlink/Y76rfAwGtoQZ51f1
04:45:06*shrikant joined #nim
04:46:17*shrikant left #nim (#nim)
05:26:12*LuxuryMode quit (Quit: Connection closed for inactivity)
05:33:32FromDiscord<morgan (ping with reply)> sent a code paste, see https://paste.rs/Uvdu1
05:34:57FromDiscord<morgan (ping with reply)> reason behind it, it's for a room based air sim. if most rooms have low ceilings, i don't want to have tons of empty space (for better caching) if i need one room to have a pretty high ceiling
05:35:39FromDiscord<morgan (ping with reply)> i don't need it to vary between rooms, if it did vary i could just have it able to be less than the room's max
05:35:52FromDiscord<morgan (ping with reply)> i could do a ptr uncheckedarray inside but then that
05:36:01FromDiscord<morgan (ping with reply)> ... is another level of indirection
05:37:47FromDiscord<morgan (ping with reply)> actually
05:37:57FromDiscord<morgan (ping with reply)> ill just write an array3d type
05:38:01FromDiscord<morgan (ping with reply)> so nevermind lol
06:50:28*mahlon joined #nim
07:04:00*ensyde quit (Ping timeout: 244 seconds)
07:32:40FromDiscord<nnsee> In reply to @janakali "<@460266725988892672> I get error": investigating
07:40:25FromDiscord<nnsee> should be fine now. server had a network driver crash
08:25:21*ntat joined #nim
09:54:06*xet7 quit (Remote host closed the connection)
11:33:41*beholders_eye joined #nim
12:20:42*beholders_eye quit (Ping timeout: 272 seconds)
14:08:14FromDiscord<madonuko> for some reason nim_langserver (or I think nimsuggest) is giving me a bunch of errors (because it can't import some files?) but `nimble run` says otherwise
15:47:13FromDiscord<alohaer> In reply to @madonuko "for some reason nim_langserver": This may not address your issue, but I'll say that I'm constantly closing and re-opening vscode when programming in Nim to avoid "stale" warnings from nim_suggest about non-existent types/files/functions.
15:47:56FromDiscord<madonuko> yeah nah for one I don't use vscode for two those are not stale warnings/errors
15:48:28*tiorock joined #nim
15:48:28*rockcavera is now known as Guest4637
15:48:28*Guest4637 quit (Killed (copper.libera.chat (Nickname regained by services)))
15:48:28*tiorock is now known as rockcavera
15:50:33*tiorock joined #nim
15:50:33*rockcavera is now known as Guest4067
15:50:33*Guest4067 quit (Killed (zinc.libera.chat (Nickname regained by services)))
15:50:33*tiorock is now known as rockcavera
15:56:24*derpydoo joined #nim
16:14:11FromDiscord<odexine> In reply to @alohaer "This may not address": you can just restart the extension host
16:14:38FromDiscord<odexine> quicker than restarting vscode
16:15:12FromDiscord<alohaer> In reply to @odexine "you can just restart": Oh, thanks 👍
16:15:25FromDiscord<odexine> you can find it in the command search panel thing
16:15:30FromDiscord<odexine> ctrl shift p or smth
16:33:56*tiorock joined #nim
16:33:56*tiorock quit (Changing host)
16:33:56*tiorock joined #nim
16:33:56*rockcavera quit (Killed (mercury.libera.chat (Nickname regained by services)))
16:33:56*tiorock is now known as rockcavera
16:36:03*tiorock joined #nim
16:36:03*rockcavera is now known as Guest1367
16:36:03*Guest1367 quit (Killed (iridium.libera.chat (Nickname regained by services)))
16:36:03*tiorock is now known as rockcavera
17:05:26*derpydoo quit (Quit: derpydoo)
18:31:25*beholders_eye joined #nim
18:42:13FromDiscord<jseb> sent a long message, see https://pasty.ee/zwzgoIAO
19:13:09FromDiscord<solitudesf> on the site itself is says that docs are 2 years old
19:13:18FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=ApQaAnOO
19:14:21FromDiscord<heysokam> (edit) "https://play.nim-lang.org/#pasty=pqbhkBJC" => "https://play.nim-lang.org/#pasty=ygbvbtRr"
19:38:06*def- quit (Quit: -)
19:38:29*def- joined #nim
19:43:05*def- quit (Client Quit)
19:46:46*def- joined #nim
19:49:19*def- quit (Client Quit)
19:50:02FromDiscord<jseb> Thank you
20:15:41*def- joined #nim
20:21:52FromDiscord<jabuci> sent a code paste, see https://play.nim-lang.org/#pasty=ufOooQIn
20:22:17FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=PigEqAat
20:22:22FromDiscord<Elegantbeef> well `var b = a` 😄
20:23:05FromDiscord<fl4shk> so that's how you use `new`
20:23:10FromDiscord<fl4shk> I had been wondering about that
20:23:18FromDiscord<fl4shk> not the only thing you can do with `new`, I'm aware
20:23:32FromDiscord<Elegantbeef> Well it's overloaded for `var ref T` aswell
20:23:50FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=VMjWbRqC
20:32:56FromDiscord<jabuci> When I write `var a = @[1, 2, 3]`, what happens? I thought the following: `a` is a reference on the stack, and the sequence is put in the heap. Is that correct or wrong?
20:35:10FromDiscord<Elegantbeef> Well a is a object on the stack which has `len: int, data: ptr SeqData` but the thing is Nim copies sequences on assignment
20:35:14FromDiscord<Elegantbeef> so `b = a` will make a copy
20:39:51FromDiscord<jabuci> Does it mean that when I pass a sequence to a proc, a complete copy is made? That'd make passing sequences around expensive.
20:40:09FromDiscord<Elegantbeef> Nope cause that's not assignment
20:41:33FromDiscord<Elegantbeef> Though even on assignment isn't write since Nim has move semantics
20:41:43FromDiscord<Elegantbeef> `b = a` can copy or can even be a implicit cursor to a sequence
20:42:06FromDiscord<Elegantbeef> b could even just consume a
20:56:53*ntat quit (Quit: Leaving)
20:57:45*cnx left #nim (#nim)
21:02:00FromDiscord<jabuci> Thanks!
21:37:45*scmutalisk joined #nim
21:38:30*scmutalisk left #nim (#nim)
21:39:22*mahlon quit (Quit: PotatoTech)
21:48:58*scmutalisk joined #nim
21:58:05*beholders_eye quit (Ping timeout: 260 seconds)
22:27:51FromDiscord<fl4shk> you could also use `move` I think
22:28:03FromDiscord<fl4shk> depending on the use case
22:28:31FromDiscord<aintea> Once the RFC about Enum variants and structural pattern matching will be integrated in Nim, do you think the standard library will be partly rewritten to get rid of errors and replace it with `Result` ? Or even just rewrite `std/options` ?
22:28:54FromDiscord<fl4shk> ooh Enum variants sound great
22:29:13FromDiscord<aintea> Or will we still have to deal with different approaches for example when we use manual memory management but the standard library still uses garbage collection
22:29:45FromDiscord<fl4shk> `seq` at least apparently doesn't use garbage collection, but not sure about `Table` and `HashSet`
22:30:08FromDiscord<fl4shk> (edit) "collection," => "collection (with ORC/ARC),"
22:30:21FromDiscord<aintea> it is true that now it uses ORC/ARC
22:30:34FromDiscord<aintea> but I'm not sure how the compatibility stuff will happen when enum variants will be included
22:30:56FromDiscord<aintea> will ML-like pattern matching be a feature or will it be the standard
22:31:13FromDiscord<Elegantbeef> It will likely stick to exceptions
22:31:52FromDiscord<Elegantbeef> The RFC seems to just be variant matching
22:32:34FromDiscord<Elegantbeef> You don't need to use move it's automatic↵(@fl4shk)
22:33:24FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=IpHnHBXt
22:33:34FromDiscord<aintea> which isn't incompatible with exceptions
22:35:10FromDiscord<Elegantbeef> Isn't it though?
22:35:34FromDiscord<aintea> I don't think it is incompatible
22:36:10FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=aeZDGPpR
22:36:15FromDiscord<Elegantbeef> That should printout `int`
22:36:28FromDiscord<aintea> why so
22:36:54FromDiscord<Elegantbeef> well it should print out an int I mean
22:37:08FromDiscord<Elegantbeef> Otherwise it's wrapping exceptions in results and pretending you're still using exceptions
22:37:35FromDiscord<aintea> It's not exactly using exceptions, it's just to differentiate
22:37:43FromDiscord<aintea> differentiate different error messages
22:38:20FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=dGbIYFRg
22:38:25FromDiscord<fl4shk> In reply to @Elegantbeef "You don't need to": oh, really? how do you do it?
22:38:41FromDiscord<fl4shk> ...if an assignment copies
22:38:48FromDiscord<Elegantbeef> `var b = a # if a is not used after here it's an implicit move`
22:38:57FromDiscord<fl4shk> oh I see
22:38:58FromDiscord<fl4shk> interesting
22:39:00FromDiscord<fl4shk> that's a good design
22:39:16FromDiscord<Elegantbeef> How do those results work with exceptions?
22:39:49FromDiscord<aintea> well you'd have to add `{.raises: [].}` at the end of every function to specify that you only need to handle the result
22:40:13FromDiscord<aintea> and since pattern matching needs to be exhaustive, this ensures runtime safety
22:40:15FromDiscord<Elegantbeef> So it's not using exceptions?
22:40:29FromDiscord<Elegantbeef> The point of exceptions is they can bubble
22:40:29FromDiscord<aintea> not exactly
22:40:39FromDiscord<michaelb.eth> Result vs. Exception, the olde holy war, Chapter 973441…
22:40:52FromDiscord<aintea> what do you exactly mean by bubble
22:41:01FromDiscord<aintea> In reply to @michaelb.eth "Result vs. Exception, the": in war we go
22:41:16FromDiscord<aintea> Since Nim allows a lot, both should be able to coexist
22:41:23FromDiscord<aintea> (edit) "lot," => "lot of things,"
22:41:26FromDiscord<Elegantbeef> An exception does not to be handled by the code that called into the procedure, it goes up the stack frame until handler handles it
22:41:34FromDiscord<Elegantbeef> I mean there are macros to convert between but it always is just wrapping from one to the other
22:41:57FromDiscord<aintea> In results you're forced to handle it anyways so what is the point of bubbling if there is nothing to bubble up
22:42:12FromDiscord<Elegantbeef> Well that's the point of an exception, you're not forced
22:42:22FromDiscord<aintea> then we have our use cases
22:42:34FromDiscord<aintea> I mean
22:42:57FromDiscord<aintea> If you don't want to handle anything you can do `let assert Ok(c) = divide(3, 4)`
22:43:31FromDiscord<aintea> which, if it fails, will raise an AssertDefect
22:43:37FromDiscord<Elegantbeef> Options and exceptions cannot really coexist in my view as one pollutes the return type and the other pollutes flow control
22:44:27FromDiscord<aintea> I think both can coexist, not in the same function tho
22:44:31FromDiscord<aintea> wait
22:44:51FromDiscord<Elegantbeef> You can of course use both, but that's not really coexisting now is it
22:45:00FromDiscord<aintea> define coexisting
22:45:08FromDiscord<aintea> so that we have the same definition
22:45:17FromDiscord<Elegantbeef> Using the same mechanism to handle either result or option
22:45:35FromDiscord<Elegantbeef> Not having to worry about which a procedure returns and handling the error in the same way
22:46:00FromDiscord<aintea> I don't think that is possible, but I think a macro to convert from one to another might be possible
22:46:05FromDiscord<Elegantbeef> Like I said they can be used together and you can even convert inbetween them, but that's not really coexisting to me
22:46:11FromDiscord<Elegantbeef> I mean they already exist
22:46:19FromDiscord<Elegantbeef> There are multiple result libraries out there that do exactly this
22:46:27FromDiscord<aintea> In reply to @Elegantbeef "Like I said they": then no, they cannot coexist as for your definition of coexisting
22:47:27FromDiscord<aintea> Also, from this point, I have no more facts to debate this, and it will only be subjective facts and my own opinion
22:47:55FromDiscord<aintea> so I suggest we end the debate here as it will not help having a logical debate
22:47:58FromDiscord<Elegantbeef> We're talking about error handling it's all subjective conjecture based in personal bias
22:48:15FromDiscord<Elegantbeef> It turns out errors implicitly suck and there is no good way of handling them
22:48:23FromDiscord<aintea> There is
22:48:29FromDiscord<aintea> writing code that solves one specific problem
22:48:37FromDiscord<aintea> for example the result of 1+1
22:48:42FromDiscord<aintea> no error handling
22:48:51FromDiscord<Elegantbeef> Except for overflow
22:49:00FromDiscord<aintea> that's it I'm becoming a farmer
22:49:03FromDiscord<michaelb.eth> AinTea, have you used arnetheduck’s results library? how about the “questionable” library, nice helper macros for results?
22:49:19FromDiscord<Elegantbeef> Here we go bitwise and of an unsigned byte
22:49:22FromDiscord<aintea> In reply to @michaelb.eth "AinTea, have you used": It does help but I'm always wanting to use enum variants
22:49:25FromDiscord<Elegantbeef> No error handling needed
22:49:43FromDiscord<aintea> There are always problems even in the simplest of solutions
22:50:25FromDiscord<aintea> I suggest we just wake up and realise the world is a lie, no more school, work, parenting, programming, handling exceptions
22:50:33FromDiscord<aintea> we are all gonna die anyway
22:50:50FromDiscord<aintea> but in the end, results > exceptions
22:50:57FromDiscord<Elegantbeef> Are you the programmer of a little radiation machine named therac-25?
22:51:09FromDiscord<aintea> I legally cannot answer
22:51:34FromDiscord<michaelb.eth> I wonder if The Matrix uses results or exceptions
22:51:59FromDiscord<aintea> they don't use none, nothing happens when the protagonist wakes up
22:52:01FromDiscord<Elegantbeef> Results but an incorrect unpack is a panic
23:22:57*tiorock joined #nim
23:22:57*tiorock quit (Changing host)
23:22:57*tiorock joined #nim
23:22:57*rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services)))
23:22:57*tiorock is now known as rockcavera
23:25:03*tiorock joined #nim
23:25:03*tiorock quit (Changing host)
23:25:03*tiorock joined #nim
23:25:03*rockcavera is now known as Guest4156
23:25:03*Guest4156 quit (Killed (copper.libera.chat (Nickname regained by services)))
23:25:03*tiorock is now known as rockcavera
23:29:14*vicfred joined #nim