<< 11-03-2025 >>

00:37:04FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=QCoQrooi
00:40:41FromDiscord<Elegantbeef> You can set the destructor for the object it points to `proc =destroy(obj: typeof(ModuleSynthComputer()[])) = ....`
00:41:10FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=bsHwlgsx
00:41:36FromDiscord<Elegantbeef> Bit odd that you're namespacing your types if you ask me 😄
00:42:48FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=ELdnXxli
00:43:03FromDiscord<Elegantbeef> You're prefixing them with `Module`
00:43:32FromDiscord<System64 ~ Flandre Scarlet> Should I remove the prefix?
00:43:55FromDiscord<Elegantbeef> I would as it's just pointless verbiage if you want my view
00:54:47FromDiscord<.tokyovigilante> Hey, on my continuing journey to use Nim to import every C library there is, I've extended the `wayland-scanner` tool to generate a Nim FFI module to be able to use protocol extensions, along the same lines as Futhark, and am seeing a similar problem where I try to pass a C struct declared externally by pointer to another Nim function in another module, and getting an incompatible type error.
00:55:23FromDiscord<.tokyovigilante> sent a code paste, see https://play.nim-lang.org/#pasty=ajbUijeg
00:56:51FromDiscord<Elegantbeef> I do see `interface` is there which is a keyword
00:58:20FromDiscord<.tokyovigilante> Ah yeah that could be it...
01:00:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=hbpgXSAM
01:06:02FromDiscord<.tokyovigilante> I thought I had escaped them all but maybe not
01:06:41FromDiscord<.tokyovigilante> `proc wl_registry_bind (wl_registry: ptr struct_wl_registry, name: uint32, `interface`: ptr struct_wl_interface, version: uint32): pointer =↵`
01:07:04FromDiscord<.tokyovigilante> (edit) "`proc wl_registry_bind (wl_registry: ptr struct_wl_registry, name: uint32, `interface`: ptr struct_wl_interface, version: uint32): pointer =↵`" => "sent a code paste, see https://paste.rs/lmH83"
01:07:18FromDiscord<.tokyovigilante> yup did escape it
01:12:37FromDiscord<.tokyovigilante> I found this by just casting to a `pointer` before passing worked when I saw the same issue with Vulkan
01:22:10FromDiscord<.tokyovigilante> is there any way to get any extra type information from the compiler? The error doesn't really make any sense as the types should be the same
01:22:13FromDiscord<eightbit_dboy> I added documentation for my latest project, `nerc`, the Nim web anti-framework: https://github.com/8bitprodigy/nerc
01:49:41*shrewd joined #nim
03:08:25*rockcavera quit (Remote host closed the connection)
04:14:46*shrewd quit (Ping timeout: 252 seconds)
05:30:05*ntat joined #nim
05:48:46FromDiscord<Elegantbeef> Well @.elcritch it's not overly informative or well written but I did at least sorta document the HCR path I went down https://www.jasonbeetham.ca/writeups/hcr.html 😄
05:49:19FromDiscord<Elegantbeef> \Probably should expand it to include the full `HcrObj` I describe there, but it's a lot of code
07:22:06*coldfeet joined #nim
07:34:38*coldfeet quit (Quit: Lost terminal)
08:43:17FromDiscord<.elcritch> In reply to @Elegantbeef "Well <@703717429230174229> it's not": No hipster photo at the top?! 😛
08:50:00PMunch"Fun" fact, there is no way to tell Nim to free all resources held by a dynamic library when you close it
08:51:24PMunchMore relevant when loading dynamic libraries into non-Nim applications though
08:55:46*coldfeet joined #nim
08:57:56FromDiscord<odexine> In reply to @Elegantbeef "Well <@703717429230174229> it's not": Time to proofread
09:02:56*coldfeet quit (Quit: Lost terminal)
09:36:53*derpydoo joined #nim
10:20:17*ntat quit (Quit: Leaving)
10:31:27*derpydoo quit (Ping timeout: 276 seconds)
10:45:39*ntat joined #nim
10:55:23*FromDiscord quit (Remote host closed the connection)
10:55:59*FromDiscord joined #nim
11:35:13*ntat quit (Quit: leaving)
11:35:30*ntat joined #nim
11:38:34*ntat quit (Client Quit)
11:41:11*ntat joined #nim
12:07:48*ntat quit (Read error: Connection reset by peer)
12:27:28FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch ""Fun" fact, there is": Using destructors maybe?
12:32:43FromDiscord<dawidek.2137> when compiled to wasm32, reading a field from a nil variable returns garbage, is there a way to make nim error out?
13:10:26*derpydoo joined #nim
13:17:25FromDiscord<Robyn [She/Her]> In reply to @dawidek.2137 "when compiled to wasm32,": could manually check if it's nil... do you get this behaviour in native x86?
13:38:42*derpydoo quit (Ping timeout: 252 seconds)
13:41:29*derpydoo joined #nim
14:09:30*ntat joined #nim
14:22:41*CypherCat joined #nim
14:56:57*derpydoo quit (Quit: derpydoo)
15:09:04PMunch@System64_~_Flandre_Scarlet, nope.
15:09:06*PMunch quit (Quit: Leaving)
15:23:49*ntat quit (Quit: Leaving)
15:24:42*ntat joined #nim
15:54:53*coldfeet joined #nim
15:58:40FromDiscord<alehander92> hey
15:58:46FromDiscord<alehander92> we're trying to cross compile
15:58:53FromDiscord<alehander92> codetracer's CLI to windows
16:03:37FromDiscord<alehander92> i have almost no xp with nim on windows
16:03:46FromDiscord<alehander92> is mingw still the best way to do that ( i assume so)
16:04:00*coldfeet quit (Quit: Lost terminal)
16:39:11*PotentialUser-25 joined #nim
16:39:38*PotentialUser-25 quit (Client Quit)
17:14:00*ntat quit (Remote host closed the connection)
17:15:01*ntat joined #nim
17:54:14FromDiscord<Elegantbeef> @alehander92 you can also use zig to cross compile, which uses clang
18:00:27FromDiscord<Elegantbeef> Pmunch you could use a dynamic library destructor that calls your own procedure to free resources, it's not pretty and means all global variables have to be manually destroyed. It should work though. Especially you use malloc instead of the Nim allocator(which let's be honest is wise so you can share resources)
18:15:21FromDiscord<alehander92> In reply to @Elegantbeef "Well <@703717429230174229> it's not": What happened to the built-in experimental hcr support in Nim
18:15:40FromDiscord<alehander92> In reply to @Elegantbeef "<@384062055080001545> you can also": Thank you, it seems mingw works, but we're aware of zig as well
18:16:56FromDiscord<Elegantbeef> it never left experimental 😄
18:18:03FromDiscord<Elegantbeef> You also need the NimRTL(less so now with Arc/Orc) plus I don't think it does data migration
18:18:17FromDiscord<Elegantbeef> So if you add a new field to an object you have to restart
18:20:02FromDiscord<Elegantbeef> Potato on the otherhand allows new fields, has a watcher so you don't have to manually reload, and allows using the same module for entry for a real program and a hot code program(with a few `when`s)
18:22:41FromDiscord<alehander92> Sounds very interesting, nice !
18:23:26FromDiscord<Elegantbeef> Oh just remembered don't know if you've checked with virustotal using the mingw build, but in my experience antiviruses hate mingw. A C hello world compiled with mingw was reported as malware by like 17 separate vendors
21:24:18*rockcavera joined #nim
22:07:50*rockcavera quit (Remote host closed the connection)
22:10:38*rockcavera joined #nim
22:25:08*Jhonny2x4 quit (Quit: Jhonny2x4)
22:25:16*Jhonny2x4 joined #nim
22:25:42FromDiscord<Robyn [She/Her]> I wonder if it would be stupid for when allowing WASM runtimes to spawn their own WASM runtime, the memory would have to be `malloc`ed by the 1st runtime, and then the host system would start a runtime with that section of the memory being where the data is written and read from
22:59:05*ntat quit (Quit: Leaving)
23:10:23FromDiscord<Elegantbeef> @Robyn [She/Her] It's runtimes all the way down
23:10:23FromDiscord<Elegantbeef> I feel like that's a bad idea
23:10:24FromDiscord<Elegantbeef> Just depend upon another module
23:20:09FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "<@524288464422830095> It's runtimes all": Runtime is still managed by the host, it's just that the WASM runtime sacrifices it's own memory to give to a child WASM runtime
23:20:27FromDiscord<Elegantbeef> But why would you want that?
23:20:45FromDiscord<Robyn [She/Her]> To ensure memory limits aren't bypassed and a semblance of safety is kept
23:21:00FromDiscord<Elegantbeef> I mean why would you want wasm inside wasm?
23:21:12FromDiscord<Elegantbeef> Why would you not just want to depend upon another module and load both into the same environment?
23:21:43FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "I mean why would": JIT but in WASM :>
23:21:56FromDiscord<Elegantbeef> There are JIT'd wasm runtimes though
23:21:58FromDiscord<Robyn [She/Her]> Tho ig it wouldn't be too performant
23:22:24FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "There are JIT'd wasm": Yeah ig nested JITs are stupid
23:52:49FromDiscord<leorize> you can't build a JIT within wasm anyways
23:53:11FromDiscord<leorize> iirc wasm data memory is not executable in any way
23:53:35FromDiscord<Elegantbeef> Hey compile those opcodes into native code then uh... ask the host to run the native code 😄
23:55:15FromDiscord<leorize> lol
23:55:38FromDiscord<Robyn [She/Her]> In reply to @leorize "iirc wasm data memory": That was why I was wondering if this silly way of creating another WASM runtime with the generated WASM code and calling into it
23:57:58FromDiscord<leorize> that could work, yes
23:58:27FromDiscord<leorize> Google famously used a similar trick to obfuscate reCaptcha
23:58:48FromDiscord<leorize> they build a VM in JS then use that VM to run reCaptcha