00:03:54 | FromDiscord | <huantian> wdym? |
00:04:14 | FromDiscord | <huantian> like |
00:04:32 | FromDiscord | <Elegantbeef> No when statement does not work inside parameter lists or return types |
00:06:56 | FromDiscord | <Elegantbeef> Alea what're you after API wise? |
00:13:01 | FromDiscord | <Girvo> Hello 🙂 |
00:13:10 | FromDiscord | <Elegantbeef> Hello |
00:13:45 | FromDiscord | <Girvo> Question: does anyone have a repo I can look at for setting up a "monorepo" style thing? I need to write a comms server, and a shared comms protocol library, all around my firmware. Wondering what the best way to structure it would be |
00:14:53 | FromDiscord | <Elegantbeef> make a new project with a nimble file that depends on your firmware then just write `mylibrary/server.nim` and `mylibrary/protocol.nim` 😄 |
00:15:54 | FromDiscord | <Girvo> I'll have a look haha the only fun bit is the firmware doesnt follow regular nimble structure because its a seperate build system lol |
00:16:19 | FromDiscord | <Elegantbeef> Well what i did for the picostdlib was make my own build tool |
00:16:23 | FromDiscord | <Elegantbeef> So perhaps consider that 😄 |
00:17:33 | FromDiscord | <Girvo> Tahts basically what I've done hahaha |
00:17:37 | FromDiscord | <Elegantbeef> If it doesnt use nimble though you can just use git submodules |
00:18:02 | FromDiscord | <Elegantbeef> git sub modules like it's 2008 |
00:38:44 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
00:39:41 | * | lumo_e joined #nim |
02:54:55 | * | kayabaNerve_ is now known as kayabaNerve |
03:11:05 | * | lumo_e quit (Ping timeout: 244 seconds) |
03:49:53 | * | vicfred joined #nim |
04:30:37 | * | xet7 joined #nim |
05:39:29 | * | rockcavera quit (Remote host closed the connection) |
05:41:33 | * | madprog joined #nim |
05:46:46 | FromDiscord | <Paul (pmo) ♗> sent a code paste, see https://paste.rs/Gtv |
05:47:09 | FromDiscord | <Elegantbeef> No problem |
05:47:18 | FromDiscord | <Elegantbeef> It worked fine with arc/orc but yea refc is funny with destructors |
05:47:56 | FromDiscord | <Paul (pmo) ♗> what is the difference between arc/orc and refc? how do I use one or the other? |
05:48:16 | FromDiscord | <Paul (pmo) ♗> is it a different garbage collector? |
05:48:42 | FromDiscord | <Elegantbeef> refc is a conventional garbage collector. arc is a reference counting move semantic based memory management system. orc is arc with a cycle collector |
05:49:02 | FromDiscord | <Elegantbeef> Yes `--mm:arc` enables arc and i'll let you figure out how to enable orc |
05:49:25 | FromDiscord | <Paul (pmo) ♗> `mm` for memory management, I guess? |
05:49:36 | FromDiscord | <Elegantbeef> yep or `--gc`(deprecated) |
05:50:50 | FromDiscord | <Elegantbeef> they behave differently and have different benefit's features |
05:51:00 | FromDiscord | <Elegantbeef> Each memory mangement system thais |
05:51:17 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/mm.html can read about them here |
06:19:38 | * | PMunch joined #nim |
06:35:33 | * | vicfred quit (Quit: Leaving) |
06:40:42 | NimEventer | New thread by Clavismax: 'import os' not used. Wrong Error Message, see https://forum.nim-lang.org/t/9217 |
06:45:07 | * | ltriant quit (Ping timeout: 260 seconds) |
07:40:44 | * | jjido joined #nim |
07:53:18 | * | gsalazar quit (Quit: Leaving) |
07:53:33 | * | gsalazar joined #nim |
07:55:23 | FromDiscord | <Elegantbeef> Oh hey zoom your PR finally got accepted! 😄 |
08:08:53 | FromDiscord | <jmgomez> Hey guys, is there a way to test at compile time if two types are compatibles (i.e. if a converter exists)? |
08:09:28 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/JSi |
08:10:19 | FromDiscord | <jmgomez> cool! Didnt know about compiles. Thanks man! |
08:21:04 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:34:13 | FromDiscord | <Zoom> After a month I broke and pinged. |
08:42:43 | * | lumo_e joined #nim |
08:57:08 | FromDiscord | <luteva> @ElegantBeef what is the 'vershun' ment to be used for? sounds like a lib for migrating? migrating data or types or procs? Or all of them? any example or usecase? |
08:57:39 | FromDiscord | <Elegantbeef> It's a toy example of versioned data |
08:58:09 | FromDiscord | <Elegantbeef> It may eventually be used for game saves, but it was just something i had an idea to write so i wrote it to test it |
09:00:45 | FromDiscord | <Elegantbeef> There's a big benefit in having typesafe versioned data that automatically allows migration and errors when it cannot |
09:02:58 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/pJU |
09:03:36 | FromDiscord | <Elegantbeef> It's not easily maintained imo, and doesnt compose well, there is no automated way of knowing what the highest data is and the path to get there |
09:06:21 | FromDiscord | <Elegantbeef> Oh and pmunch by duplicate types i meant i now need a new definition of the type in the file i'm working with so i can write a destructor |
09:07:17 | FromDiscord | <Elegantbeef> Wonder if `type MyObject {.pure, inheritable.} = object` would be too dangerous |
09:08:02 | FromDiscord | <Elegantbeef> Actually i think i like that more than the distincts, less manual converting to use procedures |
09:08:45 | FromDiscord | <Elegantbeef> For the confused pmunch i mean make futhark emit inheritable objects so that you can declare destructors easily and still call the base functions |
09:10:21 | PMunch | @Elegantbeef, that's actually not a bad idea |
09:10:28 | PMunch | I would like a nice way to add destructors |
09:10:39 | FromDiscord | <Elegantbeef> Yea that seems to be the best way |
09:10:45 | FromDiscord | <Elegantbeef> It just generally increases the quality of life |
09:10:58 | FromDiscord | <Elegantbeef> Just need to ensure fuckwits dont add fields |
09:12:25 | FromDiscord | <Elegantbeef> Jeez i must be tired, now think "fuckwits" was a bit too offensive 😄 |
09:13:09 | FromDiscord | <Elegantbeef> Anyway seems like a much much cleaner way to handle destructor, even with the possible issues from people adding fields |
09:13:51 | PMunch | Why would adding fields be an issue? |
09:14:43 | FromDiscord | <Elegantbeef> Well people might have like a `copyMyType(a, b)` which will not copy the added fields |
09:15:43 | FromDiscord | <Elegantbeef> Some unexpected behaviour may arise depending on the libraries they use and the code they write is all |
09:17:12 | FromDiscord | <Elegantbeef> This also makes some of your code less complicate, right? |
09:17:30 | FromDiscord | <Elegantbeef> I know you were adding fields and having the object be a field |
09:28:03 | PMunch | Yeah, I guess I could inherit from the Futharkd objects instead |
09:28:13 | PMunch | Or wait, that wouldn't work |
09:28:42 | FromDiscord | <Elegantbeef> You still want distinctness? |
09:31:17 | FromDiscord | <Zectbumo> So, I'm getting the nim build to be compatible with BSD and I found that the `build_all.sh` is depending on `.` being in `$PATH`. Does nim not have a library path and use `$PATH` for its library search path? What's the best way to add this back in. I'm thinking of adding the build directory in to `$PATH` or pass some build parameter to nim. I see that the `build_all.sh` is generated from `tools/ci_generate.nim` so whatever is decided goe |
09:31:53 | FromDiscord | <Elegantbeef> "library path"? |
09:32:14 | FromDiscord | <Elegantbeef> Do you mean nim's include file path or system libraries? |
09:33:08 | FromDiscord | <Zectbumo> system libraries. right now the bin/nim that is compiled can't even import std/os |
09:34:08 | FromDiscord | <Elegantbeef> those arent system libraries |
09:34:15 | FromDiscord | <Elegantbeef> Nim has `--path` to add include paths |
09:35:19 | FromDiscord | <Zectbumo> oh standard libraries I mean |
09:36:20 | FromDiscord | <Elegantbeef> Sounds like the config isnt setup properly |
09:36:38 | FromDiscord | <Elegantbeef> Actually doesnt nim by default add it's system to `--path` |
09:40:18 | FromDiscord | <Zectbumo> I would have thought that |
09:41:13 | FromDiscord | <Zectbumo> but maybe not when bootstrapping? |
09:42:38 | FromDiscord | <Elegantbeef> No clue |
10:19:12 | * | jmdaemon quit (Ping timeout: 260 seconds) |
10:29:24 | * | arkurious joined #nim |
10:53:47 | FromDiscord | <Zectbumo> hmm, maybe nim does add its system to path. I just specified nim manually to `koch --nim:bin/nim` and now it can find the libs |
11:53:19 | * | lumo_e quit (Ping timeout: 256 seconds) |
12:02:18 | * | jjido joined #nim |
12:13:12 | FromDiscord | <Zoom> `tables.withValue` is a dirty uncomposable hack 😬 Just because someone doesn't like `options` I get to see another meaningless `do:` in my code and need to use another temp var instead of a block being an expression |
12:15:17 | FromDiscord | <exelotl> yeah it sucks lol |
12:17:41 | FromDiscord | <exelotl> it's frustrating because whenever `getOrDefault` is N/A, it's the only way to get a value from the table without doing 2 lookups (1 to see if the key exists, another to get the value) |
12:20:53 | FromDiscord | <Zoom> https://github.com/nim-lang/RFCs/issues/351> First we should get view types into the state where Option[var T] and Option[lent T] do work reliably and then this RFC has my blessing. |
12:22:11 | FromDiscord | <Zoom> I bithched about it being inferior to Rust's `Entry` some time earlier and was explained there's some obstacles to implementing it efficiently, but can't remember what it was \:P |
12:24:39 | FromDiscord | <Zoom> Ah, here it is\:> Rust can do it because it can expose interior pointers in a type-safe manner (it's called "borrow checking") and Nim's still catching up with that (it's called "view types"). It's experimental, there is a spec which could be compared to Rust's borrow checker... Feel free to help.↵https://forum.nim-lang.org/t/8110#52041 |
12:26:22 | FromDiscord | <Zoom> Good thread, btw. |
12:37:16 | * | ltriant joined #nim |
12:38:44 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
12:39:45 | * | jjido joined #nim |
12:53:17 | FromDiscord | <exelotl> mmh yeah, view types have been slowly getting there, but still kind of a mess, there's a gap between the spec and implementation |
12:53:23 | PMunch | Hmm, does destructors have to be exported in order to be called? |
12:53:30 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
13:13:27 | NimEventer | New question by Shoaib Mirzaei: initialize an argument of a proc, but not in it's definition line, see https://stackoverflow.com/questions/72546323/initialize-an-argument-of-a-proc-but-not-in-its-definition-line |
13:22:32 | * | cornfeedhobo quit (Quit: ZNC - https://znc.in) |
13:52:23 | PMunch | If anyone got IKEA Home Smart bulbs in their house: https://github.com/PMunch/ikeahomesmart |
13:52:35 | PMunch | I plan to add that and my coap library to nimble shortly |
13:55:14 | * | PMunch quit (Quit: Leaving) |
13:56:51 | * | cornfeedhobo joined #nim |
14:02:00 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
14:02:21 | * | ehmry joined #nim |
14:17:04 | * | rockcavera joined #nim |
14:17:05 | * | rockcavera quit (Changing host) |
14:17:05 | * | rockcavera joined #nim |
14:28:12 | * | derpydoo joined #nim |
14:58:25 | * | vicfred joined #nim |
15:24:40 | FromDiscord | <Zoom> Hm, devel broke `repeat` resolution for strings. Now it returns a `seq[string]` instead of a string. |
15:25:22 | FromDiscord | <Zoom> !eval echo typeof(" ".repeat(5)) |
15:25:22 | NimBot | Compile failed: Unable to open output log |
15:26:22 | FromDiscord | <Zoom> Ah, right, playground has a siesta again... |
15:38:05 | * | krux02 joined #nim |
15:40:07 | FromDiscord | <jmgomez> hey guys, when doing ↵let str : string = $ cstr ↵it doesnt copy/allocate, does it? |
15:40:33 | FromDiscord | <Zoom> Turns out my choosenim stalled and couldn't upgrade my devel. On latest devel repeat works fine |
15:48:55 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=3ZHg |
15:52:53 | ehmry | if I write `proc foo(T: static typedesc)` in a module, can I write another `foo` that only matches values, not types? is it a bug if the first matches values? |
15:56:01 | FromDiscord | <Yardanico> you don't need `static` for typedesc, it's already a compile-time only value |
15:56:13 | FromDiscord | <Yardanico> but yes, you can of course write the one that matches the value itself |
15:56:29 | FromDiscord | <Yardanico> `typedesc` and `typedesc[T]` match for the type itself, not values of that type |
16:03:09 | ehmry | Yardanico_: you are right, I don't need static, and that fixes it. I had some problems with macros that went away with static but thats not the case anymore |
16:04:06 | * | xet7 quit (Remote host closed the connection) |
16:08:21 | * | noeontheend joined #nim |
16:21:04 | * | noeontheend quit (Ping timeout: 244 seconds) |
16:27:44 | ehmry | I get `Error: cannot evaluate at compile time: T` for `typedesc` but not `static typedesc`, odd |
16:31:11 | * | noeontheend joined #nim |
16:32:14 | FromDiscord | <Yardanico> can you show the code? |
16:34:12 | ehmry | https://git.syndicate-lang.org/ehmry/syndicate-nim/src/branch/trunk/src/syndicate.nim#L37 |
16:34:24 | ehmry | whatever, I can work around it |
16:34:34 | FromDiscord | <Yardanico> but why doesn't it work without static |
16:34:34 | FromDiscord | <Rika> cool |
16:34:42 | FromDiscord | <Rika> i mean the syndicate thing sorry |
16:34:50 | FromDiscord | <Rika> caught my eye a few months ago |
16:35:12 | FromDiscord | <Rika> might try it for a project |
16:35:14 | FromDiscord | <Yardanico> I just hoped for a smaller repro code :P |
16:37:00 | ehmry | yea, its some compile time spaghetti |
16:38:03 | ehmry | Rika: its sort of usable? |
16:38:19 | FromDiscord | <Rika> why only sort of? |
16:39:38 | ehmry | sometimes you get compile errors :) |
17:03:45 | * | noeontheend quit (Remote host closed the connection) |
17:04:26 | * | noeontheend joined #nim |
17:17:27 | * | noeontheend quit (Ping timeout: 256 seconds) |
18:07:02 | * | smvg joined #nim |
18:25:09 | * | derpydoo quit (Ping timeout: 258 seconds) |
19:24:43 | * | xet7 joined #nim |
20:01:22 | FromDiscord | <Luckayla> does nim have a standard tool for creating projects/managing dependencies such as rust's Cargo? |
20:02:24 | FromDiscord | <konsumlamm> nimble |
20:02:39 | FromDiscord | <Andreas> In reply to @Luckayla "does nim have a": well, sort of, look at nimble https://github.com/nim-lang/nimble#readme |
20:02:51 | FromDiscord | <Luckayla> sweet, thanks |
20:13:34 | FromDiscord | <Luckayla> using the terminal in my text editor to edit a file using nano instead of using the editor... |
20:13:46 | FromDiscord | <Luckayla> then subsequently realizing I'm actually stupid |
20:24:27 | * | jjido joined #nim |
20:37:33 | * | kayabaNerve_ joined #nim |
20:40:18 | * | kayabaNerve quit (Ping timeout: 276 seconds) |
20:51:56 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3ZIM |
20:56:53 | FromDiscord | <ynfle> The issue is the generiv or the 2 param? |
20:56:55 | FromDiscord | <ynfle> (edit) "generiv" => "generic" |
20:57:04 | FromDiscord | <jmgomez> the generic being void |
20:57:28 | FromDiscord | <gibson> Help 😕 `std/zip` package needs the `zlib1.ddl` that comes with nim on windows. But when I put that lib and my exe in the same place, I get `could not load: zlib1.dll\n(bad format; library may be wrong architecture)` What gives? Win11 64-bit. Compiled exe w/ `--cc:vcc`. |
20:57:38 | * | jmdaemon joined #nim |
20:57:43 | FromDiscord | <gibson> (edit) "`zlib1.ddl`" => "`zlib1.dll`" |
21:03:01 | FromDiscord | <gibson> ..because vcc places the exe in the src dir and it's not the same as the other .exe... solved. |
21:09:16 | FromDiscord | <Luckayla> interesting thing |
21:14:29 | FromDiscord | <Luckayla> what am I missing here? |
21:14:33 | FromDiscord | <Luckayla> sent a code paste, see https://play.nim-lang.org/#ix=3ZIV |
21:14:58 | FromDiscord | <Elegantbeef> `requires "jester >= theVersionItsAt"` in your nimble file |
21:15:32 | FromDiscord | <Luckayla> Ah, I'm used to package managers doing that for you when you install them in a project |
21:15:32 | FromDiscord | <Luckayla> noted |
21:15:40 | FromDiscord | <Elegantbeef> Nimble installs globally |
21:15:46 | FromDiscord | <Luckayla> Ooooh |
21:16:01 | FromDiscord | <Luckayla> I'll macro something then. Cool |
21:16:03 | FromDiscord | <Luckayla> Thanks for the info |
21:16:49 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3ZIX |
21:17:24 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3ZIY |
21:23:37 | FromDiscord | <ajusa> It seems to work under -d:danger |
21:25:08 | NimEventer | New thread by Jmgomez: Nim producing void as template argument instead of the type, see https://forum.nim-lang.org/t/9218 |
21:47:39 | FromDiscord | <Zoom> `isAbsolute` on Linux stops working for Windows paths, that's a bummer. I didn't ask this proc to check the path for validity \:P |
21:54:02 | FromDiscord | <wioenena.q> sent a long message, see http://ix.io/3ZJ7 |
21:55:44 | * | smvg quit (Quit: smvg) |
21:58:02 | * | LuxuryMode joined #nim |
22:01:01 | FromDiscord | <kaddkaka> This Lobster comparison talks about Nim's ownership model, is that something that exists? https://news.ycombinator.com/item?id=19570282 |
22:02:35 | FromDiscord | <Generic> it might be a reference to the experiment with the dingle bacon owned references thing |
22:02:59 | FromDiscord | <kaddkaka> dingle bacon? o.O |
22:03:05 | FromDiscord | <wioenena.q> sorry for auto message |
22:03:07 | FromDiscord | <Generic> it's the name of the authors of a paper |
22:03:11 | FromDiscord | <wioenena.q> i change my password |
22:03:36 | FromDiscord | <Generic> the idea was in the end replaced but what's become gc:arc/orc |
22:03:51 | FromDiscord | <kaddkaka> ok |
22:04:39 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:04:44 | FromDiscord | <Generic> (edit) "but" => "with" |
22:05:21 | FromDiscord | <kaddkaka> There is a momentum to introduce Rust at work (and move away from c++). I'm not sure if I should argue for Nim instead 😸 |
22:06:09 | FromDiscord | <Generic> you can try, though I wouldn't put my hopes up |
22:07:37 | FromDiscord | <Generic> I've thrown Nim into discussions many times in the past and unless it's with people who are asking for things to try, it they're not really interested |
22:07:42 | * | jjido joined #nim |
22:08:45 | FromDiscord | <Generic> what I deem most effective at this point is to just make things people are interested in |
22:09:40 | FromDiscord | <Generic> for what value the thing itself has, which is a bit of a trojan horse approach |
22:10:27 | FromDiscord | <Generic> not that I had immense success with this, it just seems more effective to me than playing the missionary |
22:11:27 | FromDiscord | <j-james> In reply to @kaddkaka "There is a momentum": you could certainly bring it up |
22:11:35 | FromDiscord | <j-james> but rust also has its tooling going for it |
22:12:58 | FromDiscord | <ieltan> In reply to @Generic "what I deem most": Well, webassembly seems like a perfect fit for nim |
22:13:20 | FromDiscord | <ieltan> Nim both compiles to C and LLVM IR (unofficially though) |
22:13:27 | FromDiscord | <kaddkaka> I haven't really tried rust, but I'm not too keen on wrestling a borrow checker. And our thing can certainly do with a GC so |
22:13:43 | FromDiscord | <kaddkaka> is LLVM IR a current target? |
22:14:50 | FromDiscord | <j-james> it's unofficial, but yes: https://github.com/arnetheduck/nlvm |
22:14:53 | FromDiscord | <ieltan> There is an LLVM Nim compiler in github but it's not official |
22:14:55 | FromDiscord | <kaddkaka> In reply to @Generic "I've thrown Nim into": Yeah, I've started mentioning Nim and had a learning session with my team. I accidentally mentioned the case/underscore-insensitive part and I think some people freaked 😢 |
22:15:00 | FromDiscord | <ieltan> It can compile to wasm |
22:15:06 | FromDiscord | <kaddkaka> nice 🙂 |
22:15:25 | FromDiscord | <ieltan> Nim seems to be interested in web applications because it compiles to Javascript. |
22:15:41 | FromDiscord | <kaddkaka> oh, I'm not into that :p |
22:15:58 | FromDiscord | <ieltan> I'm just throwing some ideas out there |
22:16:08 | FromDiscord | <j-james> what would your team be using nim for? |
22:16:33 | FromDiscord | <ieltan> Ahaha I'm a mere sysadmin so not much |
22:16:44 | FromDiscord | <ieltan> I'm just trying to get into dev in my free time |
22:16:59 | FromDiscord | <ieltan> And I've done embedded dev before |
22:17:08 | FromDiscord | <ieltan> So I have some notions of C and C++ |
22:17:15 | NimEventer | New thread by Xigoi: Cursed: Working braces in Nim, see https://forum.nim-lang.org/t/9219 |
22:17:18 | FromDiscord | <ieltan> Nim seemed like a nice language |
22:17:57 | FromDiscord | <kaddkaka> In reply to @j-james "what would your team": Hardware simulation (systemC) or to speedup slow python tooling |
22:18:06 | FromDiscord | <Yardanico> In reply to @NimEventer "New thread by Xigoi:": man made horrors beyond comprehension |
22:19:05 | FromDiscord | <Yardanico> https://c.tenor.com/uaXul54ckrkAAAAi/clueless-aware.gif |
22:19:41 | FromDiscord | <j-james> In reply to @kaddkaka "Hardware simulation (systemC) or": one plus of nim is that it wraps c/c++ code nicely |
22:20:06 | FromDiscord | <j-james> so if you have a bunch of legacy code, you could rewrite incrementally |
22:20:26 | FromDiscord | <Generic> wrapping C++ code in Nim can be quite an adventure |
22:20:47 | FromDiscord | <kaddkaka> Yeah, we have proof-of-concept `c++ <-> rust <-> c++` today |
22:21:16 | FromDiscord | <kaddkaka> putting Nim there instead should be doable if it's easy to generate wrapper/interface code |
22:21:33 | FromDiscord | <j-james> In reply to @Generic "wrapping C++ code in": ooh, really 🙁 |
22:21:52 | FromDiscord | <j-james> i've only wrapped c code and thought it'd be similar |
22:21:54 | FromDiscord | <kaddkaka> there is some cbindgen-ish stuff going on to glue it together with C functions |
22:22:00 | FromDiscord | <j-james> i guess classes would be a pain |
22:22:45 | FromDiscord | <j-james> (edit) "thought" => "assumed" |
22:23:07 | FromDiscord | <kaddkaka> I really gotta sleep, already 00:20 here :'(, I'll be dead tomorrow. good night 😴 |
22:23:16 | FromDiscord | <Generic> when you have to interface classes is where it gets hairy |
22:23:25 | FromDiscord | <Generic> (edit) "when you have to ... interface" added "implement" |
22:23:52 | FromDiscord | <ieltan> I've wondered how Rust achieve C imports while still being safe, or is it not? |
22:24:28 | FromDiscord | <Elegantbeef> It's not |
22:24:37 | FromDiscord | <ieltan> Ah |
22:24:45 | FromDiscord | <Elegantbeef> C code is by definition unsafe in rustland |
22:24:54 | FromDiscord | <Elegantbeef> So most of it is done inside unsafe blocks 😄 |
22:28:14 | FromDiscord | <ieltan> Very interested in rust memory safety and how they achieve it, it's an elegant solution but the syntax reminds me a little bit of c++ |
22:28:37 | FromDiscord | <Elegantbeef> Yea it's not a very ergonomic language imo |
22:28:52 | FromDiscord | <ieltan> Nim syntax has less cognitive overhead |
22:29:10 | FromDiscord | <ieltan> How does Nim achieve memory safety? Like Rust? |
22:29:10 | FromDiscord | <j-james> nim does similar stuff to rust when it can |
22:29:52 | FromDiscord | <Elegantbeef> Nim has a bunch of similar features though locked behind switches, and also not as developed |
22:30:25 | FromDiscord | <Elegantbeef> Like Nim has a borrow checker in the experimental view types, and it has not nil types |
22:30:59 | FromDiscord | <Elegantbeef> It also has features that prevent you from doing unsafe thing with managed types |
22:31:14 | FromDiscord | <ieltan> By nil you mean null or something else? |
22:31:17 | FromDiscord | <Elegantbeef> Like without unsafe mechanisms you cannot take the pointer to a stack value and get a dangling pointer |
22:31:24 | FromDiscord | <Elegantbeef> Nil is what nim calls null |
22:31:29 | FromDiscord | <ieltan> Ah, figured |
22:31:53 | FromDiscord | <j-james> it's just that Nim's fallback are Copies and reference counting |
22:31:59 | FromDiscord | <Elegantbeef> There's an experimental feature to ensure that you never have a nilable type |
22:32:00 | FromDiscord | <j-james> instead of compiler errors |
22:32:06 | FromDiscord | <Elegantbeef> nilable type nil'd\ |
22:32:27 | FromDiscord | <ieltan> In reply to @Elegantbeef "Like Nim has a": Do you have a link so I can read more about that? |
22:32:29 | FromDiscord | <Elegantbeef> Yea Nim's move semantics do not error when a move cannot be done it copies quietly |
22:32:53 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#strict-not-nil-checking↵https://nim-lang.org/docs/manual_experimental.html#view-types |
22:32:54 | * | sagax quit (Excess Flood) |
22:33:11 | FromDiscord | <ieltan> Thanks! |
22:33:28 | FromDiscord | <dom96> In reply to @kaddkaka "Yeah, I've started mentioning": that's a shame 😢 |
22:33:50 | FromDiscord | <Elegantbeef> They arent reliable which is why they're experimental, but they do atleast exist |
22:35:21 | FromDiscord | <gibson> Well, thought I'd fixed it, but not. My win exe still cannot load `zlib1.dll` as it complains that the one shipped with nim is an invalid architecture. Hmm. How can I compile something that can load the shipped dlls? |
22:38:07 | FromDiscord | <ieltan> Also, going back to wasm |
22:38:21 | FromDiscord | <ieltan> I think this could be a good start:↵https://github.com/wasmerio/wasmer/issues/2120 |
22:38:37 | FromDiscord | <ieltan> I could do it once I get familiar enough with programming in Nim |
22:38:50 | FromDiscord | <Elegantbeef> Maybe if wasmer actually documented their shit |
22:39:03 | FromDiscord | <Elegantbeef> https://github.com/beef331/wasmedge_playground started playing with the wasmedge runtime myself |
22:39:16 | FromDiscord | <ieltan> In reply to @Elegantbeef "Maybe if wasmer actually": Ahahaha |
22:39:25 | FromDiscord | <ieltan> Well wasm moves fast from what I've heard |
22:39:40 | FromDiscord | <ieltan> They have some good concepts |
22:39:41 | FromDiscord | <Elegantbeef> I spent a solid week looking at C-APIs for wasm runtimes |
22:39:52 | FromDiscord | <Elegantbeef> wasmedge was the first i found that actually provided explanations and a usable API |
22:40:21 | FromDiscord | <ieltan> I'll look into that though I'm not sure if I'll get all of it! |
22:41:18 | FromDiscord | <Elegantbeef> Like i'm glad they have their docgen setup, but like i couldnt figure out how anything worked cause they dont have any actual useful explanation of the api |
22:41:18 | FromDiscord | <Elegantbeef> Eh i've wrapped a lot of the api that i needed for scripting programs with wasm |
22:41:57 | FromDiscord | <Elegantbeef> Like it's a pretty usable API imo, though might have some issues somewhere 😄 https://github.com/beef331/wasmedge_playground/blob/master/tests/tmaths.nim#L33-L65 |
22:42:46 | FromDiscord | <Elegantbeef> And i've started a project using it https://github.com/beef331/aiarena here, though mostly focusing on my proper game and not this wasm scripting testy |
22:43:47 | FromDiscord | <j-james> In reply to @dom96 "that's a shame 😢": i'd imagine style insensitivity is far less useful to corporations |
22:44:06 | FromDiscord | <j-james> if you're mostly using internal libraries with consistent styles anyway |
22:44:25 | FromDiscord | <Elegantbeef> Well good thing there is the usage check |
22:46:00 | FromDiscord | <j-james> yea |
22:54:59 | FromDiscord | <exelotl> In reply to @Generic "what I deem most": Yeah I agree, best way to get more people interested in Nim is to make stuff with it |
22:57:21 | NimEventer | New thread by Ggibson: Win nim included dlls fail to load, see https://forum.nim-lang.org/t/9220 |
23:06:54 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3ZJs |
23:07:13 | FromDiscord | <Elegantbeef> It goes away with danger cause assertions are off in danger |
23:08:22 | FromDiscord | <ajusa> Oh, okay. But the code functions fine even without the assertion, so why is it there then? |
23:12:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ZJu |
23:13:19 | FromDiscord | <ajusa> I see |
23:13:28 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ZJv |
23:13:52 | FromDiscord | <Elegantbeef> No clue if it should work, or what the issue is |
23:13:55 | FromDiscord | <ajusa> So something is likely breaking in the background which may not matter to me, or will eventually matter to me |
23:14:16 | FromDiscord | <ajusa> Nim's async is still kinda painful, the error trace didn't help all that much |
23:14:22 | FromDiscord | <Elegantbeef> Something might be incorrect that may result in issues down the line perhaps |
23:14:25 | FromDiscord | <ajusa> I wonder if using prologue would fix it |
23:14:44 | FromDiscord | <Elegantbeef> Could use status' async or rewrite your code with CPS 😄 |
23:15:18 | FromDiscord | <ajusa> If there are any frameworks that support CPS or Status async I'd gladly try that |
23:15:34 | FromDiscord | <Elegantbeef> Status' async is a drop in replacement afaik |
23:23:17 | FromDiscord | <👾 br4n_d0n> How would one go about doing this in Nim?↵https://www.cprogramming.com/tutorial/c/lesson17.html |
23:24:11 | FromDiscord | <huantian> like <https://nim-lang.org/docs/manual.html#types-varargs>? |
23:24:38 | FromDiscord | <huantian> I didn't read your link except for like the first 3 words |
23:24:54 | FromDiscord | <Elegantbeef> You use varargs |
23:25:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ZJx |
23:26:28 | FromDiscord | <👾 br4n_d0n> Thanks, I wasn't sure if varargs was the correct approach or not |
23:27:36 | FromDiscord | <👾 br4n_d0n> BTW, what is `` items() `` in the link @huantian gave? |
23:28:20 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=3ZJy |
23:28:37 | * | kayabaNerve_ is now known as kayabaNerve |
23:28:42 | FromDiscord | <ynfle> It's an iterator that yields each item in the seq |
23:29:12 | FromDiscord | <👾 br4n_d0n> Thanks everyone |
23:29:36 | FromDiscord | <Elegantbeef> depending who you ask you should use `items` explicitly |
23:30:18 | FromDiscord | <Luckayla> Welp, I've successfully ported my web app server over from Haskell to Nim |
23:30:29 | FromDiscord | <Luckayla> and it seems to be running great |
23:30:37 | FromDiscord | <👾 br4n_d0n> In reply to @Elegantbeef "depending who you ask": What's the reasoning? |
23:31:26 | FromDiscord | <Luckayla> actually, it seems like it's faster than Haskell even, and the Haskell implementation was not noticeably slow |
23:33:15 | FromDiscord | <michaelb.eth> In reply to @Luckayla "Welp, I've successfully ported": seems like a big change re: programming paradigms! do you code Nim in a mostly functional style or for the port did you adopt a more imperative style? |
23:33:35 | FromDiscord | <Elegantbeef> Inside generics implicit `items` can cause bugs↵(@👾 br4n_d0n) |
23:35:15 | FromDiscord | <👾 br4n_d0n> Seems Nim has issues with Generics in general... |
23:35:36 | FromDiscord | <👾 br4n_d0n> Is this something that's being worked on? |
23:36:16 | FromDiscord | <Luckayla> In reply to @michaelb.eth "seems like a big": I started by considering the implementation in a functional style, but ended up using a more imperative approach as it worked nicer. |
23:36:39 | FromDiscord | <Luckayla> It is in fact a big change, however the paradigm was not the reason I was using haskell originally, just that Haskell fit the niche of my use case well |
23:36:55 | FromDiscord | <Luckayla> That use case being a higher-level applications language that easily compiled to Windows, MacOS, and Linux target platforms with little fuss |
23:37:11 | FromDiscord | <Elegantbeef> Small bugs arent really touched often↵(@👾 br4n_d0n) |
23:37:37 | FromDiscord | <👾 br4n_d0n> That's sad to hear, but understandable |
23:37:48 | FromDiscord | <Luckayla> I had previously ignored nim due to its advertisement as a "systems language" but someone tipped me off that it wasn't such a low level language as I thought |
23:37:54 | FromDiscord | <Elegantbeef> I did look at it once but i'm too daft to know how to fix it |
23:37:56 | FromDiscord | <Luckayla> glad I listened to them, I'm loving the language so far. |
23:40:41 | FromDiscord | <Elegantbeef> It can be it just doesnt have to be 😛↵(@Luckayla) |
23:41:13 | FromDiscord | <Luckayla> yeah, a lot of nice stuff in the nim world. |
23:41:20 | FromDiscord | <Elegantbeef> It's at a nice place where the defaults are generally good but if you need to get lower you always can |
23:41:26 | FromDiscord | <Luckayla> and some syntax that reminds me of ruby's niceness without ruby's badnes |
23:41:30 | FromDiscord | <Elegantbeef> Unlike C++/C/Oddin/Zig 😄 |
23:41:41 | FromDiscord | <Luckayla> Yeah, I never enjoy using C/C++ much |
23:41:46 | FromDiscord | <Luckayla> I use Rust whenever I can for those jobs |
23:41:59 | FromDiscord | <Luckayla> Zig seems like a rust-like, but I never saw any reason to use it over Rust |
23:42:00 | FromDiscord | <Elegantbeef> Now Nim? 😛 |
23:42:15 | FromDiscord | <Luckayla> Nah, I will probably stick to Rust for my lower-level things. |
23:42:21 | FromDiscord | <Luckayla> I really do like that language quite a lot for different reasons |
23:42:28 | FromDiscord | <Luckayla> but for apps, nim is probably going to be my go-to |
23:42:51 | FromDiscord | <Luckayla> Python is my normal tool for server-side stuff, I'd use it for apps but packaging is still not great. |
23:43:33 | FromDiscord | <Elegantbeef> Shame |
23:44:11 | FromDiscord | <👾 br4n_d0n> cRustaceans are for eating, not being understandable to humans |
23:46:59 | FromDiscord | <Luckayla> lol |
23:50:21 | FromDiscord | <exelotl> since Hare dropped the other week it made me think, a qbe backend for Nim would be pretty cool |
23:52:57 | FromDiscord | <exelotl> I guess the closest thing we have right now is using tcc with the C backend |
23:54:03 | FromDiscord | <Elegantbeef> "dropped the other week" hasnt devault dropped it like 10 times now?! 😄 |
23:56:34 | FromDiscord | <exelotl> it was secret (unless you knew where to look) until about 5 weeks ago :P |
23:56:41 | FromDiscord | <exelotl> though there were some teaser articles written about it |
23:57:17 | FromDiscord | <exelotl> (I did not know where to look) |
23:57:25 | FromDiscord | <Elegantbeef> Ah i've seen it since like the first mention of it |
23:58:24 | FromDiscord | <Elegantbeef> Though i mean the biggest Nim compile time issue is Nim itself |
23:58:26 | FromDiscord | <Elegantbeef> Turns out using a bunch of pointers for the AST isnt smart for performance |