00:05:08 | * | GnuYawk1 quit (Quit: The Lounge - https://thelounge.chat) |
00:06:45 | * | GnuYawk1 joined #nim |
00:23:06 | * | GnuYawk1 quit (Quit: The Lounge - https://thelounge.chat) |
00:24:26 | * | GnuYawk1 joined #nim |
00:40:27 | * | skippy8 quit (Quit: WeeChat 4.5.2) |
01:10:19 | FromDiscord | <Robyn [She/Her]> Anyone know if it's possible to make an iterator like `fieldPairs` on types using a macro? I want the `for x, y in typ.fieldPairs: ...` syntax↵↵Usecase is that I wanna make a `variantPairs` macro for grabbing the fields depending on a variant, specifically |
03:40:52 | FromDiscord | <DetermiedNim1> hello |
03:40:55 | FromDiscord | <DetermiedNim1> quick question |
03:41:05 | FromDiscord | <DetermiedNim1> i have this code right https://media.discordapp.net/attachments/371759389889003532/1376042361561550858/image.png?ex=6833e2d0&is=68329150&hm=739b935f93bf06aa0e93357eb5f5c778aa3f68bdbdbb2f31da86b76e44328f60& |
03:41:46 | FromDiscord | <DetermiedNim1> when compiling with `nim c --app:lib -d:useMalloc --mm:orc main.nim` only sayHi gets exported |
03:42:12 | FromDiscord | <DetermiedNim1> (that command is ripped straight out of a random forum post i found so idk if its fully right or not) |
03:42:39 | FromDiscord | <DetermiedNim1> i'm checking with `nm libmain.so` |
03:43:51 | FromDiscord | <Elegantbeef> `myRange` is a generic so of course it will not be exposed |
03:44:57 | FromDiscord | <janakali> `static` only possible at compile time (nim compile time), you can't expose it in C |
03:46:31 | FromDiscord | <DetermiedNim1> ohhhh ok |
03:46:34 | FromDiscord | <DetermiedNim1> makes sense |
03:46:40 | FromDiscord | <janakali> (edit) "`static` ... only" added "arguments" |
03:47:01 | FromDiscord | <DetermiedNim1> i did not know both of these things so thank you very much |
03:47:35 | FromDiscord | <DetermiedNim1> oh actually another question↵↵if i made it a seq[int] how would i access it? |
03:47:43 | FromDiscord | <DetermiedNim1> just an int array? |
03:48:20 | FromDiscord | <Elegantbeef> Nope |
03:50:54 | FromDiscord | <Elegantbeef> `seq[int]` is really `(int, ptr (int, UncheckedArray[T]))` |
03:51:04 | FromDiscord | <DetermiedNim1> i see |
03:51:15 | FromDiscord | <DetermiedNim1> oh wait so lowk im stupid and forgot to mention |
03:51:28 | FromDiscord | <DetermiedNim1> im doing the calling things with uiua |
03:51:38 | FromDiscord | <DetermiedNim1> cause i was looking into the ffi |
03:51:57 | FromDiscord | <Elegantbeef> Use an `openArray[char]` and that turns into `ptr T, int` |
03:52:07 | FromDiscord | <DetermiedNim1> (edit) "ffi" => "ffi↵https://www.uiua.org/docs/&ffi" |
03:54:30 | FromDiscord | <DetermiedNim1> https://media.discordapp.net/attachments/371759389889003532/1376045739720970310/image.png?ex=6833e5f6&is=68329476&hm=b1cbff22e446d354266058b47fbcee2bfc22015ae980c5fbcd39a29d75c9a025& |
03:55:24 | FromDiscord | <Elegantbeef> Obviously not as a return type |
04:00:49 | FromDiscord | <Elegantbeef> I mean `proc doThing(oa: var openArray[T])` turns into `proc doThing(data: ptr UncheckedArray[T], len: int)` |
04:00:50 | FromDiscord | <Elegantbeef> Not perfect, but https://github.com/beef331/seeya/blob/master/tests/mylib.nim generates https://github.com/beef331/seeya/blob/master/tests/mylib.h |
04:10:03 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "`seq[int]` is really `(int,": `(cap: int, data: ptr (len: int, UncheckedArray[T]))`? |
04:10:30 | FromDiscord | <Elegantbeef> len is the value type |
04:10:57 | FromDiscord | <Robyn [She/Her]> ah, so then cap is the pointer int before the array |
04:11:34 | FromDiscord | <Elegantbeef> Yes |
04:15:14 | FromDiscord | <Robyn [She/Her]> epic |
04:15:23 | FromDiscord | <Elegantbeef> If you say so |
04:41:08 | FromDiscord | <Robyn [She/Her]> In reply to @battery.acid.bubblegum "Anyone know if it's": beef do you know if an iterator macro is a thing or nah? |
04:41:20 | FromDiscord | <Elegantbeef> There is a for loop macro |
04:42:24 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "There is a for": oh? are there docs for it or no? |
04:42:46 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#macros-for-loop-macro |
04:44:31 | FromDiscord | <Robyn [She/Her]> yay thanks |
05:53:56 | * | tiorock joined #nim |
05:53:56 | * | rockcavera is now known as Guest8044 |
05:53:56 | * | Guest8044 quit (Killed (iridium.libera.chat (Nickname regained by services))) |
05:53:56 | * | tiorock is now known as rockcavera |
05:56:02 | * | tiorock joined #nim |
05:56:02 | * | rockcavera is now known as Guest3849 |
05:56:02 | * | tiorock is now known as rockcavera |
05:58:43 | * | Guest3849 quit (Ping timeout: 252 seconds) |
06:20:08 | * | ntat joined #nim |
06:48:09 | * | PMunch_ joined #nim |
06:50:54 | * | PMunch__ quit (Ping timeout: 252 seconds) |
07:24:55 | * | tiorock joined #nim |
07:24:55 | * | tiorock quit (Changing host) |
07:24:55 | * | tiorock joined #nim |
07:24:55 | * | rockcavera quit (Killed (lithium.libera.chat (Nickname regained by services))) |
07:24:55 | * | tiorock is now known as rockcavera |
07:27:01 | * | tiorock joined #nim |
07:27:01 | * | tiorock quit (Changing host) |
07:27:01 | * | tiorock joined #nim |
07:27:01 | * | rockcavera is now known as Guest8585 |
07:27:01 | * | Guest8585 quit (Killed (molybdenum.libera.chat (Nickname regained by services))) |
07:27:01 | * | tiorock is now known as rockcavera |
08:34:24 | * | przmk quit (Remote host closed the connection) |
08:34:49 | * | przmk joined #nim |
08:36:47 | * | przmk quit (Remote host closed the connection) |
08:37:15 | * | przmk joined #nim |
08:51:29 | * | przmk quit (Remote host closed the connection) |
08:51:55 | * | przmk joined #nim |
09:15:54 | * | tiorock joined #nim |
09:15:54 | * | tiorock quit (Changing host) |
09:15:54 | * | tiorock joined #nim |
09:15:54 | * | rockcavera quit (Killed (zinc.libera.chat (Nickname regained by services))) |
09:15:54 | * | tiorock is now known as rockcavera |
09:18:01 | * | tiorock joined #nim |
09:18:02 | * | rockcavera is now known as Guest4459 |
09:18:02 | * | tiorock is now known as rockcavera |
09:21:15 | * | Guest4459 quit (Ping timeout: 268 seconds) |
11:40:24 | * | tiorock joined #nim |
11:40:24 | * | tiorock quit (Changing host) |
11:40:24 | * | tiorock joined #nim |
11:40:24 | * | rockcavera quit (Killed (zirconium.libera.chat (Nickname regained by services))) |
11:40:24 | * | tiorock is now known as rockcavera |
11:42:31 | * | tiorock joined #nim |
11:42:31 | * | tiorock quit (Changing host) |
11:42:31 | * | tiorock joined #nim |
11:42:31 | * | rockcavera is now known as Guest108 |
11:42:31 | * | tiorock is now known as rockcavera |
11:44:58 | * | Guest108 quit (Ping timeout: 245 seconds) |
12:59:55 | * | tiorock joined #nim |
12:59:55 | * | tiorock quit (Changing host) |
12:59:55 | * | tiorock joined #nim |
12:59:55 | * | rockcavera quit (Killed (lead.libera.chat (Nickname regained by services))) |
12:59:55 | * | tiorock is now known as rockcavera |
13:02:01 | * | rockcavera is now known as Guest7676 |
13:02:01 | * | tiorock joined #nim |
13:02:01 | * | Guest7676 quit (Killed (molybdenum.libera.chat (Nickname regained by services))) |
13:02:01 | * | tiorock is now known as rockcavera |
13:16:47 | * | ntat quit (Quit: leaving) |
13:44:23 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=exnjatUW |
13:48:14 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=bwqzHyAr |
13:53:05 | FromDiscord | <lainlaylie> it's saying keys is an iterator and can't be called like that |
14:02:00 | Amun-Ra | |
14:09:24 | * | PMunch__ joined #nim |
14:12:24 | * | PMunch_ quit (Ping timeout: 260 seconds) |
14:18:34 | * | jinn6 quit (Quit: WeeChat 4.4.3) |
14:29:33 | * | jinn6 joined #nim |
14:40:18 | * | przmk quit (Remote host closed the connection) |
14:41:53 | * | przmk joined #nim |
15:16:51 | * | xet7 joined #nim |
17:16:20 | * | beholders_eye joined #nim |
17:57:06 | * | ntat joined #nim |
18:02:41 | FromDiscord | <TFed> how i can generate the same hash that i get when i'm installing my package with particular commit via nimble? |
18:02:41 | FromDiscord | <TFed> \~/nimble/pkgs2/upen-1.0.1-452edc0c4b4df26dc1058fdd58b89c24650d5c9dwhere this `452edc0c4b4df26dc1058fdd58b89c24650d5c9d` hash came from? |
18:02:41 | FromDiscord | <TFed> `~/nimble/pkgs2/upen-1.0.1-452edc0c4b4df26dc1058fdd58b89c24650d5c9d`where this `452edc0c4b4df26dc1058fdd58b89c24650d5c9d` hash came from? |
18:03:19 | FromDiscord | <TFed> also how i can determine what version i'm installing? |
18:07:14 | FromDiscord | <TFed> also is it possible to install any commit instead of last tag/HEAD? |
18:35:57 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#pasty=arsMnkqX |
18:37:10 | FromDiscord | <Elegantbeef> `nimble install package@commit` if memory serves |
18:42:26 | FromDiscord | <TFed> thank you it works with link too↵`nimble install "https://codeberg.org/tfed/[email protected]"` |
18:51:42 | FromDiscord | <TFed> i was wondering if i can require this url from `.nimble` |
18:51:43 | FromDiscord | <Elegantbeef> Of course |
18:51:43 | FromDiscord | <TFed> lemme check |
18:51:55 | FromDiscord | <Elegantbeef> Nimble is decentralized afterall a git package is a git package |
18:52:52 | FromDiscord | <TFed> sounds cool, thank you again |
19:00:06 | FromDiscord | <aintea> Why does the documentation not mention that macros are a hate/love relationship |
19:00:12 | FromDiscord | <aintea> It's so good but it's so painful |
19:00:31 | FromDiscord | <Elegantbeef> Cause you have to learn the compiler to write them and those that wrote the docs know the compiler |
19:04:37 | * | beholders_eye quit (Ping timeout: 268 seconds) |
19:09:16 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#pasty=iMrXwArj |
19:10:06 | FromDiscord | <aintea> Also I don't understand why don't case statements expand to if statements at compile time ? Is there a reason the values in the branches need to be known at compile time ? Or is that just by design |
19:10:09 | FromDiscord | <Elegantbeef> I dont't see any `nnkElifBranch`s |
19:10:47 | FromDiscord | <Elegantbeef> It's an artificial limitation likely to make the code generation simpler |
19:11:37 | * | ftajhii quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
19:12:05 | FromDiscord | <aintea> In reply to @Elegantbeef "I dont't see any": which is weird |
19:12:11 | FromDiscord | <aintea> that doesn't make any sense |
19:12:22 | FromDiscord | <Elegantbeef> What? |
19:13:37 | FromDiscord | <aintea> I don't have any nnkElifBranch in my code |
19:13:55 | FromDiscord | <Elegantbeef> Exactly |
19:13:57 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#pasty=xXzMpZCY |
19:14:00 | FromDiscord | <Elegantbeef> You're doing it wrong |
19:14:09 | FromDiscord | <aintea> how so |
19:14:29 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=rAmvnHyn |
19:14:40 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=ndDvYHzy |
19:14:55 | FromDiscord | <Elegantbeef> But you should make your match work with `nnkOfBranch` like the static ones I showed |
19:15:12 | FromDiscord | <aintea> I see |
19:15:25 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=kENVZsGa |
19:15:36 | FromDiscord | <aintea> oh that's nice |
19:15:51 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/macros.html#statements-if-statement |
19:16:59 | FromDiscord | <aintea> wait but this just lets me convert my macro into a case statement |
19:17:02 | FromDiscord | <aintea> which I do not want |
19:17:13 | FromDiscord | <aintea> I absolutely want it to expand to if statements |
19:18:48 | FromDiscord | <Elegantbeef> Who said convert it into a case statement? |
19:19:06 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#pasty=IBmjeqJq |
19:19:14 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimtrest/blob/master/staticcases.nim |
19:19:16 | FromDiscord | <Elegantbeef> Again |
19:19:16 | FromDiscord | <aintea> If i try to put this into a dumptree it errors |
19:19:27 | FromDiscord | <aintea> yeah I took a look at it and wanted to try to make it by myself |
19:19:47 | FromDiscord | <aintea> but this is a bit overkill for what I want to do |
19:19:52 | FromDiscord | <Elegantbeef> Well I used micros so you get to port it |
19:22:14 | FromDiscord | <Elegantbeef> It's literally what you're doing but intuitively |
19:23:29 | FromDiscord | <aintea> my brain hurts |
19:23:31 | FromDiscord | <aintea> thanks for helping though |
19:23:54 | FromDiscord | <aintea> Now I understand why the documentation says "use something less powerful than macros where you can" |
19:28:03 | FromDiscord | <Elegantbeef> They are user defined compiler extensions afterall |
19:30:25 | FromDiscord | <heysokam> In reply to @aintea "my brain hurts": literally why I never use them. I'd rather write 100functions manually than create one macro to write them |
19:30:50 | FromDiscord | <aintea> yeah but I'm lazy and want a good looking case statement |
19:31:13 | FromDiscord | <aintea> funnily enough when the RFC about ML-like pattern matching will be adopted my macro will be worthless |
19:31:51 | * | ftajhii joined #nim |
20:22:07 | FromDiscord | <nocturn9x> just wondering |
20:22:13 | FromDiscord | <nocturn9x> is nim's own memory allocator still unusable with threads? |
20:22:26 | FromDiscord | <nocturn9x> I've been using `-d:useMalloc` since I stopped banging my head against the wall wrt threads |
20:22:40 | FromDiscord | <nocturn9x> was wondering if I could get rid of that, given that malloc is a small but noticeable performance hit |
20:33:08 | FromDiscord | <Elegantbeef> Only way to really know is to test it using memory sanitizers |
20:33:08 | FromDiscord | <Elegantbeef> Likely↵(@nocturn9x) |
20:48:43 | FromDiscord | <nocturn9x> sad |
21:05:14 | * | xet7 quit (Remote host closed the connection) |
21:11:50 | * | PMunch_ joined #nim |
21:14:59 | * | PMunch__ quit (Ping timeout: 265 seconds) |
21:21:58 | * | ntat quit (Quit: leaving) |
21:43:52 | FromDiscord | <summarity> In reply to @nocturn9x "is nim's own memory": Source from ~1 week ago: yes. Default allocator leaks, malloc doesn't (tested in a real-world web service) |
21:44:09 | FromDiscord | <nocturn9x> oh it leaks that's a fun addition |
21:44:14 | FromDiscord | <nocturn9x> I thought it just had race conditions |
22:23:04 | * | fabricio joined #nim |
23:14:08 | FromDiscord | <Robyn [She/Her]> Iirc there were ppl interested in a nice API for a TOML parser, right? I decided against making my own and am just using https://github.com/NimParsers/parsetoml which is mostly compliant |
23:14:33 | FromDiscord | <Robyn [She/Her]> I also made a minimal deserialisation layer which I can share if wanted |
23:15:09 | FromDiscord | <Robyn [She/Her]> (Mostly compliant with 1.0.0, there weren't many changes so...) |
23:34:05 | FromDiscord | <.tokyovigilante> sent a code paste, see https://play.nim-lang.org/#pasty=taExBgqm |
23:34:30 | FromDiscord | <.tokyovigilante> (edit) "https://play.nim-lang.org/#pasty=itndfjgF" => "https://play.nim-lang.org/#pasty=YbJcxdWS" |
23:35:20 | FromDiscord | <.tokyovigilante> I've been then taking advantage of that to not initialise object members that I want to be zero (or null in the case of pointers) but it has just bitten me when trying to use that for C interop. |
23:35:58 | FromDiscord | <.tokyovigilante> Concretely, using the Vulkan API, passing in a createInfo struct assuming that non-initialised members are 0 or null and this not working. |
23:41:54 | FromDiscord | <demotomohiro> How to put objects on memory without allocation?↵If you declare variables outside of procs, it is allocated and initialized when the process is created.↵When you declare inside procs, it is allocated on the stack and initialized when the proc is called.↵https://zevv.nl/nim-memory/ |
23:55:53 | FromDiscord | <.tokyovigilante> sent a code paste, see https://play.nim-lang.org/#pasty=BnNgLoaU |
23:57:36 | FromDiscord | <.tokyovigilante> I would expect `testObject` to be stack allocated, with space for the `integer` member, but is the output of `echo integer` 0, some random number from uninitialised memory, or... something else? I am expecting the object to be allocated, just not sure if the memory is initialised to zero. |