<< 03-10-2024 >>

00:00:11*albe quit (Quit: The Lounge - https://thelounge.chat)
00:02:30*fallback joined #nim
00:03:15*albe joined #nim
00:08:55*rockcavera joined #nim
00:10:40FromDiscord<kiloneie> Yes this is really nice. Doesn't use path. With a Nim runner program, you could easily switch versions per project.
00:42:08*Onionhammer joined #nim
02:38:42*rockcavera quit (Remote host closed the connection)
04:00:17*SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev)
04:07:16*SchweinDeBurg joined #nim
04:07:55FromDiscord<bung8954> how to wrap objective c property assginment ?
06:00:09*m5zs7k quit (Ping timeout: 246 seconds)
06:11:35*m5zs7k joined #nim
06:14:03*ntat joined #nim
06:45:36*jjido joined #nim
06:57:10*coldfeet joined #nim
07:22:49*PMunch joined #nim
07:25:30*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
07:31:07*jjido joined #nim
08:49:54*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
09:19:18*psichas joined #nim
10:23:10*ryuukk quit (Remote host closed the connection)
10:42:33PMunchAnyone else finding themselves using this pattern? https://play.nim-lang.org/#pasty=BTgjdgMU
10:42:40PMunchOr is it just me
10:43:52FromDiscord<odexine> would prolly be easier if one could continue a while
10:45:12*psichas quit (Changing host)
10:45:12*psichas joined #nim
10:47:41PMunchOh shit, didn't even think of that
10:47:42PMunchhttps://play.nim-lang.org/#pasty=gDoXCjGm
10:47:46PMunchThis is indeed much easier
10:49:17FromDiscord<double_spiral> What's the advantage of this over a regular loop
10:49:37PMunchReadability
10:50:07PMunchBasically just being sure that every branch that doesn't hit a retry will actually quit out of the loop
10:51:19PMunchCould of course also be expanded with something like this: https://play.nim-lang.org/#pasty=GzWBJgzL
10:52:29PMunchWhat would be awesome is if that `do` could be the name of the extra parameter instead. Basically named parameter template calling
10:52:56PMunchBut that's probably hard to implement because of the syntactic -> semantic pass..
11:06:02*ryuukk joined #nim
11:08:07PMunchHmm, is there a way to give optional parameters to a template that expects a body?
11:08:52PMunchSomething like this: https://play.nim-lang.org/#pasty=aIKtsPdQ
11:08:56PMunchBut which works
11:10:20FromDiscord<metagngn> there's an experimental feature `flexibleOptionalParams` but it's wonky, what you can do is define a public template that only has `varargs[untyped]` args, then reorder it so the final body argument is moved to the first argument, then call internal overloads that way
11:11:06PMunchBut I'd need a macro to do the unpacking don't I?
11:11:12FromDiscord<metagngn> oops sorry, yeah a macro
11:11:26FromDiscord<metagngn> but the actual implementation can stay as a template
11:11:40PMunchHmm true..
11:12:31FromDiscord<metagngn> <https://play.nim-lang.org/#pasty=FmbcyNOY>
11:13:00PMunchI feel like with a little bit of macro-sugar templates could unlock 60% more usecases
11:15:02PMunchHmm, it'd be tricky to do that for both cases though (with and without the `onRetry` argument)
11:17:34FromDiscord<metagngn> yeah you would have to insert an empty block if it isn't there
11:29:37FromDiscord<ayex> this one I find more readable, when the retry number gets very obviously passed into the macro 🤔↵(@metagngn)
11:30:35PMunchSomething like this should be doable @metagngn: https://play.nim-lang.org/#pasty=LkyFpaXz
11:31:05FromDiscord<metagngn> good idea
11:31:15FromDiscord<metagngn> you can use `(;)` as an empty statement
11:31:36FromDiscord<metagngn> might try making that
11:32:21PMunchOh you can? Neat!
11:40:19FromDiscord<zumi.dxy> What's the difference between {.inject.} and {.dirty.}?
11:41:17FromDiscord<metagngn> {.dirty.} prevents any symbol capture whatsoever inside a template, leaving them as raw identifiers
11:42:33PMunch{.dirty.} is applied to the entire template, {.inject.} just applies to one identifier
11:42:40FromDiscord<metagngn> {.inject.} is applied to individual symbol declarations in templates, it stops their name from being obscured so it's the same name between the context of the template body and where the template is called
11:43:16PMunchHmm, I just get "expressien '' has no type" when I try to use (;)
11:44:55FromDiscord<odexine> In reply to @PMunch "https://play.nim-lang.org/#pasty=gDoXCjGm": You CAN continue whiles??????????
11:45:25PMunch@odexine, apparently *shrugs*
11:45:30PMunchWhy wouldn't you be able to?
11:45:32FromDiscord<odexine> Surprising honestly
11:45:41FromDiscord<odexine> I don’t know I just felt like you shouldn’t
11:46:09FromDiscord<metagngn> `untyped` default values are broken, they don't accept anything with void type, will try to fix
11:49:20PMunchThat'd be great!
12:16:07FromDiscord<kiloneie> Interesting, i am terrible on controlling loops, i spent way too much time on them... i hate them
12:16:55FromDiscord<kiloneie> imma save that last example, maybe it can be useful
12:17:15strogon14Aren't loops one of the fundamental building blocks of software, though?
12:18:00FromDiscord<kiloneie> Sure, doesn't mean you need to fine control them to get the result you want, which is what im bad at
12:18:11FromDiscord<kiloneie> doing a game loop is easy
12:18:48FromDiscord<kiloneie> when i was doing a take this code now break it down so i can execute it in scopes, that was hard and i hated it
12:19:24FromDiscord<kiloneie> it was a nonsense attempt at a "debugger" or "benchmarker" that i will continue at some point, though it's kinda stupid
12:20:23FromDiscord<kiloneie> you don't actually use break, continue and such much, until you do...
12:22:45strogon14sure, I guess what I'm saying is, learning how to use loops and break conditions and, thererfore, boolean logic, is part of becoming a programmer.
12:23:45PMunch@kiloneie, ever played around with goto? That's where the real pain is :P
12:24:11FromDiscord<kiloneie> In reply to @PMunch "<@398205119583485964>, ever played around": Not enough to get the pain, but i did use it a tiny bit in pure basic
12:24:24PMunchHad to debug a BASIC program once, every line is numbered, and then it uses `GOTO <line number>` for flow control..
12:24:39PMunchOh so you have used basic :P
12:25:12FromDiscord<kiloneie> yeh at some point in high school, i enjoyed it more than c++ and the like we had at school
12:25:29PMunchWell it's nice as a brain teaser/puzzle
12:25:37FromDiscord<kiloneie> i've only used goto to get the stuff i was experimenting/learning on to work, so not enough to lose my mind following gotos xD
12:26:02PMunchI tried to re-implement some code from a standard
12:26:10FromDiscord<kiloneie> im sure if the programmer used them sparingly and well, it's not as bad
12:26:27PMunchTurns out the standard had been updated at some point, and the guy in charge of updating the basic code I'm pretty sure had never used basic..
12:26:33PMunchIt was a complete mess
12:27:30PMunchHad to use an older version of the standard to get the right flow-control, and then the new version to get the updated formulas
12:27:39*jjido joined #nim
12:28:17PMunchIt was doing things like jumping to lines that no longer existed, plenty of dead code that had no way to get jumped to, and other fun like that
12:35:22FromDiscord<kiloneie> Oh, yeah, never got to goto dead/changed line... If you change code above, add or rmv lines, it can break it.↵↵And yeh i've tried a book ide for cpp outdated as hell, made me quit the book... And devcpp at the time internet was well on its way away from it
12:37:02FromDiscord<kiloneie> Those older languages and their lack of using a standard + decentralized documentations etc... Which is why learning c or cpp can be annoying...
12:50:15*psichas left #nim (Leaving)
13:12:46*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
13:16:47*pmp-p_ is now known as pmp-p
13:53:23FromDiscord<firasuke> is it possible to use the git version of a package dependency in nimble?
13:53:32FromDiscord<firasuke> (edit) "is it possible to use the git ... version" added "(master)"
13:53:38FromDiscord<firasuke> (edit) "(master)" => "(main/master)"
13:56:47FromDiscord<solitudesf> In reply to @firasuke "is it possible to": you mean latest commit? `requires "package#HEAD"`
14:00:28FromDiscord<summarity> In Nim 2.2 I get a warning that `owner` is deprecated. What should I use instead? I'm using it to find the module and proc name from a callsite: https://play.nim-lang.org/#pasty=swnKuMSG
14:07:24*ntat quit (Remote host closed the connection)
14:07:43*ntat joined #nim
14:12:30*PMunch quit (Quit: Leaving)
14:20:40FromDiscord<metagngn> ask in #internals, it was deprecated without elaboration <https://github.com/nim-lang/Nim/pull/23828>
14:30:37FromDiscord<ringabout> I didn't know the detail, but I guess it was removed because it was probably not compatible with the new compiler design. Yeah, you should ask in #internals
14:31:19FromDiscord<ringabout> (edit) "removed" => "deprecated"
14:35:34FromDiscord<firasuke> In reply to @solitudesf "you mean latest commit?": yup, thanks
14:41:02FromDiscord<zumi.dxy> one use of `{.warning.}` I've found recently: as a substitute for `TODO` comments
14:43:13FromDiscord<zumi.dxy> `{.hint.}` exists but `nimble build` seems to hide this one
14:47:53*lucasta joined #nim
15:07:33*disso-peach joined #nim
15:33:45FromDiscord<firasuke> sent a code paste, see https://play.nim-lang.org/#pasty=BIFrVufB
15:34:10FromDiscord<firasuke> In reply to @firasuke "I am facing the": I also have no idea how to debug this 🙂
16:08:02FromDiscord<griffith1deadly> show file
16:11:57*Onionhammer quit (Ping timeout: 246 seconds)
16:21:51*lucasta quit (Remote host closed the connection)
16:30:14*Onionhammer joined #nim
16:36:03FromDiscord<firasuke> In reply to @griffith1deadly "show file": https://github.com/glaucuslinux/rad/blob/main/src/cerata.nim#L40
16:46:35*coldfeet quit (Remote host closed the connection)
16:46:55FromDiscord<griffith1deadly> im about toml
16:50:51FromDiscord<firasuke> In reply to @griffith1deadly "im about toml": ?
16:51:37FromDiscord<griffith1deadly> your error literally says `Error: [] must have some form of array type` that related to toml file
16:53:38FromDiscord<firasuke> The thing is `loadFile` is not called at compile time, it's a runtime function, why is it erroring at compiled time?
16:56:17FromDiscord<odexine> https://github.com/status-im/nim-serialization/blob/c24cedb6626123a9e25d410149921145cf5ba5be/serialization/object_serialization.nim#L215
16:56:51FromDiscord<odexine> Suspicion is `distinct type` on the line above but I don’t know what else to suspect
16:57:22*ntat quit (Remote host closed the connection)
16:57:31FromDiscord<firasuke> oh interesting, isn't `string` a `distinct type`?
16:58:04FromDiscord<firasuke> should the `distinct type` in `makeFieldReadersTable` be modified then? I'll happily test it
16:58:48*ntat joined #nim
17:09:48FromDiscord<odexine> Honestly I have no clue what the problem would be here
17:09:54FromDiscord<odexine> Kinda no lead here
17:11:52*Onionhammer quit (Ping timeout: 244 seconds)
17:13:00FromDiscord<firasuke> How can I provide more information xD
17:14:05FromDiscord<firasuke> In reply to @firasuke "https://github.com/glaucuslinux/rad/blob/main/src/c": I have an object here called `Ceras` that has 7 strings initialized with a custom value, then I use `Toml.loadFile`
17:14:21FromDiscord<firasuke> this used to work literally all the time, until I updated to 2.2.0
17:14:29FromDiscord<firasuke> then it stopped working for every version I tried xD
17:14:47*Onionhammer joined #nim
17:26:57FromDiscord<firasuke> and I did a clean reinstall and this issue is gone, verrry weird
17:39:14FromDiscord<madonuko> sent a code paste, see https://play.nim-lang.org/#pasty=KrmFVVhg
17:39:40FromDiscord<madonuko> I forced the version of `results` to be 0.4.0
18:28:07*ntat quit (Quit: Leaving)
18:34:11*Onionhammer9 joined #nim
18:36:33*Onionhammer quit (Ping timeout: 248 seconds)
18:36:34*Onionhammer9 is now known as Onionhammer
18:50:36*Onionhammer3 joined #nim
18:52:37*Onionhammer quit (Ping timeout: 244 seconds)
18:52:37*Onionhammer3 is now known as Onionhammer
19:58:04*ntat joined #nim
20:55:49FromDiscord<swrge> How do I convert a `set[SomeEnum]` to a `set[int]` ?
20:56:36FromDiscord<swrge> `set[int16]` cause the compiler cry otherwise
20:56:38FromDiscord<Elegantbeef> You don't `set[int]` requires `2^64` bits
20:56:52FromDiscord<swrge> yeah i just tested this
20:57:12FromDiscord<Elegantbeef> You iterate the enum set then do `otherSet.incl(int16 myEnum)`
20:57:50FromDiscord<swrge> theres no faster way (i tried cast but it explodes)
20:57:56FromDiscord<swrge> (edit) "theres no faster way ... (i" added "?"
20:58:07FromDiscord<Elegantbeef> Nope they're not internally compatible
20:58:19FromDiscord<swrge> i guess i will do with it then
21:03:17FromDiscord<swrge> <@1196075973871943741> forgot to say but thanks btw
21:07:28FromDiscord<swrge> turns out i can get away with it by doing the iteration at compile time so i'm as fast as can be 🙂
21:07:29FromDiscord<Elegantbeef> Also remember that `set[int16]` is relatively massive so it's a likely performance trap
21:11:36FromDiscord<swrge> sent a code paste, see https://play.nim-lang.org/#pasty=iTCXJedG
21:11:42FromDiscord<swrge> is this fine or not ?
21:12:18FromDiscord<Elegantbeef> It's fine it just allocates 2^16 bits in static memory. What is `RecvEvent`?
21:12:29FromDiscord<Elegantbeef> The issue is when you do store the sets in a field
21:13:55*ntat quit (Quit: Leaving)
21:14:01FromDiscord<swrge> In reply to @Elegantbeef "It's fine it just": type of event i receive over a socket, i probably should name that `RecvKind` tho
21:14:11FromDiscord<Elegantbeef> I mean what are it's values
21:15:42FromDiscord<demotomohiro> `sizeof(set[int8]) == 32`↵`sizeof(set[EnumWith8element]) == 1`
21:16:32*Jjp137 quit (Quit: Leaving)
21:18:09FromDiscord<swrge> sent a code paste, see https://play.nim-lang.org/#pasty=smfwAgPb
21:19:02FromDiscord<swrge> In reply to @demotomohiro "`sizeof(set[int8]) == 32` `sizeof(set[EnumWith8elem": huh...
21:19:20FromDiscord<Elegantbeef> `set[int8]` takes 256 bits
21:19:25FromDiscord<Elegantbeef> 256/8 = ....
21:19:33FromDiscord<Elegantbeef> which is why the cast did not work
21:19:37FromDiscord<swrge> yeah
21:19:47FromDiscord<swrge> i feel a lil stupid lol
21:19:52*Jjp137 joined #nim
21:20:35FromDiscord<Elegantbeef> The fact `RecvEvent` does not just do `1, 2, 4, 8, 16` is an affront to sanity
21:20:44FromDiscord<demotomohiro> In reply to @swrge "huh...": `EnumWith8element` in that code is supposed to be simple enum, but your `RecvEvent` is holey enum.
21:21:13FromDiscord<Elegantbeef> Your method is pretty much the lowest CPU runtime one can do 😄
21:21:23FromDiscord<swrge> whoosp lol
21:21:28FromDiscord<Elegantbeef> It's O(1) but takes up 2^16 bits
21:22:16FromDiscord<swrge> In reply to @demotomohiro "`EnumWith8element` in that code": I don't really understand the holey enum thing
21:22:16FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=cSUXBgZE
21:22:32FromDiscord<swrge> oh ok
21:22:38FromDiscord<swrge> so im wasting space
21:23:34FromDiscord<demotomohiro> In reply to @swrge "I don't really understand": If enum members have discontiguous numbers, it is a holey enum.
21:24:20FromDiscord<swrge> yeah i just didnt understand at first you meant i was taking up more space
21:24:25FromDiscord<swrge> than necessary
21:25:56FromDiscord<swrge> In reply to @Elegantbeef "It's O(1) but takes": i'll keep that in mind, im not bothered too much by this tho
21:26:12FromDiscord<swrge> ty everyone !
21:28:57*cnx quit (Ping timeout: 272 seconds)
21:33:20*cnx joined #nim
22:31:22*rockcavera joined #nim
23:37:27*disso-peach quit (Quit: Leaving)