00:01:25 | arkanoid | I've learned async first with C#, then Python, so I've always considered futures requires to be awaited to run. This caused some unexpected behaviour in my Nim code. It took me a while |
00:04:06 | FromDiscord | <alcatraz> In reply to @arkanoid "alcatraz, it depends on": thanks arkanoid |
00:04:26 | FromDiscord | <alcatraz> are there any good videos to watch while bored? i cant read for long periods of time i get a headache |
00:05:31 | arkanoid | alcatraz, there is a youtube channel https://www.youtube.com/@nimprogramminglanguage3130 , but just search "nim lang" on youtube there is quite some stuff |
00:06:11 | FromDiscord | <alcatraz> thanks, how are you sending messages as a bot? |
00:06:16 | arkanoid | kiloneie has creates some good tutorials, for example https://www.youtube.com/@kiloneie |
00:07:10 | arkanoid | I'm using IRC, there's a software bridge that links irc, matrix and discord if I remember correctly |
00:07:28 | arkanoid | another chunk of the community lives on telegram afaik |
00:07:39 | FromDiscord | <alcatraz> thats cool, im from the discord |
00:11:17 | FromDiscord | <Phil> At some point I'll start claiming y'all IRC and matrix users are chat GPT Bots and nobody will be able to claim differently |
00:13:34 | FromDiscord | <Elegantbeef> Wait i'm not? |
00:13:45 | arkanoid | Who is real here? |
00:14:03 | FromDiscord | <Elegantbeef> Will the real Nim user please stand up |
00:16:05 | FromDiscord | <Hourglass [She/Her]> Too tired sorry |
00:16:07 | FromDiscord | <Hourglass [She/Her]> Lmao |
00:16:14 | FromDiscord | <Hourglass [She/Her]> Good song tho |
00:22:29 | * | ltriant joined #nim |
00:25:51 | FromDiscord | <michaelb.eth> @ElegantBeef any thoughts on https://discord.com/channels/371759389889003530/371759389889003532/1086789852567179264 |
00:26:06 | FromDiscord | <Elegantbeef> Damn discord links |
00:27:21 | FromDiscord | <michaelb.eth> oh sorry, I wrote about "curious about this approach" a little more than an hour ago, 6:14p my tz |
00:27:29 | * | ltriant quit (Ping timeout: 265 seconds) |
00:27:31 | FromDiscord | <Elegantbeef> I do not use the C++ backend much |
00:27:34 | FromDiscord | <Elegantbeef> ever really |
00:27:48 | FromDiscord | <michaelb.eth> that's the thing, per comments in that issue (which may be incorrect), it can be used with C backend |
00:28:11 | FromDiscord | <michaelb.eth> but I may have misunderstood |
00:28:31 | FromDiscord | <michaelb.eth> (edit) "that's the thing, per comments in that ... issue" added "GitHub" |
00:28:47 | FromDiscord | <Elegantbeef> Well `<clocale>` is `<locale>` in C |
00:28:55 | FromDiscord | <Elegantbeef> So you need to whendef this afaik |
00:31:09 | FromDiscord | <michaelb.eth> so if I put `<locale.h>`, it compiles, but the linker fails with undefined symbols, which is why I was thinking I needed the cpp header, and that somehow magically it would sort out... but I guess that's wishful thinking 😄 |
00:31:19 | FromDiscord | <michaelb.eth> I probably misunderstood the context of what Araq was suggesting |
00:32:23 | FromDiscord | <Elegantbeef> Not a clue here |
00:32:43 | FromDiscord | <Elegantbeef> You want to compile the hpp with the C backend? |
00:33:06 | FromDiscord | <michaelb.eth> well, I want to get the constant value at compile-time instead of runtime |
00:33:36 | FromDiscord | <michaelb.eth> seemed like he was suggesting `proc foo(): cint {.importcpp: "FOO@".}` is a way to do that |
00:33:49 | FromDiscord | <michaelb.eth> i.e. "nullary function" workaround |
00:34:04 | FromDiscord | <Elegantbeef> You mean constant at compilation and not inside Nim right? |
00:34:16 | FromDiscord | <michaelb.eth> yes |
00:34:33 | FromDiscord | <michaelb.eth> errr, well, actually, not sure what you mean |
00:35:08 | FromDiscord | <Elegantbeef> I mean you do not expect to have Nim know the contents of the constant |
00:35:34 | FromDiscord | <michaelb.eth> it would be nice if it could |
00:35:44 | FromDiscord | <Elegantbeef> Well it cannot |
00:35:47 | FromDiscord | <michaelb.eth> I see |
00:37:41 | FromDiscord | <alcatraz> is nim good for malware? 🤔 |
00:37:53 | FromDiscord | <Elegantbeef> Do not write malware in Nim, thanks |
00:39:44 | FromDiscord | <michaelb.eth> please don't write malware in general, thanks also |
00:39:53 | FromDiscord | <alcatraz> In reply to @michaelb.eth "please don't write malware": educational purposes. |
00:41:32 | FromDiscord | <Elegantbeef> Anyway michael yea sinc Nim is not a C compiler the only things you can import is procs or variables. In those cases it just emits the symbol you say it is |
00:41:49 | FromDiscord | <Hourglass [She/Her]> In reply to @alcatraz "is nim good for": Any programming language could be used for malware, but you'll get no support for writing one here probably loo |
00:41:51 | FromDiscord | <Hourglass [She/Her]> Lol |
00:42:04 | FromDiscord | <Elegantbeef> Nim doesnt even check if a header exists when you compile it, so it's not like it knows where the symbols lie |
00:42:51 | FromDiscord | <Elegantbeef> I suppose you could make something like futhark that compiles the program to extract the value of a symbol |
00:46:01 | FromDiscord | <michaelb.eth> makes sense, thanks for the feedback |
00:46:52 | FromDiscord | <Elegantbeef> No problem |
00:47:35 | FromDiscord | <michaelb.eth> coming at it from a different angle (leave aside locale.h, that was just something I was experimenting with re: Araq's comment), I have a header in which some constants are declared as wide strings using C's `L"..."`.↵↵I was hoping to extract them one way or another so I have them as proper Nim `const` |
00:48:05 | FromDiscord | <Elegantbeef> I mean you can always copy them over manually, but yea there is no automated mechanism |
00:48:19 | FromDiscord | <michaelb.eth> how would you represent a wide string literal in Nim source? |
00:48:42 | FromDiscord | <Elegantbeef> Utf16 encoded into a string |
00:49:17 | FromDiscord | <michaelb.eth> so on Windows wchar_t is uint16 but on e.g. Linux it's 32-bit |
00:49:35 | FromDiscord | <michaelb.eth> afaict, Nim's widestring module makes some incorrect assumptions |
00:50:18 | FromDiscord | <Elegantbeef> I think it makes a single assumption, that silly people use non utf8 encoded strings 😄 |
00:54:05 | FromDiscord | <michaelb.eth> I hear what you're saying, multibyte strings are definitely the way to go... but some folks use wchar_t on systems where it's 4 bytes as a convenient way to store the bytes of a multipoint grapheme cluster |
00:55:07 | FromDiscord | <michaelb.eth> and it happens that in those contexts `L"..."` string literals in the sources is a match for the ordering of the codepoints |
00:55:51 | FromDiscord | <michaelb.eth> (edit) "it's" => "its" | "as" => "are" | "multipoint" => "multi-codepoint" |
00:56:08 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/CDA |
00:56:22 | FromDiscord | <Elegantbeef> Then do `WideStr32("yourwidestringfromtheCfile")` |
00:57:16 | FromDiscord | <michaelb.eth> cool! I'll experiment with that idea |
00:57:25 | FromDiscord | <Elegantbeef> Nim strings afterall are just binary blobs and not any specific encoding |
00:57:40 | FromDiscord | <Elegantbeef> So if you copy a widestring literal inbetween them it should work assuming it's escaped properly |
01:00:11 | * | rockcavera joined #nim |
01:01:17 | FromDiscord | <alcatraz> In reply to @Hourglass, When the Hour Strikes "Any programming language could": yeah but some languages are better than others |
01:05:10 | FromDiscord | <anno> sent a code paste, see https://play.nim-lang.org/#ix=4rdQ |
01:05:41 | FromDiscord | <Elegantbeef> Where's the UB? |
01:05:55 | FromDiscord | <anno> (edit) "https://play.nim-lang.org/#ix=4rdQ" => "https://play.nim-lang.org/#ix=4rdR" |
01:06:04 | FromDiscord | <Elegantbeef> Objects are stack allocated so `var a = b` copies |
01:06:13 | FromDiscord | <Elegantbeef> refs are heap allocated so it copies the pointer to b |
01:07:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4rdS |
01:07:50 | FromDiscord | <anno> 😄 |
01:08:24 | FromDiscord | <Elegantbeef> If you do `x[0].val = 1` it behaves the same since you're mutating the data held by the seq |
01:09:02 | FromDiscord | <anno> Okay, so if I write a generic function, I should never use var to alias into an argument, because it could probably do a copy? |
01:09:14 | FromDiscord | <Elegantbeef> I mean you should if you want to |
01:09:43 | * | beholders_eye quit (Ping timeout: 246 seconds) |
01:09:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4rdY |
01:11:12 | FromDiscord | <Elegantbeef> If you're writing a generic procedure you have think about whether types are values or references and if so what consequences your actions have |
01:12:35 | FromDiscord | <anno> Ah okay. Thank u 🙂 |
01:49:07 | FromDiscord | <anno> sent a code paste, see https://play.nim-lang.org/#ix=4rew |
01:49:49 | FromDiscord | <Elegantbeef> `for y in x.mitems: y.val = 1` |
01:51:24 | FromDiscord | <anno> Great 😄 Thank u again |
02:22:28 | * | arkurious quit (Quit: Leaving) |
02:24:09 | FromDiscord | <michaelb.eth> In reply to @Elegantbeef "Then do `WideStr32("yourwidestringfromtheCfile")`": I tried variations, couldn't get it to work. After additional research, if I want to achieve my `const` goal, I'd need to implement C's `mbstowcs` in pure Nim such that I have a proc that I can call at compile-time with a static Nim string |
02:26:11 | FromDiscord | <michaelb.eth> my initial impression is that there's an issue with byte ordering in the individual `wchar_t` in an array of `whcar_t` |
02:26:30 | FromDiscord | <michaelb.eth> (edit) "array of `whcar_t`" => "`array[N, whcar_t]`" |
02:28:39 | FromDiscord | <Elegantbeef> Hmm this is a bit tricky |
03:00:27 | * | azimut joined #nim |
04:23:16 | * | ltriant joined #nim |
04:30:14 | * | ltriant quit (Ping timeout: 246 seconds) |
04:46:44 | * | ltriant joined #nim |
05:05:46 | * | ltriant quit (Ping timeout: 252 seconds) |
05:08:01 | * | ltriant joined #nim |
05:12:21 | * | ltriant quit (Ping timeout: 255 seconds) |
05:14:14 | * | ltriant joined #nim |
05:19:16 | * | ltriant quit (Ping timeout: 246 seconds) |
05:37:21 | NimEventer | New thread by Naterlarsen: Only one line will load. Need all lines in directory to load., see https://forum.nim-lang.org/t/10022 |
06:09:37 | * | om3ga quit (Ping timeout: 252 seconds) |
06:22:27 | * | rmt joined #nim |
06:23:11 | * | tiorock joined #nim |
06:23:12 | * | tiorock quit (Changing host) |
06:23:12 | * | tiorock joined #nim |
06:23:12 | * | rockcavera is now known as Guest3876 |
06:23:12 | * | tiorock is now known as rockcavera |
06:26:35 | * | Guest3876 quit (Ping timeout: 264 seconds) |
06:31:37 | NimEventer | New thread by noah: Design question: generic methods are deprecated, see https://forum.nim-lang.org/t/10023 |
06:47:12 | FromDiscord | <sOkam!> In reply to @anno "Sorry to bother u": there is also `for id, y in x.mpairs:` if you ever need both the item and its iteration number and the item should be modifiable. pairs does the same idea, but not modifiable |
07:18:51 | * | om3ga joined #nim |
08:46:19 | * | nanxiao joined #nim |
09:37:11 | * | nanxiao quit (Quit: Client closed) |
09:45:43 | * | onetwo38 joined #nim |
09:46:51 | * | onetwo3 quit (Ping timeout: 255 seconds) |
09:50:54 | * | nanxiao joined #nim |
10:14:00 | * | ltriant joined #nim |
10:22:24 | * | oprypin quit (Remote host closed the connection) |
11:21:12 | * | nanxiao quit (Quit: Client closed) |
11:33:57 | * | rmt quit (Ping timeout: 255 seconds) |
11:53:45 | * | jmdaemon quit (Ping timeout: 255 seconds) |
12:43:33 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4rgF |
12:44:20 | FromDiscord | <sOkam!> how can that be printed as 0, but crash on assert because of being 524288... at the same time? |
12:52:02 | FromDiscord | <Recruit_main707> it crashes because it isnt 52488 |
12:52:09 | * | PMunch joined #nim |
12:52:14 | FromDiscord | <Recruit_main707> 524288 |
12:56:01 | FromDiscord | <sOkam!> oh, good catch |
13:46:39 | FromDiscord | <Ayy Lmao> Man ChatGPT isn't half bad at translating c++ to nim, it's actually saving me some typing making bindings. |
14:28:53 | * | alice quit (Quit: *disappears* U_U) |
15:14:38 | * | kas joined #nim |
15:16:54 | FromDiscord | <Gumbercules> In reply to @Ayy Lmao "Man ChatGPT isn't half": have you tested the bindings? |
15:17:16 | FromDiscord | <Gumbercules> also c2nim could already do this fairly well so 🤷 |
15:20:15 | * | cfa joined #nim |
15:20:36 | cfa | morning folks |
15:20:46 | cfa | looks like there's an issue with the nimble directory at the moment? |
15:20:48 | cfa | https://nimble.directory/ |
15:20:52 | cfa | not sure whether it's been reported already |
15:24:45 | cfa | package_directory.nim(533) package_directorypackage_directory.nim(530) main etc. |
15:24:45 | cfa | input(1, 0) Error: { expected |
15:33:49 | * | alice joined #nim |
15:51:47 | FromDiscord | <Ayy Lmao> In reply to @Gumbercules "have you tested the": Yeah they seemed legit. It was mainly just throwing a small list of functions in there so I didn't feel like making a file and cleaning it up and running c2nim. |
15:55:39 | * | cfa left #nim (#nim) |
15:57:45 | FromDiscord | <treeform> In reply to @Ayy Lmao "Man ChatGPT isn't half": I have tried this as well. It made a few errors but worked in the end. ChatGPT is Amazing... |
15:57:59 | FromDiscord | <treeform> (edit) "In reply to @Ayy Lmao "Man ChatGPT isn't half": I have tried this as well. It made a few errors but ... worked" added "they were easy to fix," |
16:03:28 | * | rmt joined #nim |
16:24:36 | FromDiscord | <Gumbercules> It's about as amazing as stack overflow with incorrect answers |
16:25:35 | * | arkurious joined #nim |
16:25:55 | FromDiscord | <deech> When generating bindings how does it figure out ownership and lifetimes? Or does it `void` everything? |
16:35:59 | FromDiscord | <planetis> why does binarySearch https://nim-lang.github.io/Nim/algorithm.html#binarySearch%2CopenArray%5BT%5D%2CK%2Cproc%28T%2CK%29 has two generic parameters? How that can ever be useful? |
16:36:44 | FromDiscord | <planetis> lower/upperBound as well, but not sort |
16:37:40 | FromDiscord | <planetis> let me make a PR and see what it breaks |
16:39:15 | FromDiscord | <healdove> are you asking why it'd be useful, or are you asking how code could ever even use it? |
16:40:28 | FromDiscord | <healdove> really contrived example\: you have an array of strings representing ints, and you're searching for an int |
16:41:00 | FromDiscord | <healdove> T is string but K is int, the cmp func would convert T to int before comparing |
16:41:22 | FromDiscord | <healdove> if T=K, you'd have to write this in a way that the cmp func would also convert K to int every time |
16:41:37 | FromDiscord | <healdove> (or use closure context but... it's a contrived example) |
16:43:10 | FromDiscord | <planetis> right mixing up types |
16:45:05 | FromDiscord | <planetis> I had already made my PR when I read your reply, so I still submitted it |
16:47:07 | FromDiscord | <healdove> would still be nice to have something documenting why T!=K \:) |
16:47:11 | FromDiscord | <planetis> so it failed with colors.nim where it has an array of (string, Color) and key is string |
16:47:24 | FromDiscord | <healdove> ah! that's a good example |
16:50:12 | FromDiscord | <Nilts> sent a code paste, see https://paste.rs/pCy |
17:20:52 | FromDiscord | <mk-fg> -+ |
17:20:54 | FromDiscord | <mk-fg> + |
17:21:22 | * | azimut quit (Remote host closed the connection) |
17:22:01 | * | azimut joined #nim |
17:40:23 | * | Notxor joined #nim |
17:50:46 | FromDiscord | <Hourglass [She/Her]> How would I go about assigning a ref object to the field of another ref object initialised in a shared library? There's some off behaviour I've found where the field won't get set no matter what I try |
17:59:16 | FromDiscord | <Hourglass [She/Her]> Using the `orc` memory manager and on latest Nim devel |
18:06:10 | * | PMunch quit (Quit: leaving) |
18:45:08 | * | rmt quit (Ping timeout: 265 seconds) |
18:46:25 | FromDiscord | <Hourglass [She/Her]> I've been lost on this for a while now ngl |
18:50:09 | FromDiscord | <auxym> post some code? |
18:54:23 | FromDiscord | <jmgomez> In reply to @Ayy Lmao "Man ChatGPT isn't half": Not sure about ChatGPT but copilot did easily 90%+ the manual part of the bindings for NUE |
18:55:21 | FromDiscord | <Hourglass [She/Her]> In reply to @auxym "post some code?": Hold on, I'll need a bit for a minimal reproducible example |
19:17:31 | FromDiscord | <Hourglass [She/Her]> ...that's odd? My minimal reproducible example isn't reproducing the bug |
19:23:54 | * | jmdaemon joined #nim |
19:28:38 | FromDiscord | <Elegantbeef> Does your ref issue disappear if you `GcRef` the ref? |
19:35:12 | FromDiscord | <Hourglass [She/Her]> Okay this is the most absurd thing ever |
19:35:25 | FromDiscord | <Hourglass [She/Her]> I'm not sure exactly what I did but the issue is just gone |
19:35:32 | FromDiscord | <Hourglass [She/Her]> I'm so unbelievably confused |
19:43:09 | FromDiscord | <Hourglass [She/Her]> I am so confused |
19:43:36 | FromDiscord | <Hourglass [She/Her]> `gdb` seems to just crash as soon as I run my program through the debugger |
19:43:57 | FromDiscord | <Hourglass [She/Her]> Even though running it without a debugger works just fine |
19:44:25 | FromDiscord | <ieltan> hm |
19:44:31 | FromDiscord | <Hourglass [She/Her]> The issue is with `No handles or timers registered in dispatcher. [ValueError]` when running through a debugger |
19:44:47 | FromDiscord | <Hourglass [She/Her]> Let me paste the exact log |
19:45:35 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4riw |
19:45:54 | FromDiscord | <Hourglass [She/Her]> Hold on that cut off while copying |
19:46:02 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4rix |
19:46:22 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://paste.rs/ZQ2 |
19:46:30 | FromDiscord | <Elegantbeef> What would you be trying to await |
19:46:35 | FromDiscord | <Hourglass [She/Her]> (`Pre-start`is just my program's output) |
19:46:40 | FromDiscord | <ieltan> that was lazy but there should be an async proc in there |
19:47:42 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4riy |
19:47:54 | FromDiscord | <Elegantbeef> Do not forget to anotate it `async` |
19:48:55 | FromDiscord | <Hourglass [She/Her]> I am so lost on all these issues |
19:49:01 | FromDiscord | <ieltan> In reply to @Elegantbeef "It should be possible": Thanks : |
19:49:03 | FromDiscord | <ieltan> (edit) ":" => "!" |
19:50:51 | FromDiscord | <Hourglass [She/Her]> I don't think the debugger likes `runForever` |
19:51:24 | FromDiscord | <Hourglass [She/Her]> Since that's the line the program crashes on |
19:52:40 | FromDiscord | <Ayy Lmao> In reply to @jmgomez "Not sure about ChatGPT": Ooh that's interesting. I'll have to look into that, I haven't used it yet. |
19:52:49 | * | Mi left #nim (#nim) |
19:58:07 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4riB |
19:58:13 | FromDiscord | <Elegantbeef> nope |
19:58:26 | FromDiscord | <Ayy Lmao> Well darn |
19:58:33 | FromDiscord | <Elegantbeef> Well if it's an array technically `values.addr` is that |
19:58:39 | FromDiscord | <Elegantbeef> You can always write a proc if you want |
19:59:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4riC |
20:00:08 | FromDiscord | <Ayy Lmao> True, I was hoping there was a nicer way that was idiomatic though. |
20:00:30 | FromDiscord | <Elegantbeef> Just use an openarray instead 😄 |
20:00:45 | FromDiscord | <Elegantbeef> Depends what you're doing though |
20:02:09 | FromDiscord | <Ayy Lmao> I'm just doing stuff with sequences and ImPlot where you need to pass addresses to data for it to plot it. Eventually I'll wrap the functions in nicer nim friendly ones. |
20:02:54 | FromDiscord | <Elegantbeef> Yea do the lowlevel operations on a proc that takes a openarray and that should make it less ugly |
20:03:35 | FromDiscord | <Ayy Lmao> I'm curious if you think it is worth using templates? Would there be a lot of overhead with using a proc to wrap? |
20:04:20 | FromDiscord | <Elegantbeef> C compilers are smart |
20:04:21 | FromDiscord | <Elegantbeef> They know when something is simple enough to inline |
20:04:22 | FromDiscord | <Elegantbeef> If really worried use `{.inline.}` |
20:04:46 | FromDiscord | <Ayy Lmao> Alright sounds good. |
20:05:27 | FromDiscord | <Elegantbeef> Doubt it would be that impactful but in debug builds always inlining will slow down compilation a tinge |
20:06:17 | FromDiscord | <Ayy Lmao> I guess I just won't inline unless I notice issues. |
20:06:54 | FromDiscord | <Elegantbeef> The places where inlining makes sense is when the operation is cheaper than a proc call |
20:06:55 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4riG |
20:07:37 | FromDiscord | <Elegantbeef> Otherwise it's just wishful optimising 😄 |
20:08:09 | FromDiscord | <Elegantbeef> Perhaps the generated type is cyclical Phil |
20:08:24 | FromDiscord | <Elegantbeef> Look at the `-d: debugOwkettle` or w/e and see if that holds water |
20:08:27 | FromDiscord | <Phil> Minimized the example |
20:08:27 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4riG" => "https://play.nim-lang.org/#ix=4riH" |
20:09:09 | FromDiscord | <Elegantbeef> Also you can do `echo state[]` |
20:10:19 | FromDiscord | <Elegantbeef> That code does not compile with orc and 1.6.12 |
20:10:21 | FromDiscord | <Elegantbeef> What version are you on? |
20:10:39 | * | beholders_eye joined #nim |
20:11:54 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4riI |
20:13:05 | FromDiscord | <Phil> So you can't repr a state because it packs a reference to itself |
20:13:24 | FromDiscord | <Elegantbeef> Depending on your nim version and gc |
20:13:25 | FromDiscord | <Elegantbeef> It worked fine with refc |
20:13:36 | FromDiscord | <Phil> That is surprisingly not an issue in 1.6.10 |
20:13:41 | FromDiscord | <Phil> Yeh, just checked |
20:13:48 | FromDiscord | <Phil> with orc it is an issue |
20:14:03 | FromDiscord | <Phil> Which I don't get, how does this become problematic for reprß |
20:14:06 | FromDiscord | <Phil> (edit) "reprß" => "repr?" |
20:14:18 | FromDiscord | <Phil> The data structure itself doesn't change, right? |
20:14:19 | FromDiscord | <Elegantbeef> Repr is implemented differently for the MMs |
20:14:24 | FromDiscord | <Elegantbeef> Orc might not have a cycle breaker |
20:14:37 | FromDiscord | <Elegantbeef> I personally cannot get it to compile with orc |
20:14:40 | FromDiscord | <Phil> Ah, repr is mm dependent, check |
20:37:32 | * | azimut quit (Ping timeout: 255 seconds) |
20:38:25 | FromDiscord | <Phil> Hmmm if I want to have a mini CLI, is there a way I can do that with nimscript but call it like a binary?↵Like, I'd love to be able to do something like:↵`owl newwidget myproject/somefolder/widgetname.nim` |
20:39:04 | FromDiscord | <Phil> which means I'd need... a binary in the path? Can I have nimscript behave as if it were a binary or something? |
20:39:59 | FromDiscord | <Elegantbeef> owl could be your own nimscript based program |
20:40:13 | FromDiscord | <Elegantbeef> You also can use shebangs |
20:40:23 | FromDiscord | <Phil> Yeah, it's just I don't know how to execute nimscript without calling the nim compiler |
20:40:39 | FromDiscord | <Elegantbeef> That is afterall how python programs are generally run |
20:41:07 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/nims.html#standalone-nimscript |
20:43:26 | FromDiscord | <Phil> Okay, so I can use shebang to not have to specify the nim compiler, can I just leave out ".nims" at the end of the file? docs says no |
20:43:43 | FromDiscord | <Elegantbeef> I think you can now |
20:43:45 | FromDiscord | <Phil> So I could do `owl.nims newwidget myproject/somefolder/widgetname.nim` |
20:43:51 | FromDiscord | <Phil> Testing |
20:44:19 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4riO |
20:45:16 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4riP |
20:45:58 | FromDiscord | <Phil> or accepting that the user must write `owl.nims` |
20:46:38 | FromDiscord | <Elegantbeef> One moment |
20:48:12 | FromDiscord | <Elegantbeef> `#!/usr/bin/env -S nim e` |
20:48:27 | FromDiscord | <Elegantbeef> there you can have a extensionless nimscript file |
20:50:53 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4riQ |
20:51:07 | FromDiscord | <Elegantbeef> Yep |
20:51:24 | FromDiscord | <Elegantbeef> It seems wrong though cause it loads the file as a config |
20:51:49 | FromDiscord | <Phil> Okay, does work, though the fact it loads config.nims is concerning |
20:52:07 | FromDiscord | <Elegantbeef> I mean `config.nims` is always used if next to the nim file |
20:52:09 | FromDiscord | <ezquerra> Is there a way to "eval" a nimscript expression provided by the user (as an input to the program) at runtime? |
20:52:10 | FromDiscord | <Phil> The nice thing though is this opens the door for every framework to bundle with it its own CLI helper |
20:52:41 | FromDiscord | <Elegantbeef> I mean Picostdlib and Nico just shipped a binary |
20:52:54 | FromDiscord | <Elegantbeef> Yes there is ezquerra, use the compiler API |
20:53:04 | FromDiscord | <Elegantbeef> This can be done manually or by using nimscripter |
20:53:32 | FromDiscord | <Phil> I'd prefer not shipping a binary because that feels more error prone for alternative platforms |
20:53:39 | FromDiscord | <Phil> since they'd need their own binaries |
20:53:47 | FromDiscord | <Elegantbeef> How it's compiled when you install the package |
20:53:50 | FromDiscord | <Phil> And I don't wanna bother with that when I can just use nimscript which uses the compiler |
20:54:16 | FromDiscord | <Phil> (edit) "And I don't wanna bother with that when I can just use nimscript which uses the compiler ... " added "which somebody else already guarantees me is working for that platform" |
20:54:39 | FromDiscord | <Phil> Less tools in the mix and thus more stable imo |
20:55:52 | FromDiscord | <Elegantbeef> Anyway the worst part about using nimscript is that it's quite limited |
20:56:32 | FromDiscord | <Phil> it's fine. I don't need it to execute complex logic, I need it to generate folders with files in it for me, maybe attach a string to a part of another file at most |
21:02:02 | FromDiscord | <ezquerra> In reply to @Elegantbeef "Yes there is ezquerra,": Looking at the nimscripter readme, it seems you must call invoke, passing a known function name. Won't that fail to compile if you try to do that at runtime? |
21:02:36 | FromDiscord | <ezquerra> I'd be nice if there was an example of reading some input from a user and running it through nimscripter at runtime if that is possible 🙂 |
21:03:05 | FromDiscord | <Phil> How do I get the commandline in that? |
21:03:37 | FromDiscord | <Elegantbeef> Ezquerra loading a nimscript file calls all top level code |
21:03:49 | FromDiscord | <Phil> nevermind, I have std/os |
21:04:00 | FromDiscord | <Elegantbeef> The first example uses just a string with no invoke |
21:06:33 | FromDiscord | <Nilts> In reply to @not logged in "bumping this. still ping": Did i miss an answer again? Although idk how i could miss a ping... |
21:07:21 | FromDiscord | <Elegantbeef> You declare a variable then attempt to call that variable |
21:10:50 | FromDiscord | <Nilts> you wonder how stupid i can be sometimes. Anyways, thanks! |
21:15:21 | * | om3ga quit (Ping timeout: 255 seconds) |
21:16:18 | * | joast quit (Ping timeout: 250 seconds) |
21:23:50 | * | junaid_ joined #nim |
21:44:56 | arkanoid | is there Nim equivalent of https://blessed.rs/crates ? |
21:46:00 | * | junaid_ quit (Remote host closed the connection) |
21:47:06 | FromDiscord | <Phil> awesome-nim |
21:47:56 | FromDiscord | <Phil> https://github.com/ringabout/awesome-nim |
21:56:54 | arkanoid | thanks! |
21:57:19 | FromDiscord | <Phil> What surprises me is that owlkettle isn't on that list |
21:57:35 | FromDiscord | <Phil> Particularly with the recent pushes I'd claim it's well enough documented to make the cut |
21:59:15 | FromDiscord | <Nilts> In reply to @Isofruit "What surprises me is": what is owlkettle |
22:00:40 | FromDiscord | <Phil> In reply to @not logged in "what is owlkettle": project from can lehman. Essentially a framework/wrapper (?) built around GTK4.↵And really easy to pick up imo. Like, I managed to get started in it pretty quickly.↵I wouldn't say I have any mastery, but I managed to start contributing the docs explaining all the surrounding features (setters, hooks etc.) within a week or two |
22:02:04 | FromDiscord | <Phil> Which imo speaks for the framework |
22:02:05 | FromDiscord | <Nilts> In reply to @Isofruit "project from can lehman.": kind of looks like karx |
22:02:09 | FromDiscord | <Nilts> (edit) "karx" => "karax" |
22:02:17 | FromDiscord | <Nilts> anyway, looks really cool |
22:02:18 | FromDiscord | <Phil> Yeah, which is why I picked it up easily enough |
22:02:36 | FromDiscord | <Phil> With the recent addition of the style attribute you can also pass your own css classes easily enough |
22:03:06 | FromDiscord | <Nilts> I might use that for my future ui endeavors. |
22:04:33 | FromDiscord | <Phil> I have not yet played around with how to test owlkettle for reference and I'm not sure can has checked for that |
22:06:40 | * | Notxor quit (Remote host closed the connection) |
22:07:22 | FromDiscord | <Nilts> oh, yeah. wtf is method, I never really understood it. |
22:08:51 | FromDiscord | <Elegantbeef> Dispatching the procedure based off runtime information |
22:09:47 | FromDiscord | <Yandall> Is someone else using vscode? |
22:09:52 | FromDiscord | <Phil> Yes |
22:10:31 | FromDiscord | <Elegantbeef> No after 23.01 vscode is now a singleton application and only one person an use it at a time, congrats |
22:10:38 | FromDiscord | <Yandall> Do you know how to use correctly the debugger? I get pretty lost using it |
22:11:09 | FromDiscord | <Elegantbeef> https://github.com/saem/vscode-nim#debugging |
22:11:23 | FromDiscord | <Phil> I can't say I use the debugger in that regard |
22:13:53 | FromDiscord | <jmgomez> Did someone give this a shot already? https://github.com/nim-lang/Nim/pull/21517 |
22:14:43 | FromDiscord | <Nilts> In reply to @Elegantbeef "Dispatching the procedure based": and what does that mean |
22:16:55 | FromDiscord | <Yandall> In reply to @Elegantbeef "https://github.com/saem/vscode-nim#debugging": I don't know if there is something that I'm missing but in this case I can't see the `body` variable https://media.discordapp.net/attachments/371759389889003532/1087137653645901834/image.png |
22:22:54 | FromDiscord | <Nilts> In reply to @Yandall "I don't know if": try breaking on the next line. |
22:23:54 | FromDiscord | <Yandall> In reply to @not logged in "try breaking on the": It gets even more confusing https://media.discordapp.net/attachments/371759389889003532/1087139413445836901/image.png |
22:25:13 | FromDiscord | <Nilts> In reply to @Yandall "It gets even more": it could be possible the the generated code from the async macro is messing the debugger up. |
22:30:03 | FromDiscord | <Elegantbeef> The debugger doesnt really understand Nim types |
22:30:32 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/commit/cae539996a9a3b4c79af06d9ba8a0f9273bab3e1 does address this a bit |
22:30:39 | FromDiscord | <Yandall> In reply to @not logged in "it could be possible": That could be the case. In a non async proc is more readable |
22:31:07 | FromDiscord | <Elegantbeef> An async proc is also a closure which means it's really a `(ptr, proc)` |
22:31:16 | FromDiscord | <Elegantbeef> hence `colonEnvP` |
22:33:55 | FromDiscord | <Yandall> It seems that is better to just print my variables to know what is in them |
22:39:01 | FromDiscord | <Elegantbeef> It's generally the easier path |
22:39:16 | FromDiscord | <Elegantbeef> Debuggers work with nim but only to an extent |
22:41:41 | FromDiscord | <jmgomez> Worth mentioning that if you use types outside Nim (i.e C++ std or something like that) they work fine |
22:42:16 | FromDiscord | <Elegantbeef> Yea the main issue is that Nim has types that are actually distinct from their implementation |
22:42:51 | FromDiscord | <Elegantbeef> Like a `set[X]` is either `uint8` `uint16` `uint32` `uint64` or a `array[bitLen div 8, uint8` |
22:43:13 | FromDiscord | <jmgomez> I see, never thought of that. So it unfixable? |
22:43:21 | FromDiscord | <jmgomez> (edit) "I see, never thought of that. So it ... unfixable?" added "'s" |
22:43:23 | FromDiscord | <Elegantbeef> It's fixable likely |
22:43:34 | FromDiscord | <Elegantbeef> If someone puts in the effort in the compiler/debugger script |
22:43:45 | FromDiscord | <huantian> Beef that could be you! |
22:44:02 | FromDiscord | <Elegantbeef> That involves writing python, i'd rather put my thingy where i wouldnt put my fingies |
22:44:04 | FromDiscord | <jmgomez> No skin in the game, beef just use echo 😛 |
22:44:20 | FromDiscord | <jmgomez> (edit) "use" => "uses" |
22:44:34 | FromDiscord | <Elegantbeef> Why do you need anything else |
22:44:59 | FromDiscord | <jmgomez> There is the pynim thing, or whatever the name is though maybe that works? |
22:45:02 | FromDiscord | <Elegantbeef> `writeStackTrace` and `echo` has got me to fix compiler bugs, so uhhh yea |
22:45:13 | FromDiscord | <Elegantbeef> It doesnt emit python from Nim |
22:45:13 | FromDiscord | <jmgomez> yes, but people like debuggers |
22:45:34 | FromDiscord | <Elegantbeef> gdb and lldb both use python for pretty printers afaik |
22:45:54 | FromDiscord | <Elegantbeef> but anywho if someone wanted to make the experience better i'm sure they could |
22:46:07 | FromDiscord | <jmgomez> btw, how would you approach a way to debug the vm, is it even possible? |
22:46:08 | FromDiscord | <Elegantbeef> Personally i'd emit a `debug` for each type Nim instantiates |
22:46:18 | FromDiscord | <Elegantbeef> Though @amadan has said that there are issues with that idea |
22:46:38 | FromDiscord | <Elegantbeef> There are some VM diagnostics, performance and writing each stack frame |
22:46:56 | FromDiscord | <jmgomez> where I can learn more about those? |
22:47:06 | FromDiscord | <Elegantbeef> Think it's `profileVm` |
22:47:17 | FromDiscord | <Elegantbeef> `--profileVm:on` i think shows registers and operations as they go |
22:47:55 | FromDiscord | <!&luke> Hi |
22:47:56 | FromDiscord | <Elegantbeef> There is no way to debug the runtime code aside from that though |
22:47:57 | FromDiscord | <jmgomez> In reply to @Elegantbeef "but anywho if someone": the big task missing for being feature complete for NUE is after the VM a decent plugin for code. Maybe I can try to look at debugging there, although UE types are just fine which is what people uses |
22:48:03 | FromDiscord | <Elegantbeef> It's mostly just for debugging the VM |
22:48:10 | FromDiscord | <jmgomez> gotcha |
22:48:27 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/devel/compiler/vm.nim#L567 |
22:49:37 | FromDiscord | <Elegantbeef> It's not that helpful for user code |
22:49:39 | FromDiscord | <Elegantbeef> Mostly for the VM |
22:49:46 | FromDiscord | <jmgomez> oh that's cool, but tbh I have no idea how the opcodes work |
22:50:42 | FromDiscord | <Elegantbeef> Do you know how assembly works? 😄 |
22:50:49 | FromDiscord | <Elegantbeef> VMs are just your own defined assembly |
22:52:54 | FromDiscord | <jmgomez> Just the very basic stuff from the Uni back in the day. So it's a set of instructions, I really need to dig in into the compiler |
22:53:46 | FromDiscord | <Hourglass [She/Her]> In reply to @jmgomez "There is the pynim": Nimpy |
22:53:50 | FromDiscord | <Elegantbeef> Yea Nim's VM to my recollection is just a simple `opcode, left, right` |
22:54:21 | NimEventer | New post on r/nim by ChapolinBond: Noob question about Nim, see https://reddit.com/r/nim/comments/11w0gvj/noob_question_about_nim/ |
22:58:57 | anddam | I am trying to figure if and how I can use a more up-to-date version of nimgl/imgui |
22:59:43 | FromDiscord | <Elegantbeef> Pin to the specific commit you want |
23:00:00 | anddam | from what I understand nimgl/cimgui is a programmatically generated wrapper on dear-imgui, and nimgl/imgui has a generator.nim to provide all the enums and whatnot |
23:01:16 | anddam | so if I clone --recursive, go into cimgui-imgui submodule and update that (to docking branch btw), then generate cimgui via the script, then I can call the top-level generate.nim (that I imagine I have to compile first) to generate the new imgui.nim |
23:01:30 | anddam | once this is done how do I tell nimble "here install this thing I just built" |
23:01:33 | anddam | ? |
23:01:58 | FromDiscord | <Elegantbeef> Push to your fork and then depend on that fork |
23:02:19 | anddam | as in an https git URL? |
23:02:25 | anddam | can that be a local file:/// |
23:02:26 | FromDiscord | <Elegantbeef> yes |
23:02:56 | anddam | depend? as in a project dependency? |
23:02:57 | FromDiscord | <Elegantbeef> I mean you an depend on it locally with `nimble develop` if on 1.6.x and below |
23:03:12 | FromDiscord | <Elegantbeef> If on 1.9.x you can do `nimble develop --global` |
23:03:14 | FromDiscord | <Elegantbeef> Yes |
23:04:04 | anddam | there's nim 1.9? |
23:04:08 | anddam | I am on 1.6.10 |
23:04:20 | FromDiscord | <Elegantbeef> 1.9.1 is devel for 2.0 |
23:04:29 | FromDiscord | <Elegantbeef> 1.6.12 is the most recent stable |
23:04:30 | anddam | oh that makes sense, I installed "stable" |
23:04:55 | FromDiscord | <Elegantbeef> With nim any odd number of minor or patch is a development build |
23:05:13 | FromDiscord | <jmgomez> Did someone in the community attempted to do a runtime reflection system for Nim? Cant find anything around |
23:05:32 | FromDiscord | <Elegantbeef> IE 1.5.1 was development for 1.6.0, 1.6.1 for 1.6.2 , and so on |
23:05:34 | anddam | like ye Olde Softuar of Yesteryear |
23:05:44 | FromDiscord | <Elegantbeef> Ew runtime reflection |
23:06:32 | FromDiscord | <jmgomez> Yeah, but again it could improve the dev workflow. You can turn it off on release |
23:06:59 | anddam | Elegantbeef: your initial "Pin to the specific commit you want" makes me think it's easier than I concocted |
23:07:21 | FromDiscord | <Elegantbeef> Well if imgui has a release you want that isnt tagged you can pin to that |
23:07:25 | FromDiscord | <Elegantbeef> If it doesnt you need to fork and make it |
23:07:34 | FromDiscord | <Elegantbeef> No clue what you need runtime reflection for jm |
23:07:45 | FromDiscord | <Elegantbeef> I tend to avoid anything that uses RTTI, it's just ugh |
23:08:32 | anddam | Elegantbeef: imgui has (more) recent tags, but I guess those are in master, I am looking for the docking feature |
23:08:54 | FromDiscord | <jmgomez> Well, just thinking that what I did for NUE can be applied to any Nim project. Like imaging having a server or an UI that you can draft on NimScript |
23:09:09 | FromDiscord | <jmgomez> The issue with RTTI is functions, you cant emit them |
23:09:11 | anddam | nimgl/imgui has a docking branch, but once I installed nimble https://fubar.git@#docking the resulting app does not have the docking feature (that I can see) |
23:09:54 | FromDiscord | <Elegantbeef> You may need to install the specific commit |
23:10:24 | FromDiscord | <Elegantbeef> I do not quite know and the author isnt active here anymore |
23:15:33 | anddam | thanks as usual |
23:16:37 | FromDiscord | <Elegantbeef> Jm my thinking is that can you not do what you do with compile time logic |
23:22:07 | FromDiscord | <jmgomez> But still worth it, I mean obviously it's a subset of Nim I didnt use it for real stuff yet, but I cant see what on daily base use it will be problematic. I started to write the macros inside the VM directly actually |
23:22:17 | FromDiscord | <jmgomez> Where do you see the bigger gaps? |
23:23:05 | FromDiscord | <jmgomez> (edit) "But still worth it, I mean obviously it's a subset of Nim I didnt use it for real stuff yet, but I cant see what on ... dailybasis" added "a" | "base" => "basis" |
23:24:07 | FromDiscord | <Elegantbeef> I was just wondering if what you do requires RTTI or can be done statically with marcos |
23:24:10 | FromDiscord | <Elegantbeef> macros even |
23:24:53 | FromDiscord | <jmgomez> Like for NUE you mean? |
23:25:05 | FromDiscord | <Elegantbeef> Yes |
23:25:30 | FromDiscord | <jmgomez> It needs to be at runtime because I query the UE reflection system |
23:26:13 | FromDiscord | <jmgomez> https://github.com/jmgomez/NimForUE/blob/594a1e231c74b7c07c5558e7234e5f9703851bed/src/nimforue/vm/nimvm.nim#L122 |
23:27:12 | FromDiscord | <jmgomez> It isnt finished yet, that's for the borrow thing (to overwrite the UE funcs) for the regular interop is in here: proc setPropWithValueInMemoryBlock(prop : FPropertyPtr, memoryRegion:ByteAddress, value : JsonNode, allocatedStrings : var TArray[pointer], propOffset:int32 = prop.getOffset()) = |
23:27:29 | FromDiscord | <jmgomez> It isnt finished yet, that's for the borrow thing (to overwrite the UE funcs) for the regular interop is in here: https://github.com/jmgomez/NimForUE/blob/594a1e231c74b7c07c5558e7234e5f9703851bed/src/nimforue/vm/uecall.nim#L36 |
23:27:36 | FromDiscord | <Elegantbeef> Isnt this mostly just due to the UE requirement |
23:27:52 | FromDiscord | <Elegantbeef> If you're writing pure Nim you can just do what nimscripter does and expose the native code as is |
23:27:53 | FromDiscord | <jmgomez> (edit) "https://github.com/jmgomez/NimForUE/blob/594a1e231c74b7c07c5558e7234e5f9703851bed/src/nimforue/vm/uecall.nim#L36" => "↵https://github.com/jmgomez/NimForUE/blob/594a1e231c74b7c07c5558e7234e5f9703851bed/src/nimforue/vm/uecall.nim#L111" |
23:28:45 | FromDiscord | <jmgomez> Technically yes, and probably for a subset of it it will be better to do it that way (once the bindings are generated) |
23:29:08 | FromDiscord | <jmgomez> however, you lost the option to bind a funcion in the vm without restarting the host |
23:29:38 | FromDiscord | <jmgomez> Like if a function is added after the vm is compiled, you can hook it in the script directly |
23:30:16 | FromDiscord | <Elegantbeef> I'd wager to say that is an unlikely operation to have done safely anyway |
23:30:27 | FromDiscord | <Elegantbeef> It's an issue that harms hot code reload in general |
23:30:37 | FromDiscord | <Elegantbeef> You can change bodies but not headers |
23:31:22 | FromDiscord | <jmgomez> Yeah but I mean, the vm is in a dll that gets compiled once (it takes a while compiling the Nim part cause UE + Nim compiler) |
23:31:39 | FromDiscord | <jmgomez> If you add in another dll a function, or in blueprint or cpp, you can hook it safely in the script |
23:32:10 | FromDiscord | <jmgomez> if something doesnt match with the function, the host doesnt allow you to hook it. It shows you an error on the UE's console |
23:32:58 | FromDiscord | <Elegantbeef> Yea i do not follow one bit |
23:33:01 | FromDiscord | <jmgomez> Im just leveraging on UE"s reflection system for the heaving lifting. You can emit/change functions at runtime (they needed to do it for their script lang back in the day) |
23:33:59 | FromDiscord | <jmgomez> basically Im changing UFunction not C/C++ functions. They do have a native implementation which always have the same signature |
23:34:15 | FromDiscord | <Elegantbeef> Sure, but i'm talking about pure Nim programs |
23:35:05 | FromDiscord | <jmgomez> ok lol, that why I asked you before. I do not change regular Nim funcs. But if Nim had a similar reflection system it will work for that subset of reflected funcs |
23:36:10 | FromDiscord | <Elegantbeef> Well that's not even a reflection system in my eyes, it's just a plugin system |
23:37:17 | FromDiscord | <jmgomez> Maybe, plugin sounds more high level to me, like dlls. But for sure you need the introspection part at runtime to know what to change |
23:38:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/OC9 |
23:38:15 | FromDiscord | <Elegantbeef> Something like this |
23:38:55 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4rjg |
23:39:06 | FromDiscord | <jmgomez> Yup, it can be emitted silently under a pragma or another name for the func/proc keyworkd |
23:39:33 | FromDiscord | <Elegantbeef> Then when subscribing the otherside would do like `subscribeProc(name, [VoidTyp])` |
23:39:49 | FromDiscord | <Elegantbeef> This just seems like a procedure plugin system if you ask me |
23:40:00 | FromDiscord | <Elegantbeef> Could use Nimscript, Wasm, SystemLibraries |
23:40:50 | FromDiscord | <jmgomez> Yeah, but the important part is do you agree with me that it can be really handy? Specially on projects where you need to test things quickly for experimentation etc. |
23:40:57 | FromDiscord | <Elegantbeef> In the case of wasm or system libraries you'd just call a `initHooks` procedure which would setup all your procedures |
23:41:05 | FromDiscord | <Elegantbeef> I mean it's a plugin system of course it can be handy |
23:41:07 | FromDiscord | <Elegantbeef> But it doesnt need reflection |
23:41:32 | FromDiscord | <Elegantbeef> Atleast runtime reflection |
23:41:47 | FromDiscord | <jmgomez> problem with wasm is that you dont use Nim anymore, do you? |
23:41:50 | FromDiscord | <Elegantbeef> Also worth noting you can even override `()` |
23:41:54 | FromDiscord | <Elegantbeef> So what? |
23:41:59 | FromDiscord | <Elegantbeef> That's what the `interopThunk` is for |
23:42:10 | FromDiscord | <Elegantbeef> It converts the arguments to the underlying type and calls the underlying code |
23:42:38 | FromDiscord | <Elegantbeef> It's a general solution to runtime interop across any environment |
23:42:40 | FromDiscord | <jmgomez> I still dont get if the code is not there to stay why you dont just prefer to use the VM |
23:43:08 | FromDiscord | <Elegantbeef> Cause i proposed a cross environment API to your plugin system |
23:43:18 | FromDiscord | <Elegantbeef> Who said the code isnt there to stay? |
23:43:39 | FromDiscord | <Elegantbeef> I look at wasm as a runtime scripting backend that is language agnostic and usable for scripting games either permanently or for mods |
23:44:25 | FromDiscord | <jmgomez> Well the dicothomy then is Nim code in both sides, one temporary VS Nim code in one side and something else that talks to WASM in the other |
23:44:33 | FromDiscord | <jmgomez> Okay, the mods makes sense |
23:44:38 | FromDiscord | <Elegantbeef> wasm is not just for prototyping but a sandboxed, cross platform, cross language backend, for scripting and modding |
23:44:42 | FromDiscord | <Elegantbeef> It's not even Nim on both sides |
23:45:00 | FromDiscord | <Elegantbeef> I generally use Nim on both sides, but there is no reason not to imagine one day i want to write another language |
23:45:54 | FromDiscord | <jmgomez> In reply to @Elegantbeef "It's not even Nim": Im still waiting for an example of something that you use on a daily basis and cant be done in Nim script. Besides importc |
23:46:28 | FromDiscord | <Elegantbeef> Like if you make your project in a module way that wasm works for and it's not a bottleneck, why would you convert it to native |
23:46:28 | FromDiscord | <Elegantbeef> Why does it matter if nimscript can do it |
23:46:43 | FromDiscord | <Elegantbeef> I write open software on an open os using an open language, why should i close down a scripting backend |
23:47:15 | FromDiscord | <Elegantbeef> If i write something that i want scripting support, i want anyone to script using what they're conformable with |
23:47:32 | FromDiscord | <Elegantbeef> If they want to use luavascript 2047 they can |
23:47:39 | FromDiscord | <jmgomez> I guess that depends on the scope. Switching langs also have kind of a cognitive overhead, you need to get use to it etc. I suffer it when witching C++/Nim a lot, especially going from Nim to C++ |
23:47:53 | FromDiscord | <Elegantbeef> Sure but I'm not looking for myself |
23:48:02 | FromDiscord | <Elegantbeef> I imagine that people will use my project/code |
23:48:10 | FromDiscord | <jmgomez> Okay, yeah and that makes sense |
23:48:26 | FromDiscord | <jmgomez> I look mostly for my use case |
23:48:44 | FromDiscord | <Elegantbeef> The point of mentioning wasm in this case was not "Haha use Wasm" but making your suggested tool actually reusable |
23:48:54 | FromDiscord | <Elegantbeef> There is nothing like code that looks useful but is purposely limited |
23:49:41 | FromDiscord | <Elegantbeef> If you could design a plugin system that supports N number of backends without much extra work, it seems like a sensible thing |
23:49:45 | FromDiscord | <jmgomez> Yeah, I mean I needed to build a layer between NUE and NimScript nothing stops me to open that layer to a C interface or WASM |
23:50:36 | FromDiscord | <Elegantbeef> This is also why I stay away from RTTI and runtime reflection, it's much too implementation specific for my liking |
23:51:06 | FromDiscord | <jmgomez> gotcha |
23:51:13 | FromDiscord | <Elegantbeef> In the above example the RTTI used would be an array of enums |
23:51:33 | FromDiscord | <Elegantbeef> A simple RTTI that is very easily reproducible |
23:52:03 | FromDiscord | <jmgomez> I see. I will bug you if I ever come back and implement the idaea 😛 ↵I have to go, it's late around here. Nice chat! |
23:52:55 | FromDiscord | <Elegantbeef> Well before you go i have to mention that wasm3 does something similar with it's RTTI it uses a string so like `v(v)` is a void proc or `i(v)` is a void proc that returns an int |
23:53:07 | FromDiscord | <Elegantbeef> Really simple, so it's easy and cross platform |
23:53:14 | FromDiscord | <Elegantbeef> But yea buh bye |