<< 20-04-2025 >>

00:05:28*xet7 quit (Remote host closed the connection)
00:12:43*derpydoo joined #nim
00:23:38FromDiscord<devlop_gaming> Anyone know what $home returns on windows?
00:27:15FromDiscord<devlop_gaming> I just wanna be sure i'm right
01:21:21FromDiscord<DetermiedNim1> hey guys
01:21:28FromDiscord<DetermiedNim1> quick c2nim question
01:22:08FromDiscord<DetermiedNim1> if i wanna wrap smth like [wren](https://github.com/wren-lang/wren)
01:22:19FromDiscord<DetermiedNim1> (edit) "if i wanna wrap smth like [wren](https://github.com/wren-lang/wren) ... " added "with c2nim"
01:22:33FromDiscord<DetermiedNim1> should i use it on all of the source files too
01:23:03FromDiscord<DetermiedNim1> i was also looking at futhark but i couldnt figure out how to do things like assign callbacks and stuff
01:32:23FromDiscord<heysokam> @DetermiedNim1 should look into futhark. c2nim fails a lot
01:37:02FromDiscord<DetermiedNim1> this works so far https://media.discordapp.net/attachments/371759389889003532/1363327565317673173/image.png?ex=6805a13c&is=68044fbc&hm=d757e45af648f24aa0b8b057f213b9c05c02af2580aae21a531effd708a63cbe&
01:43:32FromDiscord<DetermiedNim1> should i just use ptr cint and cchar for these https://media.discordapp.net/attachments/371759389889003532/1363329203134795917/image.png?ex=6805a2c3&is=68045143&hm=6be18f642d7595a946f014dbdf70fcb792abdce18c2be13976194f3600cae9ba&
01:45:36FromDiscord<heysokam> `cstring` probably
01:46:03FromDiscord<heysokam> but yea, for the resulting wrapper you need to use the `c` compatible types
01:46:26FromDiscord<heysokam> if you want nim-ified bindings, you need to create wrapper functions for them
01:47:51FromDiscord<DetermiedNim1> ok
01:47:53FromDiscord<DetermiedNim1> uh
01:47:55FromDiscord<DetermiedNim1> also
01:48:00FromDiscord<DetermiedNim1> what does this mean https://media.discordapp.net/attachments/371759389889003532/1363330327438688356/image.png?ex=6805a3cf&is=6804524f&hm=eec3c3502b789f6d91e6422e253da3823aa166feac66a7083d5e5c8ff0914be8&
01:48:13FromDiscord<DetermiedNim1> i know is a pointer
01:48:34FromDiscord<Elegantbeef> address of `config`
01:48:39FromDiscord<DetermiedNim1> ahh
01:48:46FromDiscord<DetermiedNim1> so do i just use addr
01:48:56FromDiscord<Elegantbeef> yes
01:52:30FromDiscord<DetermiedNim1> https://media.discordapp.net/attachments/371759389889003532/1363331464443199688/image.png?ex=6805a4de&is=6804535e&hm=56a1ea6d0188ce30466a816a608b65e2d6a1ff5afbebd7924f4be03806589273&
01:52:46FromDiscord<DetermiedNim1> https://media.discordapp.net/attachments/371759389889003532/1363331526611173436/image.png?ex=6805a4ed&is=6804536d&hm=30a9f06c18f01d4a7c263db44c95936948e116dd32e79aa26b2772b963d09f83&
01:52:59FromDiscord<DetermiedNim1> why did i screenshot these
01:53:12FromDiscord<DetermiedNim1> `/home/mech/temp/main.nim(30, 22) Error: type mismatch: got 'proc (vm: struct_WrenVM, text: ptr cchar){.cdecl, gcsafe.}' for 'writeFn' but expected 'WrenWriteFn_520094163 = proc (a0: ptr struct_WrenVM, a1: cstring){.cdecl.}'`
01:53:31FromDiscord<DetermiedNim1> wrenInitConfiguration(addr config)↵ config.writeFn = writeFn↵ config.errorFn = errorFn
01:53:40FromDiscord<DetermiedNim1> (edit) "wrenInitConfiguration(addr config)↵ config.writeFn = writeFn↵ config.errorFn = errorFn" => "sent a code paste, see https://play.nim-lang.org/#pasty=eOuFlZQu"
01:53:55FromDiscord<DetermiedNim1> (edit) "`/home/mech/temp/main.nim(30, 22) Error: type mismatch: got 'proc (vm: struct_WrenVM, text: ptr cchar){.cdecl, gcsafe.}' for 'writeFn' but expected 'WrenWriteFn_520094163 = proc (a0: ptr struct_WrenVM, a1: cstring){.cdecl.}'`" => "sent a code paste, see https://play.nim-lang.org/#pasty=RvHDiJHK"
01:59:17FromDiscord<DetermiedNim1> sent a code paste, see https://paste.rs/QZZoT
01:59:36FromDiscord<Elegantbeef> Is it a `const`?
01:59:41FromDiscord<DetermiedNim1> iuh hold on
02:00:31FromDiscord<DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=JDkNTuKu
02:00:38FromDiscord<DetermiedNim1> (edit) "https://play.nim-lang.org/#pasty=AZKrbiRG" => "https://play.nim-lang.org/#pasty=tGsVoPxZ"
02:00:58FromDiscord<Elegantbeef> procedures don't have address in Nim just pass the procedure
02:01:07FromDiscord<DetermiedNim1> ahh ok
02:01:25FromDiscord<DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=jKabosKC
02:01:47FromDiscord<Elegantbeef> cstring vs. ptr ccgar
02:02:27FromDiscord<DetermiedNim1> ok i fixed that
02:02:30FromDiscord<DetermiedNim1> i get the same thing
02:02:55FromDiscord<Elegantbeef> `ptr struct` vs `struct`
02:03:14FromDiscord<DetermiedNim1> oooh↵wait so how should i convert
02:03:17FromDiscord<DetermiedNim1> for the future
02:03:43FromDiscord<Elegantbeef> I don't know what the API is and what you're doing
02:04:54FromDiscord<heysokam> In reply to @determiedmech1 "oooh wait so how": that's a question that cannot be easily answered, because that symbol in C means different things
02:05:08FromDiscord<heysokam> need to provide more context on what you mean by `` exactly
02:05:08FromDiscord<DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=UdqlxlrX
02:05:12FromDiscord<DetermiedNim1> this is the C
02:05:21FromDiscord<heysokam> `ptr WremVM`
02:05:30FromDiscord<heysokam> `const char` is `cstring`
02:05:58FromDiscord<Elegantbeef> That's not the source of the error though as the definitions were `vm, ptr cchar`
02:05:59FromDiscord<DetermiedNim1> In reply to @Elegantbeef "I don't know what": https://github.com/wren-lang/wren/blob/main/example/embedding/main.c↵↵im replicating this
02:06:51FromDiscord<DetermiedNim1> wait
02:06:56FromDiscord<DetermiedNim1> no compile error
02:07:38FromDiscord<DetermiedNim1> welp ofc i forgot to actually call main()
02:07:43FromDiscord<DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=hURoixbF
02:08:03FromDiscord<Elegantbeef> You need to link the shared library
02:08:13FromDiscord<DetermiedNim1> ah ok
02:08:34FromDiscord<DetermiedNim1> passl pragma right?
02:09:23FromDiscord<Elegantbeef> Yes
02:09:47FromDiscord<DetermiedNim1> YES
02:09:56FromDiscord<DetermiedNim1> it works!
02:10:00FromDiscord<DetermiedNim1> thanks guys
02:12:04FromDiscord<heysokam> #noice
02:13:56FromDiscord<DetermiedNim1> ok so weird compilation error
02:14:12FromDiscord<DetermiedNim1> when i switch from `./wren/src/include` to "/usr/include"
02:15:07FromDiscord<DetermiedNim1> sent a long message, see https://pasty.ee/aYXcLdOq
02:15:16FromDiscord<DetermiedNim1> (edit) "long message," => "code paste," | "https://pasty.ee/VzpLfvbI" => "https://play.nim-lang.org/#pasty=APYLocwk"
02:15:21FromDiscord<DetermiedNim1> (edit) ""/usr/include"" => "`/usr/include`"
02:15:54FromDiscord<DetermiedNim1> this doesnt give that error tho https://media.discordapp.net/attachments/371759389889003532/1363337349546770532/image.png?ex=6805aa59&is=680458d9&hm=1ac615a84c33008d06ca705fafa519c8d11c0c6a115589af408f7d1ed862d76b&
02:15:59FromDiscord<DetermiedNim1> so ill just use this
02:16:39FromDiscord<Elegantbeef> That's a normal issue with futhark cause the VM has safety rails
02:16:40FromDiscord<DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=EyeThDgD
02:16:44FromDiscord<DetermiedNim1> ah ok
02:16:54FromDiscord<DetermiedNim1> yeah its not that big of a deal anyways
02:17:06FromDiscord<Elegantbeef> Yea you just have to increase the limit and compile
02:17:15FromDiscord<DetermiedNim1> time to program an frc robot in nim 😈
02:35:58FromDiscord<Robyn [She/Her]> In reply to @determiedmech1 "time to program an": frc?
02:41:01FromDiscord<heysokam> he meant rfc. its a robot that automatically creates useful features for the compiler and tools, fixes everyone's code, and also updates the entire community projects to have clean code standards and documentation 😏
02:41:45FromDiscord<heysokam> I could also have misunderstood, and he just meant `French C`, who knows
02:48:47FromDiscord<Robyn [She/Her]> aab
02:48:59FromDiscord<Robyn [She/Her]> (edit) "aab" => "aah"
02:54:39FromDiscord<DetermiedNim1> nah frc
02:54:45FromDiscord<DetermiedNim1> first robotics competition
02:55:10FromDiscord<DetermiedNim1> most teams use Java but there are C and Python APIs for WPILib
02:55:26FromDiscord<DetermiedNim1> sent a code paste, see https://paste.rs/qWV3D
02:56:47FromDiscord<DetermiedNim1> https://wpilib.org/↵https://github.com/wpilibsuite/allwpilib
02:57:01FromDiscord<DetermiedNim1> frc is so cool and awesome I love robotics competitions
02:57:19FromDiscord<DetermiedNim1> probably one of the main things that got me into coding
03:02:10FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=lUVATNnc
03:02:43FromDiscord<heysokam> callbacks are always awkward like that. you need to send the exact shape, so the nim side is always a bit ugly
03:02:53FromDiscord<heysokam> happens with wgpu and glfw too
03:06:35*FromDiscord quit (Remote host closed the connection)
03:06:48*FromDiscord joined #nim
03:09:38FromDiscord<DetermiedNim1> In reply to @heysokam "seems like the callback": in the same place where it wants a `cstring` on my laptop
03:11:00FromDiscord<DetermiedNim1> This error is from my phone (Android REL 13 armv8l)(taken from fastfetch)
03:12:20FromDiscord<DetermiedNim1> also I don't think I can convert a `string` to `ptr uint8` so idk what it's yapping about
03:12:23FromDiscord<theloserscandy> I've got an education/documentation question. When learning a couple other languages, I found the documentation easy to search through to find the function I needed. Nim has been a lot more difficult and I am hoping to get some advice on the best way to "find stuff"? I 've used the search function on the [Nim Standard Library docs](https://nim-lang.org/docs/lib.html), but it can often give a list of answers, some of which are even
03:13:28FromDiscord<DetermiedNim1> I've been using the std docs, nim by example, and the forums
03:13:47FromDiscord<leorize> I hate to say this but this chat is probably the best search engine
03:13:57FromDiscord<DetermiedNim1> lol
03:13:59FromDiscord<DetermiedNim1> real
03:14:05FromDiscord<DetermiedNim1> OMG WAIT THAT IS SO REAL
03:14:10FromDiscord<DetermiedNim1> I haven't even thought about that
03:14:16FromDiscord<DetermiedNim1> before now
03:14:21FromDiscord<DetermiedNim1> but it's such a good idea
03:17:15FromDiscord<DetermiedNim1> Oh also are the physical books worth it
03:18:17*alexdaguy joined #nim
03:19:53FromDiscord<Robyn [She/Her]> `addr myStr.cstring[0]`↵(@DetermiedNim1)
03:20:14FromDiscord<Robyn [She/Her]> or even `addr myStr[0]`
03:20:16FromDiscord<DetermiedNim1> ah
03:20:22FromDiscord<DetermiedNim1> oh wait that makes sense
03:20:46FromDiscord<DetermiedNim1> that would be the start of the memory used my myStr right?
03:21:30FromDiscord<DetermiedNim1> now I'm thinking with po~~rtals~inters
03:21:30FromDiscord<Robyn [She/Her]> The string's buffer without the length and cap data yeah↵(@DetermiedNim1)
03:21:39FromDiscord<DetermiedNim1> (edit) "po~~rtals~inters" => "po~~rtals~~inters"
03:22:24FromDiscord<DetermiedNim1> ah ok
03:22:36FromDiscord<Robyn [She/Her]> Nim strings are also null terminated so this should be relatively safe as long as the pointer isn't kept after the lifetime of the string
03:25:31FromDiscord<DetermiedNim1> okok
03:25:39FromDiscord<DetermiedNim1> idk how to determine that
03:26:21FromDiscord<DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=vmBhAUjU
03:26:43FromDiscord<DetermiedNim1> This works perfectly as long as you have wren installed
03:27:04FromDiscord<DetermiedNim1> (edit) "https://play.nim-lang.org/#pasty=VwdAVWfK" => "https://play.nim-lang.org/#pasty=NUiNYMyB"
03:27:19FromDiscord<DetermiedNim1> Not on Termux tho
03:29:05FromDiscord<Robyn [She/Her]> basically the scope outside a string was defined in↵(@DetermiedNim1)
03:29:24FromDiscord<Robyn [She/Her]> But if you have long lived string pointers, copy to a cstring and free it yourself if needed
03:29:35FromDiscord<DetermiedNim1> okay
03:30:12FromDiscord<DetermiedNim1> Oh wait I might not need those casts
03:30:20FromDiscord<DetermiedNim1> I'll have to test it tmr
03:42:31FromDiscord<dusa2986> Can nim compile to C++ source code that you can look at before compiling?
03:46:00FromDiscord<janakali> yes, generated code is in cache folder. You can set custom directory for cache with a flag: `nim cpp --nimcache:cppsource somefile.nim`
03:49:33FromDiscord<Laylie> see also -c, --compileOnly
03:50:30FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=qsMFICdz
03:50:47FromDiscord<heysokam> (edit) "https://play.nim-lang.org/#pasty=bSYJnczR" => "https://play.nim-lang.org/#pasty=cOsvJoXx"
03:51:45FromDiscord<dusa2986> Thank you all. Is it gibberish like the JavaScript code that is generated?
03:51:54FromDiscord<heysokam> most likely
04:05:51*amadaluzia joined #nim
04:06:47FromDiscord<Robyn [She/Her]> In reply to @dusa2986 "Can nim compile to": do note it's not made for human consumption
04:07:01FromDiscord<Robyn [She/Her]> In reply to @dusa2986 "Thank you all. Is": yeah pretty much
04:07:07FromDiscord<dusa2986> Understood
04:07:43FromDiscord<DetermiedNim1> In reply to @battery.acid.bubblegum "do note it's not": shudders Nim generated JS is a fine example of that
04:07:45FromDiscord<dusa2986> If I were to work at a job that required cpp code and sent them the generated code id probably be fired huh?
04:07:52FromDiscord<DetermiedNim1> 😭
04:08:14FromDiscord<DetermiedNim1> ultimate c programmer right here
04:08:21FromDiscord<DetermiedNim1> (edit) "c" => "cpp"
04:09:23FromDiscord<dusa2986> I want to make a gameboy emulator in nim. One with garbage collection and one without.
04:10:12FromDiscord<dusa2986> Do yall think that if Nim was backed by a corporation it would be more popular?
04:10:35FromDiscord<odexine> yes but not by much
04:13:29FromDiscord<dusa2986> Ah. I’ve always felt that nim should be more popular. Could literally be used for anything.
04:14:16FromDiscord<odexine> well development has been somewhat shaky for a few years
04:14:41FromDiscord<Laylie> normies would still just glance at it once and go "ew style insensitivity" and leave
04:16:32FromDiscord<dusa2986> In reply to @odexine "well development has been": What has happened? Devs leaving the project?
04:19:09FromDiscord<odexine> quite a few have yes
04:19:28FromDiscord<odexine> not really core devs but trusted long-time users
04:21:55FromDiscord<dusa2986> Drama or just retiring?
04:22:06FromDiscord<odexine> drama
04:23:15FromDiscord<dusa2986> Can i possibly get a history? What’s happened?
05:08:11FromDiscord<odexine> uh i dont know how to condense like, 5 years of history
05:38:29*xet7 joined #nim
05:54:52FromDiscord<janakali> @Dustin you can find some context here (read comments by haxscramper): https://news.ycombinator.com/item?id=32021299
05:55:11FromDiscord<janakali> (edit) "@Dustin" => "@dusa2986 "
06:28:57FromDiscord<leorize> Nim has a major corporate sponsor who is big in the cryptocurrency sphere\: [Status](https://status.app/)↵(@dusa2986)
06:30:12FromDiscord<leorize> though for some reasons there aren't any reference to the relationship anymore in the home page, but they do come by and request changes in the internal rooms and Nim core devs send code to their projects
06:31:36FromDiscord<dusa2986> In reply to @janakali "<@513003997205102594> you can": Interesting
06:31:53FromDiscord<dusa2986> In reply to @leorize "though for some reasons": Nice. Good to know
06:51:24*amadaluzia quit (Quit: Hi, this is Paul Allen. I'm being called away to London for a few days. Meredith, I'll call you when I get back. Hasta la vista, baby.)
06:51:53*amadaluzia joined #nim
06:53:27*xet7 quit (Remote host closed the connection)
09:22:59FromDiscord<tomo_kimpesa> Nim is honestly slowly becoming my first choice for most of my projects
09:38:02FromDiscord<Laylie> why not quickly?
09:39:14*Guest17 joined #nim
09:42:04*Guest17 left #nim (#nim)
09:50:23FromDiscord<aintea> In reply to @dusa2986 "Do yall think that": Pretty sure big streamers/devs using it and talking about it would make a much bigger impact
09:50:36FromDiscord<aintea> Like Theprimeagen did with Rust, OCaml and Go
09:50:50FromDiscord<aintea> And TJ with elixir
09:50:58FromDiscord<dusa2986> In reply to @aintea "Like Theprimeagen did with": I’m sure he made a video about him
09:51:03FromDiscord<dusa2986> (edit) "him" => "nin"
09:51:07FromDiscord<dusa2986> (edit) "nin" => "nim"
09:51:19FromDiscord<aintea> Yes, but it was only a review of the 2.0.0 patchnote
09:51:59FromDiscord<aintea> And he said he "really wanted to learn Nim but it seemed too complicated" mostly because he misunderstood the `` as a pointer and not a public declarator
09:52:29FromDiscord<aintea> When I finish the Nimlings I'll ask him to try to learn Nim with the multiple supports there are
09:52:54FromDiscord<aintea> Things like the Rustlings or Ziglings get a lot of attention to learn because in about 2 hours of exercising you learn 80% of the language
09:53:22FromDiscord<aintea> Btw do you guys know how I could ask some people here if they want to contribute to the project ?
09:54:54FromDiscord<dusa2986> Another YouTuber called Mike Shah did a video on it and said that it didn’t seem like Nim knew what it wanted to be.
09:55:40FromDiscord<aintea> Yeah and in the comments he changed his opinion because people were telling him about Nim being able to extend its syntax with templates and macros
09:56:19FromDiscord<aintea> The only "good" point he made was that Nim has exceptions yet recommends you to use results
09:56:50FromDiscord<aintea> The manual memory management with garbage collected standard library isn't a good argument imo
09:58:01FromDiscord<aintea> Basically Nim is a language that's supposed to be fast to develop with, fast to run, and can go anywhere (frontend, backend, CLI tools, embedded, ...) and that can be extended with the macros
09:58:14FromDiscord<dusa2986> Yes
09:58:18FromDiscord<aintea> It's a Python and Rust baby
09:58:32FromDiscord<dusa2986> That’s a cool way to say it
09:58:38FromDiscord<dusa2986> Never heard of it like that
09:59:25FromDiscord<dusa2986> I really like how you can turn off the GC if you want to.
09:59:36FromDiscord<aintea> The thing is for the moment it only really lacks good pattern matching (that's only my opinion btw), and fame (like I said, a well known streamer/dev using it would help a lot)
09:59:44FromDiscord<dusa2986> And use other Languages GC like Go’s GC
10:00:08FromDiscord<dusa2986> In reply to @aintea "The thing is for": Definitely
10:00:15FromDiscord<aintea> In reply to @dusa2986 "I really like how": Yes, that lets you use Nim in the embedded field
10:00:37FromDiscord<aintea> And let's you shoot yourself in the foot blazingly fast
10:00:51FromDiscord<dusa2986> Just like C lol
10:01:02FromDiscord<aintea> Yes but C doesn't have a defer keyword
10:01:19FromDiscord<aintea> That helps a lot with memory management
10:01:29FromDiscord<dusa2986> C was built to be simple.
10:01:54FromDiscord<aintea> Yes
10:01:57FromDiscord<aintea> Just like Go
10:02:13FromDiscord<aintea> Nothing fancy, everything is simple
10:02:17FromDiscord<dusa2986> Go should remove their GC
10:02:27FromDiscord<dusa2986> Or at least make it optional
10:02:28FromDiscord<aintea> That's an opinion I can hear
10:02:46FromDiscord<aintea> But it does work pretty well at the moment
10:02:55FromDiscord<aintea> If people want to manage their memory they go with C or Zig
10:03:12FromDiscord<aintea> If they want a higher level and don't want to deal with memory they go with Go
10:03:15FromDiscord<dusa2986> I want to try zig but it’s too new right now
10:03:24FromDiscord<aintea> It's not, the ecosystem is good
10:03:37FromDiscord<aintea> Go try it, I would really recommend it if it fits your usecase
10:03:51FromDiscord<dusa2986> Emulator development at the moment
10:04:08FromDiscord<dusa2986> One reason I thought of Nim
10:04:09FromDiscord<aintea> No idea about that, I'm not an emulator developer
10:04:24FromDiscord<aintea> You can use Assembly to make your emulator tho
10:04:28FromDiscord<dusa2986> Speed is the name of the game
10:04:40FromDiscord<aintea> With assembly, speed is the only thing you'll get
10:04:49FromDiscord<dusa2986> In reply to @aintea "You can use Assembly": I don’t have the time to learn assembly. I have a full time job and daughter lol
10:05:14FromDiscord<dusa2986> Also emulators are extremely complex depending on what you are trying to emulate
10:05:17FromDiscord<aintea> Even with none of that, if you have a will to live don't learn assembly
10:05:52FromDiscord<dusa2986> lol
10:06:30FromDiscord<heysokam> In reply to @dusa2986 "I want to try": its not. its really stable. its creator promotes it as unstable because he wants freedom to fully rework the compiler when he wants to before 1.0. but 0.13 has been extremely stable for many months
10:07:01FromDiscord<dusa2986> In reply to @heysokam "its not. its really": Good to know.
10:09:43*derpydoo quit (Quit: derpydoo)
10:10:49FromDiscord<leorize> 0.14 is out and it has many breaking changes
10:10:59FromDiscord<leorize> including an overhaul to their packages system that breaks everyone
10:11:03FromDiscord<leorize> so no, zig is not stable
10:11:06FromDiscord<aintea> Yeah but he's talking about emulator capabilities
10:11:06FromDiscord<aintea> I have no idea about emulators because that's not my thing
10:12:24FromDiscord<leorize> it doesn't sound like emulators have anything to do with this
10:15:11FromDiscord<dusa2986> In reply to @leorize "it doesn't sound like": I was looking for languages that would be versatile and fast. Right now my goal is emulators and Nim seems like a good option. Also if I have any other needs for software development it should fit those needs as well.
10:20:18FromDiscord<heysokam> Depends on what you call stable: stdlib or compiler↵I haven't had a single compiler issue on zig in an entire year↵Has the stdlib changed in that year? yea, once
10:21:21FromDiscord<heysokam> I'd argue that's stable enough for a daily driver for 90% of people 🤷‍♂️
10:29:50FromDiscord<nnsee> In reply to @heysokam "Depends on what you": you can't really look at those in a vacuum - if you're using a language, you will probably definitely be using the stdlib and not just the compiler alone unless the language has specific facilities for writing stdlib-free code (ie `no_std` in rust)
10:30:10FromDiscord<nnsee> you also seem to be conflating the meanings of stability
10:30:47FromDiscord<nnsee> _stable_ in this scenario doesn't mean _doesn't crash or have bugs_, it means _doesn't have breaking changes_ - if, going by your example, the stdlib has had a breaking change in the last year, it definitely isn't stable
11:02:53FromDiscord<monkoose4407> sent a code paste, see https://play.nim-lang.org/#pasty=MnrrxrNW
11:03:47FromDiscord<monkoose4407> (edit) "https://play.nim-lang.org/#pasty=riHNLhyQ" => "https://play.nim-lang.org/#pasty=qMAZIpWy"
11:38:53FromDiscord<Laylie> it works if you make it `p: Parent` i.e. remove `var`
11:41:24FromDiscord<Laylie> i guess because replacing the Child with a Parent (which the `var` allows you to do) results in an invalid Child
11:48:29FromDiscord<monkoose4407> thanks, seems to work. There is no consequences of doing it like so?
11:56:58FromDiscord<monkoose4407> sent a code paste, see https://play.nim-lang.org/#pasty=uDtKBbqH
13:54:39*alexdaguy quit (Quit: oop)
14:13:17*beholders_eye joined #nim
14:19:54FromDiscord<ajusa> Are there any serialization libraries that support versioning? More specifically, I want to be able to save a blob, and read it back after adding new fields to a type. I don't think flatty supports this
14:20:56FromDiscord<Robyn [She/Her]> that's probably logic you'd need to add yourself
14:29:54*beholders_eye quit (Ping timeout: 260 seconds)
14:33:03FromDiscord<enthus1ast.> There was a talk from someone of the community, he made a type "merger" macro I forgot his name
14:33:18FromDiscord<enthus1ast.> And he used that for DB migration
14:33:54FromDiscord<enthus1ast.> Type merger and type differ macro
14:43:04FromDiscord<ajusa> Hm, I don't need to support renaming fields or changing the type, just adding. I know jsony supports this, but that's just how json works.↵↵I'll look into the type merger macro, maybe I can find it
14:51:45FromDiscord<lainlaylie> probably this talk: https://www.youtube.com/watch?v=d2VRuZo2pdA↵and this macro: https://github.com/deech/NimNuggets/blob/master/backup/migrationmacros.nim
15:00:18FromDiscord<heysokam> In reply to @monkoose4407 "And one more oop": > Maybe I should try to reduce oop usage in nim? But it's hard for me to think differently especially in gamedev field.↵Nim does not support OOP, it only supports single inheritance and its really not that useful when you get used to think in the "no, not everything is (or needs to be) a class" mindset
15:01:16FromDiscord<heysokam> functions can be overloaded, and you can call them with `Type.thing()` or `thing.other()`, so the main readability benefit is still there
15:01:49FromDiscord<ajusa> In reply to @lainlaylie "probably this talk: https://www.youtube.com/watch?v": Yep I managed to find the talk and was watching it. Thanks for the code link!
15:02:13FromDiscord<heysokam> In reply to @heysokam "functions can be overloaded,": once you start thinking like that, you naturally fall into Composition instead of Inheritance naturally
15:02:40FromDiscord<heysokam> that's what this lang is good at, from an OOP concepts frame of mind
15:02:48FromDiscord<enthus1ast.> Yes deech
15:03:46FromDiscord<enthus1ast.> Composition and or ecs
16:18:27*beholders_eye joined #nim
16:54:05FromDiscord<ajusa> sent a long message, see https://pasty.ee/lPPfTMzn
16:58:17FromDiscord<Elegantbeef> This is how generics work
16:58:27FromDiscord<Elegantbeef> The first instantiation is used by all types
17:00:03FromDiscord<Elegantbeef> You can bypass this by calling `parseHook` explicitly inside the one module instead of calling the generic that uses `parseHook`, but generics are bind once procedure which ensures things like `hash` are the same throughout your project, but it also means import order matters
17:01:00FromDiscord<Elegantbeef> The downside of adhoc generics is they're adhoc 😄
17:05:52*ntat joined #nim
17:15:41FromDiscord<ajusa> > calling parseHook explicitly in the one module↵That works, but I'm a bit more concerned about having to do this in modules I don't own (say an HTTP client for an API). I didn't think about the import order either... ah well
17:16:43FromDiscord<Elegantbeef> Well only want a single json hook then 😄
17:16:46FromDiscord<ajusa> The actual problem I have is an HTTP client for an API that parses times, and then I serialize/deserialize information back to JSON in a different module. Both are imported by my main module.
17:17:25FromDiscord<ajusa> So it parses the date/time properly, and then after serializing/deserializing it throws an error as the format doesn't match.
17:17:37FromDiscord<ajusa> single JSON hook?
17:18:27FromDiscord<Elegantbeef> Well you want two different `parseHook` based off context no?
17:20:05FromDiscord<ajusa> basically yeah
17:20:21FromDiscord<ajusa> I want one context to use the default hook, and another to have it be overwritten
17:20:38FromDiscord<Elegantbeef> Yea stop that 😄
17:20:55FromDiscord<ajusa> ah yes, the old "define the problem out of existence"
17:21:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=zNWvYoVa
17:22:06FromDiscord<Elegantbeef> Or you could use a `type SpecialTime = distinct Time` and in places you want the hook use that
17:22:15FromDiscord<ajusa> yep the distinct type was the other option I explored
17:23:06FromDiscord<ajusa> I guess this is just the way it is (and like you mentioned, how hash works). It feels weird that I change the behavior of module B when I import it with module A.
17:23:52FromDiscord<Elegantbeef> Adhoc generics both are good and bad
17:33:09FromDiscord<Elegantbeef> Worth noting even in languages like Rust with explicit generics through traits you get only bind ones generics so you need to new type using a distinct aswell
17:34:59FromDiscord<ajusa> gotcha, thanks for clarifying!
17:36:03FromDiscord<Elegantbeef> But since Rust traits are explicit you don't have import order mattering
18:25:00*beholders_eye quit (Ping timeout: 268 seconds)
19:13:09*beholders_eye joined #nim
20:08:45*ntat quit (Quit: leaving)
20:51:59*amadaluzia quit (Ping timeout: 260 seconds)
20:56:32*amadaluzia joined #nim
22:15:40FromDiscord<DetermiedNim1> how would i wrap cpp classes into nim
22:24:49FromDiscord<DetermiedNim1> or does futhark secretly work with cpp
22:35:15*skippy8 joined #nim
22:55:10FromDiscord<demotomohiro> In reply to @determiedmech1 "how would i wrap": Nim manual explains how to do that: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma
23:07:14FromDiscord<user2m> how would you guys store sensitive info like an ssn in your db? I know it needs to be encoded then decoded later - what libs are there for nim?
23:16:50*skippy8 quit (Quit: WeeChat 4.4.2)