00:05:28 | * | xet7 quit (Remote host closed the connection) |
00:12:43 | * | derpydoo joined #nim |
00:23:38 | FromDiscord | <devlop_gaming> Anyone know what $home returns on windows? |
00:27:15 | FromDiscord | <devlop_gaming> I just wanna be sure i'm right |
01:21:21 | FromDiscord | <DetermiedNim1> hey guys |
01:21:28 | FromDiscord | <DetermiedNim1> quick c2nim question |
01:22:08 | FromDiscord | <DetermiedNim1> if i wanna wrap smth like [wren](https://github.com/wren-lang/wren) |
01:22:19 | FromDiscord | <DetermiedNim1> (edit) "if i wanna wrap smth like [wren](https://github.com/wren-lang/wren) ... " added "with c2nim" |
01:22:33 | FromDiscord | <DetermiedNim1> should i use it on all of the source files too |
01:23:03 | FromDiscord | <DetermiedNim1> i was also looking at futhark but i couldnt figure out how to do things like assign callbacks and stuff |
01:32:23 | FromDiscord | <heysokam> @DetermiedNim1 should look into futhark. c2nim fails a lot |
01:37:02 | FromDiscord | <DetermiedNim1> this works so far https://media.discordapp.net/attachments/371759389889003532/1363327565317673173/image.png?ex=6805a13c&is=68044fbc&hm=d757e45af648f24aa0b8b057f213b9c05c02af2580aae21a531effd708a63cbe& |
01:43:32 | FromDiscord | <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:36 | FromDiscord | <heysokam> `cstring` probably |
01:46:03 | FromDiscord | <heysokam> but yea, for the resulting wrapper you need to use the `c` compatible types |
01:46:26 | FromDiscord | <heysokam> if you want nim-ified bindings, you need to create wrapper functions for them |
01:47:51 | FromDiscord | <DetermiedNim1> ok |
01:47:53 | FromDiscord | <DetermiedNim1> uh |
01:47:55 | FromDiscord | <DetermiedNim1> also |
01:48:00 | FromDiscord | <DetermiedNim1> what does this mean https://media.discordapp.net/attachments/371759389889003532/1363330327438688356/image.png?ex=6805a3cf&is=6804524f&hm=eec3c3502b789f6d91e6422e253da3823aa166feac66a7083d5e5c8ff0914be8& |
01:48:13 | FromDiscord | <DetermiedNim1> i know is a pointer |
01:48:34 | FromDiscord | <Elegantbeef> address of `config` |
01:48:39 | FromDiscord | <DetermiedNim1> ahh |
01:48:46 | FromDiscord | <DetermiedNim1> so do i just use addr |
01:48:56 | FromDiscord | <Elegantbeef> yes |
01:52:30 | FromDiscord | <DetermiedNim1> https://media.discordapp.net/attachments/371759389889003532/1363331464443199688/image.png?ex=6805a4de&is=6804535e&hm=56a1ea6d0188ce30466a816a608b65e2d6a1ff5afbebd7924f4be03806589273& |
01:52:46 | FromDiscord | <DetermiedNim1> https://media.discordapp.net/attachments/371759389889003532/1363331526611173436/image.png?ex=6805a4ed&is=6804536d&hm=30a9f06c18f01d4a7c263db44c95936948e116dd32e79aa26b2772b963d09f83& |
01:52:59 | FromDiscord | <DetermiedNim1> why did i screenshot these |
01:53:12 | FromDiscord | <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:31 | FromDiscord | <DetermiedNim1> wrenInitConfiguration(addr config)↵ config.writeFn = writeFn↵ config.errorFn = errorFn |
01:53:40 | FromDiscord | <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:55 | FromDiscord | <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:17 | FromDiscord | <DetermiedNim1> sent a code paste, see https://paste.rs/QZZoT |
01:59:36 | FromDiscord | <Elegantbeef> Is it a `const`? |
01:59:41 | FromDiscord | <DetermiedNim1> iuh hold on |
02:00:31 | FromDiscord | <DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=JDkNTuKu |
02:00:38 | FromDiscord | <DetermiedNim1> (edit) "https://play.nim-lang.org/#pasty=AZKrbiRG" => "https://play.nim-lang.org/#pasty=tGsVoPxZ" |
02:00:58 | FromDiscord | <Elegantbeef> procedures don't have address in Nim just pass the procedure |
02:01:07 | FromDiscord | <DetermiedNim1> ahh ok |
02:01:25 | FromDiscord | <DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=jKabosKC |
02:01:47 | FromDiscord | <Elegantbeef> cstring vs. ptr ccgar |
02:02:27 | FromDiscord | <DetermiedNim1> ok i fixed that |
02:02:30 | FromDiscord | <DetermiedNim1> i get the same thing |
02:02:55 | FromDiscord | <Elegantbeef> `ptr struct` vs `struct` |
02:03:14 | FromDiscord | <DetermiedNim1> oooh↵wait so how should i convert |
02:03:17 | FromDiscord | <DetermiedNim1> for the future |
02:03:43 | FromDiscord | <Elegantbeef> I don't know what the API is and what you're doing |
02:04:54 | FromDiscord | <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:08 | FromDiscord | <heysokam> need to provide more context on what you mean by `` exactly |
02:05:08 | FromDiscord | <DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=UdqlxlrX |
02:05:12 | FromDiscord | <DetermiedNim1> this is the C |
02:05:21 | FromDiscord | <heysokam> `ptr WremVM` |
02:05:30 | FromDiscord | <heysokam> `const char` is `cstring` |
02:05:58 | FromDiscord | <Elegantbeef> That's not the source of the error though as the definitions were `vm, ptr cchar` |
02:05:59 | FromDiscord | <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:51 | FromDiscord | <DetermiedNim1> wait |
02:06:56 | FromDiscord | <DetermiedNim1> no compile error |
02:07:38 | FromDiscord | <DetermiedNim1> welp ofc i forgot to actually call main() |
02:07:43 | FromDiscord | <DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=hURoixbF |
02:08:03 | FromDiscord | <Elegantbeef> You need to link the shared library |
02:08:13 | FromDiscord | <DetermiedNim1> ah ok |
02:08:34 | FromDiscord | <DetermiedNim1> passl pragma right? |
02:09:23 | FromDiscord | <Elegantbeef> Yes |
02:09:47 | FromDiscord | <DetermiedNim1> YES |
02:09:56 | FromDiscord | <DetermiedNim1> it works! |
02:10:00 | FromDiscord | <DetermiedNim1> thanks guys |
02:12:04 | FromDiscord | <heysokam> #noice |
02:13:56 | FromDiscord | <DetermiedNim1> ok so weird compilation error |
02:14:12 | FromDiscord | <DetermiedNim1> when i switch from `./wren/src/include` to "/usr/include" |
02:15:07 | FromDiscord | <DetermiedNim1> sent a long message, see https://pasty.ee/aYXcLdOq |
02:15:16 | FromDiscord | <DetermiedNim1> (edit) "long message," => "code paste," | "https://pasty.ee/VzpLfvbI" => "https://play.nim-lang.org/#pasty=APYLocwk" |
02:15:21 | FromDiscord | <DetermiedNim1> (edit) ""/usr/include"" => "`/usr/include`" |
02:15:54 | FromDiscord | <DetermiedNim1> this doesnt give that error tho https://media.discordapp.net/attachments/371759389889003532/1363337349546770532/image.png?ex=6805aa59&is=680458d9&hm=1ac615a84c33008d06ca705fafa519c8d11c0c6a115589af408f7d1ed862d76b& |
02:15:59 | FromDiscord | <DetermiedNim1> so ill just use this |
02:16:39 | FromDiscord | <Elegantbeef> That's a normal issue with futhark cause the VM has safety rails |
02:16:40 | FromDiscord | <DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=EyeThDgD |
02:16:44 | FromDiscord | <DetermiedNim1> ah ok |
02:16:54 | FromDiscord | <DetermiedNim1> yeah its not that big of a deal anyways |
02:17:06 | FromDiscord | <Elegantbeef> Yea you just have to increase the limit and compile |
02:17:15 | FromDiscord | <DetermiedNim1> time to program an frc robot in nim 😈 |
02:35:58 | FromDiscord | <Robyn [She/Her]> In reply to @determiedmech1 "time to program an": frc? |
02:41:01 | FromDiscord | <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:45 | FromDiscord | <heysokam> I could also have misunderstood, and he just meant `French C`, who knows |
02:48:47 | FromDiscord | <Robyn [She/Her]> aab |
02:48:59 | FromDiscord | <Robyn [She/Her]> (edit) "aab" => "aah" |
02:54:39 | FromDiscord | <DetermiedNim1> nah frc |
02:54:45 | FromDiscord | <DetermiedNim1> first robotics competition |
02:55:10 | FromDiscord | <DetermiedNim1> most teams use Java but there are C and Python APIs for WPILib |
02:55:26 | FromDiscord | <DetermiedNim1> sent a code paste, see https://paste.rs/qWV3D |
02:56:47 | FromDiscord | <DetermiedNim1> https://wpilib.org/↵https://github.com/wpilibsuite/allwpilib |
02:57:01 | FromDiscord | <DetermiedNim1> frc is so cool and awesome I love robotics competitions |
02:57:19 | FromDiscord | <DetermiedNim1> probably one of the main things that got me into coding |
03:02:10 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=lUVATNnc |
03:02:43 | FromDiscord | <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:53 | FromDiscord | <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:38 | FromDiscord | <DetermiedNim1> In reply to @heysokam "seems like the callback": in the same place where it wants a `cstring` on my laptop |
03:11:00 | FromDiscord | <DetermiedNim1> This error is from my phone (Android REL 13 armv8l)(taken from fastfetch) |
03:12:20 | FromDiscord | <DetermiedNim1> also I don't think I can convert a `string` to `ptr uint8` so idk what it's yapping about |
03:12:23 | FromDiscord | <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:28 | FromDiscord | <DetermiedNim1> I've been using the std docs, nim by example, and the forums |
03:13:47 | FromDiscord | <leorize> I hate to say this but this chat is probably the best search engine |
03:13:57 | FromDiscord | <DetermiedNim1> lol |
03:13:59 | FromDiscord | <DetermiedNim1> real |
03:14:05 | FromDiscord | <DetermiedNim1> OMG WAIT THAT IS SO REAL |
03:14:10 | FromDiscord | <DetermiedNim1> I haven't even thought about that |
03:14:16 | FromDiscord | <DetermiedNim1> before now |
03:14:21 | FromDiscord | <DetermiedNim1> but it's such a good idea |
03:17:15 | FromDiscord | <DetermiedNim1> Oh also are the physical books worth it |
03:18:17 | * | alexdaguy joined #nim |
03:19:53 | FromDiscord | <Robyn [She/Her]> `addr myStr.cstring[0]`↵(@DetermiedNim1) |
03:20:14 | FromDiscord | <Robyn [She/Her]> or even `addr myStr[0]` |
03:20:16 | FromDiscord | <DetermiedNim1> ah |
03:20:22 | FromDiscord | <DetermiedNim1> oh wait that makes sense |
03:20:46 | FromDiscord | <DetermiedNim1> that would be the start of the memory used my myStr right? |
03:21:30 | FromDiscord | <DetermiedNim1> now I'm thinking with po~~rtals~inters |
03:21:30 | FromDiscord | <Robyn [She/Her]> The string's buffer without the length and cap data yeah↵(@DetermiedNim1) |
03:21:39 | FromDiscord | <DetermiedNim1> (edit) "po~~rtals~inters" => "po~~rtals~~inters" |
03:22:24 | FromDiscord | <DetermiedNim1> ah ok |
03:22:36 | FromDiscord | <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:31 | FromDiscord | <DetermiedNim1> okok |
03:25:39 | FromDiscord | <DetermiedNim1> idk how to determine that |
03:26:21 | FromDiscord | <DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=vmBhAUjU |
03:26:43 | FromDiscord | <DetermiedNim1> This works perfectly as long as you have wren installed |
03:27:04 | FromDiscord | <DetermiedNim1> (edit) "https://play.nim-lang.org/#pasty=VwdAVWfK" => "https://play.nim-lang.org/#pasty=NUiNYMyB" |
03:27:19 | FromDiscord | <DetermiedNim1> Not on Termux tho |
03:29:05 | FromDiscord | <Robyn [She/Her]> basically the scope outside a string was defined in↵(@DetermiedNim1) |
03:29:24 | FromDiscord | <Robyn [She/Her]> But if you have long lived string pointers, copy to a cstring and free it yourself if needed |
03:29:35 | FromDiscord | <DetermiedNim1> okay |
03:30:12 | FromDiscord | <DetermiedNim1> Oh wait I might not need those casts |
03:30:20 | FromDiscord | <DetermiedNim1> I'll have to test it tmr |
03:42:31 | FromDiscord | <dusa2986> Can nim compile to C++ source code that you can look at before compiling? |
03:46:00 | FromDiscord | <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:33 | FromDiscord | <Laylie> see also -c, --compileOnly |
03:50:30 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=qsMFICdz |
03:50:47 | FromDiscord | <heysokam> (edit) "https://play.nim-lang.org/#pasty=bSYJnczR" => "https://play.nim-lang.org/#pasty=cOsvJoXx" |
03:51:45 | FromDiscord | <dusa2986> Thank you all. Is it gibberish like the JavaScript code that is generated? |
03:51:54 | FromDiscord | <heysokam> most likely |
04:05:51 | * | amadaluzia joined #nim |
04:06:47 | FromDiscord | <Robyn [She/Her]> In reply to @dusa2986 "Can nim compile to": do note it's not made for human consumption |
04:07:01 | FromDiscord | <Robyn [She/Her]> In reply to @dusa2986 "Thank you all. Is": yeah pretty much |
04:07:07 | FromDiscord | <dusa2986> Understood |
04:07:43 | FromDiscord | <DetermiedNim1> In reply to @battery.acid.bubblegum "do note it's not": shudders Nim generated JS is a fine example of that |
04:07:45 | FromDiscord | <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:52 | FromDiscord | <DetermiedNim1> 😭 |
04:08:14 | FromDiscord | <DetermiedNim1> ultimate c programmer right here |
04:08:21 | FromDiscord | <DetermiedNim1> (edit) "c" => "cpp" |
04:09:23 | FromDiscord | <dusa2986> I want to make a gameboy emulator in nim. One with garbage collection and one without. |
04:10:12 | FromDiscord | <dusa2986> Do yall think that if Nim was backed by a corporation it would be more popular? |
04:10:35 | FromDiscord | <odexine> yes but not by much |
04:13:29 | FromDiscord | <dusa2986> Ah. I’ve always felt that nim should be more popular. Could literally be used for anything. |
04:14:16 | FromDiscord | <odexine> well development has been somewhat shaky for a few years |
04:14:41 | FromDiscord | <Laylie> normies would still just glance at it once and go "ew style insensitivity" and leave |
04:16:32 | FromDiscord | <dusa2986> In reply to @odexine "well development has been": What has happened? Devs leaving the project? |
04:19:09 | FromDiscord | <odexine> quite a few have yes |
04:19:28 | FromDiscord | <odexine> not really core devs but trusted long-time users |
04:21:55 | FromDiscord | <dusa2986> Drama or just retiring? |
04:22:06 | FromDiscord | <odexine> drama |
04:23:15 | FromDiscord | <dusa2986> Can i possibly get a history? What’s happened? |
05:08:11 | FromDiscord | <odexine> uh i dont know how to condense like, 5 years of history |
05:38:29 | * | xet7 joined #nim |
05:54:52 | FromDiscord | <janakali> @Dustin you can find some context here (read comments by haxscramper): https://news.ycombinator.com/item?id=32021299 |
05:55:11 | FromDiscord | <janakali> (edit) "@Dustin" => "@dusa2986 " |
06:28:57 | FromDiscord | <leorize> Nim has a major corporate sponsor who is big in the cryptocurrency sphere\: [Status](https://status.app/)↵(@dusa2986) |
06:30:12 | FromDiscord | <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:36 | FromDiscord | <dusa2986> In reply to @janakali "<@513003997205102594> you can": Interesting |
06:31:53 | FromDiscord | <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:59 | FromDiscord | <tomo_kimpesa> Nim is honestly slowly becoming my first choice for most of my projects |
09:38:02 | FromDiscord | <Laylie> why not quickly? |
09:39:14 | * | Guest17 joined #nim |
09:42:04 | * | Guest17 left #nim (#nim) |
09:50:23 | FromDiscord | <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:36 | FromDiscord | <aintea> Like Theprimeagen did with Rust, OCaml and Go |
09:50:50 | FromDiscord | <aintea> And TJ with elixir |
09:50:58 | FromDiscord | <dusa2986> In reply to @aintea "Like Theprimeagen did with": I’m sure he made a video about him |
09:51:03 | FromDiscord | <dusa2986> (edit) "him" => "nin" |
09:51:07 | FromDiscord | <dusa2986> (edit) "nin" => "nim" |
09:51:19 | FromDiscord | <aintea> Yes, but it was only a review of the 2.0.0 patchnote |
09:51:59 | FromDiscord | <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:29 | FromDiscord | <aintea> When I finish the Nimlings I'll ask him to try to learn Nim with the multiple supports there are |
09:52:54 | FromDiscord | <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:22 | FromDiscord | <aintea> Btw do you guys know how I could ask some people here if they want to contribute to the project ? |
09:54:54 | FromDiscord | <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:40 | FromDiscord | <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:19 | FromDiscord | <aintea> The only "good" point he made was that Nim has exceptions yet recommends you to use results |
09:56:50 | FromDiscord | <aintea> The manual memory management with garbage collected standard library isn't a good argument imo |
09:58:01 | FromDiscord | <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:14 | FromDiscord | <dusa2986> Yes |
09:58:18 | FromDiscord | <aintea> It's a Python and Rust baby |
09:58:32 | FromDiscord | <dusa2986> That’s a cool way to say it |
09:58:38 | FromDiscord | <dusa2986> Never heard of it like that |
09:59:25 | FromDiscord | <dusa2986> I really like how you can turn off the GC if you want to. |
09:59:36 | FromDiscord | <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:44 | FromDiscord | <dusa2986> And use other Languages GC like Go’s GC |
10:00:08 | FromDiscord | <dusa2986> In reply to @aintea "The thing is for": Definitely |
10:00:15 | FromDiscord | <aintea> In reply to @dusa2986 "I really like how": Yes, that lets you use Nim in the embedded field |
10:00:37 | FromDiscord | <aintea> And let's you shoot yourself in the foot blazingly fast |
10:00:51 | FromDiscord | <dusa2986> Just like C lol |
10:01:02 | FromDiscord | <aintea> Yes but C doesn't have a defer keyword |
10:01:19 | FromDiscord | <aintea> That helps a lot with memory management |
10:01:29 | FromDiscord | <dusa2986> C was built to be simple. |
10:01:54 | FromDiscord | <aintea> Yes |
10:01:57 | FromDiscord | <aintea> Just like Go |
10:02:13 | FromDiscord | <aintea> Nothing fancy, everything is simple |
10:02:17 | FromDiscord | <dusa2986> Go should remove their GC |
10:02:27 | FromDiscord | <dusa2986> Or at least make it optional |
10:02:28 | FromDiscord | <aintea> That's an opinion I can hear |
10:02:46 | FromDiscord | <aintea> But it does work pretty well at the moment |
10:02:55 | FromDiscord | <aintea> If people want to manage their memory they go with C or Zig |
10:03:12 | FromDiscord | <aintea> If they want a higher level and don't want to deal with memory they go with Go |
10:03:15 | FromDiscord | <dusa2986> I want to try zig but it’s too new right now |
10:03:24 | FromDiscord | <aintea> It's not, the ecosystem is good |
10:03:37 | FromDiscord | <aintea> Go try it, I would really recommend it if it fits your usecase |
10:03:51 | FromDiscord | <dusa2986> Emulator development at the moment |
10:04:08 | FromDiscord | <dusa2986> One reason I thought of Nim |
10:04:09 | FromDiscord | <aintea> No idea about that, I'm not an emulator developer |
10:04:24 | FromDiscord | <aintea> You can use Assembly to make your emulator tho |
10:04:28 | FromDiscord | <dusa2986> Speed is the name of the game |
10:04:40 | FromDiscord | <aintea> With assembly, speed is the only thing you'll get |
10:04:49 | FromDiscord | <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:14 | FromDiscord | <dusa2986> Also emulators are extremely complex depending on what you are trying to emulate |
10:05:17 | FromDiscord | <aintea> Even with none of that, if you have a will to live don't learn assembly |
10:05:52 | FromDiscord | <dusa2986> lol |
10:06:30 | FromDiscord | <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:01 | FromDiscord | <dusa2986> In reply to @heysokam "its not. its really": Good to know. |
10:09:43 | * | derpydoo quit (Quit: derpydoo) |
10:10:49 | FromDiscord | <leorize> 0.14 is out and it has many breaking changes |
10:10:59 | FromDiscord | <leorize> including an overhaul to their packages system that breaks everyone |
10:11:03 | FromDiscord | <leorize> so no, zig is not stable |
10:11:06 | FromDiscord | <aintea> Yeah but he's talking about emulator capabilities |
10:11:06 | FromDiscord | <aintea> I have no idea about emulators because that's not my thing |
10:12:24 | FromDiscord | <leorize> it doesn't sound like emulators have anything to do with this |
10:15:11 | FromDiscord | <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:18 | FromDiscord | <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:21 | FromDiscord | <heysokam> I'd argue that's stable enough for a daily driver for 90% of people 🤷♂️ |
10:29:50 | FromDiscord | <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:10 | FromDiscord | <nnsee> you also seem to be conflating the meanings of stability |
10:30:47 | FromDiscord | <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:53 | FromDiscord | <monkoose4407> sent a code paste, see https://play.nim-lang.org/#pasty=MnrrxrNW |
11:03:47 | FromDiscord | <monkoose4407> (edit) "https://play.nim-lang.org/#pasty=riHNLhyQ" => "https://play.nim-lang.org/#pasty=qMAZIpWy" |
11:38:53 | FromDiscord | <Laylie> it works if you make it `p: Parent` i.e. remove `var` |
11:41:24 | FromDiscord | <Laylie> i guess because replacing the Child with a Parent (which the `var` allows you to do) results in an invalid Child |
11:48:29 | FromDiscord | <monkoose4407> thanks, seems to work. There is no consequences of doing it like so? |
11:56:58 | FromDiscord | <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:54 | FromDiscord | <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:56 | FromDiscord | <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:03 | FromDiscord | <enthus1ast.> There was a talk from someone of the community, he made a type "merger" macro I forgot his name |
14:33:18 | FromDiscord | <enthus1ast.> And he used that for DB migration |
14:33:54 | FromDiscord | <enthus1ast.> Type merger and type differ macro |
14:43:04 | FromDiscord | <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:45 | FromDiscord | <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:18 | FromDiscord | <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:16 | FromDiscord | <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:49 | FromDiscord | <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:13 | FromDiscord | <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:40 | FromDiscord | <heysokam> that's what this lang is good at, from an OOP concepts frame of mind |
15:02:48 | FromDiscord | <enthus1ast.> Yes deech |
15:03:46 | FromDiscord | <enthus1ast.> Composition and or ecs |
16:18:27 | * | beholders_eye joined #nim |
16:54:05 | FromDiscord | <ajusa> sent a long message, see https://pasty.ee/lPPfTMzn |
16:58:17 | FromDiscord | <Elegantbeef> This is how generics work |
16:58:27 | FromDiscord | <Elegantbeef> The first instantiation is used by all types |
17:00:03 | FromDiscord | <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:00 | FromDiscord | <Elegantbeef> The downside of adhoc generics is they're adhoc 😄 |
17:05:52 | * | ntat joined #nim |
17:15:41 | FromDiscord | <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:43 | FromDiscord | <Elegantbeef> Well only want a single json hook then 😄 |
17:16:46 | FromDiscord | <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:25 | FromDiscord | <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:37 | FromDiscord | <ajusa> single JSON hook? |
17:18:27 | FromDiscord | <Elegantbeef> Well you want two different `parseHook` based off context no? |
17:20:05 | FromDiscord | <ajusa> basically yeah |
17:20:21 | FromDiscord | <ajusa> I want one context to use the default hook, and another to have it be overwritten |
17:20:38 | FromDiscord | <Elegantbeef> Yea stop that 😄 |
17:20:55 | FromDiscord | <ajusa> ah yes, the old "define the problem out of existence" |
17:21:51 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=zNWvYoVa |
17:22:06 | FromDiscord | <Elegantbeef> Or you could use a `type SpecialTime = distinct Time` and in places you want the hook use that |
17:22:15 | FromDiscord | <ajusa> yep the distinct type was the other option I explored |
17:23:06 | FromDiscord | <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:52 | FromDiscord | <Elegantbeef> Adhoc generics both are good and bad |
17:33:09 | FromDiscord | <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:59 | FromDiscord | <ajusa> gotcha, thanks for clarifying! |
17:36:03 | FromDiscord | <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:40 | FromDiscord | <DetermiedNim1> how would i wrap cpp classes into nim |
22:24:49 | FromDiscord | <DetermiedNim1> or does futhark secretly work with cpp |
22:35:15 | * | skippy8 joined #nim |
22:55:10 | FromDiscord | <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:14 | FromDiscord | <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) |