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:40 | FromDiscord | <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:55 | FromDiscord | <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:33 | PMunch | Anyone else finding themselves using this pattern? https://play.nim-lang.org/#pasty=BTgjdgMU |
10:42:40 | PMunch | Or is it just me |
10:43:52 | FromDiscord | <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:41 | PMunch | Oh shit, didn't even think of that |
10:47:42 | PMunch | https://play.nim-lang.org/#pasty=gDoXCjGm |
10:47:46 | PMunch | This is indeed much easier |
10:49:17 | FromDiscord | <double_spiral> What's the advantage of this over a regular loop |
10:49:37 | PMunch | Readability |
10:50:07 | PMunch | Basically just being sure that every branch that doesn't hit a retry will actually quit out of the loop |
10:51:19 | PMunch | Could of course also be expanded with something like this: https://play.nim-lang.org/#pasty=GzWBJgzL |
10:52:29 | PMunch | What would be awesome is if that `do` could be the name of the extra parameter instead. Basically named parameter template calling |
10:52:56 | PMunch | But that's probably hard to implement because of the syntactic -> semantic pass.. |
11:06:02 | * | ryuukk joined #nim |
11:08:07 | PMunch | Hmm, is there a way to give optional parameters to a template that expects a body? |
11:08:52 | PMunch | Something like this: https://play.nim-lang.org/#pasty=aIKtsPdQ |
11:08:56 | PMunch | But which works |
11:10:20 | FromDiscord | <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:06 | PMunch | But I'd need a macro to do the unpacking don't I? |
11:11:12 | FromDiscord | <metagngn> oops sorry, yeah a macro |
11:11:26 | FromDiscord | <metagngn> but the actual implementation can stay as a template |
11:11:40 | PMunch | Hmm true.. |
11:12:31 | FromDiscord | <metagngn> <https://play.nim-lang.org/#pasty=FmbcyNOY> |
11:13:00 | PMunch | I feel like with a little bit of macro-sugar templates could unlock 60% more usecases |
11:15:02 | PMunch | Hmm, it'd be tricky to do that for both cases though (with and without the `onRetry` argument) |
11:17:34 | FromDiscord | <metagngn> yeah you would have to insert an empty block if it isn't there |
11:29:37 | FromDiscord | <ayex> this one I find more readable, when the retry number gets very obviously passed into the macro 🤔↵(@metagngn) |
11:30:35 | PMunch | Something like this should be doable @metagngn: https://play.nim-lang.org/#pasty=LkyFpaXz |
11:31:05 | FromDiscord | <metagngn> good idea |
11:31:15 | FromDiscord | <metagngn> you can use `(;)` as an empty statement |
11:31:36 | FromDiscord | <metagngn> might try making that |
11:32:21 | PMunch | Oh you can? Neat! |
11:40:19 | FromDiscord | <zumi.dxy> What's the difference between {.inject.} and {.dirty.}? |
11:41:17 | FromDiscord | <metagngn> {.dirty.} prevents any symbol capture whatsoever inside a template, leaving them as raw identifiers |
11:42:33 | PMunch | {.dirty.} is applied to the entire template, {.inject.} just applies to one identifier |
11:42:40 | FromDiscord | <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:16 | PMunch | Hmm, I just get "expressien '' has no type" when I try to use (;) |
11:44:55 | FromDiscord | <odexine> In reply to @PMunch "https://play.nim-lang.org/#pasty=gDoXCjGm": You CAN continue whiles?????????? |
11:45:25 | PMunch | @odexine, apparently *shrugs* |
11:45:30 | PMunch | Why wouldn't you be able to? |
11:45:32 | FromDiscord | <odexine> Surprising honestly |
11:45:41 | FromDiscord | <odexine> I don’t know I just felt like you shouldn’t |
11:46:09 | FromDiscord | <metagngn> `untyped` default values are broken, they don't accept anything with void type, will try to fix |
11:49:20 | PMunch | That'd be great! |
12:16:07 | FromDiscord | <kiloneie> Interesting, i am terrible on controlling loops, i spent way too much time on them... i hate them |
12:16:55 | FromDiscord | <kiloneie> imma save that last example, maybe it can be useful |
12:17:15 | strogon14 | Aren't loops one of the fundamental building blocks of software, though? |
12:18:00 | FromDiscord | <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:11 | FromDiscord | <kiloneie> doing a game loop is easy |
12:18:48 | FromDiscord | <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:24 | FromDiscord | <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:23 | FromDiscord | <kiloneie> you don't actually use break, continue and such much, until you do... |
12:22:45 | strogon14 | sure, 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:45 | PMunch | @kiloneie, ever played around with goto? That's where the real pain is :P |
12:24:11 | FromDiscord | <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:24 | PMunch | Had to debug a BASIC program once, every line is numbered, and then it uses `GOTO <line number>` for flow control.. |
12:24:39 | PMunch | Oh so you have used basic :P |
12:25:12 | FromDiscord | <kiloneie> yeh at some point in high school, i enjoyed it more than c++ and the like we had at school |
12:25:29 | PMunch | Well it's nice as a brain teaser/puzzle |
12:25:37 | FromDiscord | <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:02 | PMunch | I tried to re-implement some code from a standard |
12:26:10 | FromDiscord | <kiloneie> im sure if the programmer used them sparingly and well, it's not as bad |
12:26:27 | PMunch | Turns 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:33 | PMunch | It was a complete mess |
12:27:30 | PMunch | Had 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:17 | PMunch | It 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:22 | FromDiscord | <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:02 | FromDiscord | <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:23 | FromDiscord | <firasuke> is it possible to use the git version of a package dependency in nimble? |
13:53:32 | FromDiscord | <firasuke> (edit) "is it possible to use the git ... version" added "(master)" |
13:53:38 | FromDiscord | <firasuke> (edit) "(master)" => "(main/master)" |
13:56:47 | FromDiscord | <solitudesf> In reply to @firasuke "is it possible to": you mean latest commit? `requires "package#HEAD"` |
14:00:28 | FromDiscord | <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:40 | FromDiscord | <metagngn> ask in #internals, it was deprecated without elaboration <https://github.com/nim-lang/Nim/pull/23828> |
14:30:37 | FromDiscord | <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:19 | FromDiscord | <ringabout> (edit) "removed" => "deprecated" |
14:35:34 | FromDiscord | <firasuke> In reply to @solitudesf "you mean latest commit?": yup, thanks |
14:41:02 | FromDiscord | <zumi.dxy> one use of `{.warning.}` I've found recently: as a substitute for `TODO` comments |
14:43:13 | FromDiscord | <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:45 | FromDiscord | <firasuke> sent a code paste, see https://play.nim-lang.org/#pasty=BIFrVufB |
15:34:10 | FromDiscord | <firasuke> In reply to @firasuke "I am facing the": I also have no idea how to debug this 🙂 |
16:08:02 | FromDiscord | <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:03 | FromDiscord | <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:55 | FromDiscord | <griffith1deadly> im about toml |
16:50:51 | FromDiscord | <firasuke> In reply to @griffith1deadly "im about toml": ? |
16:51:37 | FromDiscord | <griffith1deadly> your error literally says `Error: [] must have some form of array type` that related to toml file |
16:53:38 | FromDiscord | <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:17 | FromDiscord | <odexine> https://github.com/status-im/nim-serialization/blob/c24cedb6626123a9e25d410149921145cf5ba5be/serialization/object_serialization.nim#L215 |
16:56:51 | FromDiscord | <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:31 | FromDiscord | <firasuke> oh interesting, isn't `string` a `distinct type`? |
16:58:04 | FromDiscord | <firasuke> should the `distinct type` in `makeFieldReadersTable` be modified then? I'll happily test it |
16:58:48 | * | ntat joined #nim |
17:09:48 | FromDiscord | <odexine> Honestly I have no clue what the problem would be here |
17:09:54 | FromDiscord | <odexine> Kinda no lead here |
17:11:52 | * | Onionhammer quit (Ping timeout: 244 seconds) |
17:13:00 | FromDiscord | <firasuke> How can I provide more information xD |
17:14:05 | FromDiscord | <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:21 | FromDiscord | <firasuke> this used to work literally all the time, until I updated to 2.2.0 |
17:14:29 | FromDiscord | <firasuke> then it stopped working for every version I tried xD |
17:14:47 | * | Onionhammer joined #nim |
17:26:57 | FromDiscord | <firasuke> and I did a clean reinstall and this issue is gone, verrry weird |
17:39:14 | FromDiscord | <madonuko> sent a code paste, see https://play.nim-lang.org/#pasty=KrmFVVhg |
17:39:40 | FromDiscord | <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:49 | FromDiscord | <swrge> How do I convert a `set[SomeEnum]` to a `set[int]` ? |
20:56:36 | FromDiscord | <swrge> `set[int16]` cause the compiler cry otherwise |
20:56:38 | FromDiscord | <Elegantbeef> You don't `set[int]` requires `2^64` bits |
20:56:52 | FromDiscord | <swrge> yeah i just tested this |
20:57:12 | FromDiscord | <Elegantbeef> You iterate the enum set then do `otherSet.incl(int16 myEnum)` |
20:57:50 | FromDiscord | <swrge> theres no faster way (i tried cast but it explodes) |
20:57:56 | FromDiscord | <swrge> (edit) "theres no faster way ... (i" added "?" |
20:58:07 | FromDiscord | <Elegantbeef> Nope they're not internally compatible |
20:58:19 | FromDiscord | <swrge> i guess i will do with it then |
21:03:17 | FromDiscord | <swrge> <@1196075973871943741> forgot to say but thanks btw |
21:07:28 | FromDiscord | <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:29 | FromDiscord | <Elegantbeef> Also remember that `set[int16]` is relatively massive so it's a likely performance trap |
21:11:36 | FromDiscord | <swrge> sent a code paste, see https://play.nim-lang.org/#pasty=iTCXJedG |
21:11:42 | FromDiscord | <swrge> is this fine or not ? |
21:12:18 | FromDiscord | <Elegantbeef> It's fine it just allocates 2^16 bits in static memory. What is `RecvEvent`? |
21:12:29 | FromDiscord | <Elegantbeef> The issue is when you do store the sets in a field |
21:13:55 | * | ntat quit (Quit: Leaving) |
21:14:01 | FromDiscord | <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:11 | FromDiscord | <Elegantbeef> I mean what are it's values |
21:15:42 | FromDiscord | <demotomohiro> `sizeof(set[int8]) == 32`↵`sizeof(set[EnumWith8element]) == 1` |
21:16:32 | * | Jjp137 quit (Quit: Leaving) |
21:18:09 | FromDiscord | <swrge> sent a code paste, see https://play.nim-lang.org/#pasty=smfwAgPb |
21:19:02 | FromDiscord | <swrge> In reply to @demotomohiro "`sizeof(set[int8]) == 32` `sizeof(set[EnumWith8elem": huh... |
21:19:20 | FromDiscord | <Elegantbeef> `set[int8]` takes 256 bits |
21:19:25 | FromDiscord | <Elegantbeef> 256/8 = .... |
21:19:33 | FromDiscord | <Elegantbeef> which is why the cast did not work |
21:19:37 | FromDiscord | <swrge> yeah |
21:19:47 | FromDiscord | <swrge> i feel a lil stupid lol |
21:19:52 | * | Jjp137 joined #nim |
21:20:35 | FromDiscord | <Elegantbeef> The fact `RecvEvent` does not just do `1, 2, 4, 8, 16` is an affront to sanity |
21:20:44 | FromDiscord | <demotomohiro> In reply to @swrge "huh...": `EnumWith8element` in that code is supposed to be simple enum, but your `RecvEvent` is holey enum. |
21:21:13 | FromDiscord | <Elegantbeef> Your method is pretty much the lowest CPU runtime one can do 😄 |
21:21:23 | FromDiscord | <swrge> whoosp lol |
21:21:28 | FromDiscord | <Elegantbeef> It's O(1) but takes up 2^16 bits |
21:22:16 | FromDiscord | <swrge> In reply to @demotomohiro "`EnumWith8element` in that code": I don't really understand the holey enum thing |
21:22:16 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=cSUXBgZE |
21:22:32 | FromDiscord | <swrge> oh ok |
21:22:38 | FromDiscord | <swrge> so im wasting space |
21:23:34 | FromDiscord | <demotomohiro> In reply to @swrge "I don't really understand": If enum members have discontiguous numbers, it is a holey enum. |
21:24:20 | FromDiscord | <swrge> yeah i just didnt understand at first you meant i was taking up more space |
21:24:25 | FromDiscord | <swrge> than necessary |
21:25:56 | FromDiscord | <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:12 | FromDiscord | <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) |