00:01:14 | FromDiscord | <eyes> right right |
00:01:22 | FromDiscord | <eyes> sometimes i forget that nim is secretly C and not python |
00:28:33 | FromDiscord | <turbo> How can I access a var created as `seq[seq[float]]` as `UncheckedArray[float]`? Right now I'm rewriting the original var into a `seq[float]` and then casting, which works. But I'd like to avoid this copy. |
00:31:09 | FromDiscord | <Yepoleb> you can't flatten nested seqs without a copy |
00:32:33 | FromDiscord | <Yepoleb> they are not a continuous region of memory because the inner seqs need to be able to grow |
00:37:01 | FromDiscord | <turbo> What if the inner seqs are arrays? |
00:47:34 | FromDiscord | <Elegantbeef> `cast[ptr UncheckedArray[float]](mySeq[0].addr)` |
00:50:56 | FromDiscord | <turbo> Yep that works |
00:52:15 | FromDiscord | <turbo> > Error: unhandled exception: int128.nim(69, 11) `arg.sdata(2) == 0` out of range [AssertionDefect]↵Takes the cake as the least helpful error message I've seen in Nim yet. Crops up if you forget the `static` in a generic array type int parameter |
00:52:44 | FromDiscord | <Elegantbeef> Well it's not a compiler error message |
00:52:50 | FromDiscord | <Elegantbeef> So... yea |
00:53:08 | * | azimut quit (Ping timeout: 255 seconds) |
01:16:02 | FromDiscord | <opp> How do I skip SSL verification on httpclient library? |
01:26:03 | FromDiscord | <opp> sent a code paste, see https://paste.rs/rJH |
01:26:16 | FromDiscord | <opp> (edit) "https://paste.rs/lSK" => "https://paste.rs/AGN" |
01:34:58 | FromDiscord | <Yepoleb> In reply to @turbo "What if the inner": no, only if both are arrays |
01:36:51 | FromDiscord | <Yepoleb> In reply to @Elegantbeef "`cast[ptr UncheckedArray[float]](mySeq[0].addr)`": as i understand it they want to access all the inner seqs continuously as one array, this only works for the elements in the first inner seq |
01:39:00 | FromDiscord | <Elegantbeef> If it's `seq[array[T, float32]]` it works |
01:39:45 | FromDiscord | <turbo> In reply to @Yepoleb "no, only if both": ^ this, just tested it - all as expected |
01:39:56 | FromDiscord | <turbo> ^ this, just tested it - all as expected |
01:40:02 | FromDiscord | <Yepoleb> In reply to @Elegantbeef "If it's `seq[array[T, float32]]`": oh, right |
01:41:10 | * | xet7 quit (Remote host closed the connection) |
01:41:47 | FromDiscord | <Yepoleb> i read that as an answer to `seq[seq[float]]` |
02:08:02 | * | derpydoo joined #nim |
03:08:41 | * | arkurious quit (Quit: Leaving) |
03:14:05 | * | dropkick quit (Ping timeout: 260 seconds) |
04:08:12 | FromDiscord | <Iliketwertles> why am i getting an error here? https://media.discordapp.net/attachments/371759389889003532/1075629644172242944/screenshot_2023-02-15-230742.png |
04:08:29 | FromDiscord | <Rika> well whats the error |
04:08:57 | FromDiscord | <Iliketwertles> `Error: type mismatch: got <string, string>` |
04:09:16 | FromDiscord | <Yepoleb> try importing strutils |
04:09:30 | FromDiscord | <Iliketwertles> oh |
04:09:33 | FromDiscord | <Iliketwertles> that was is |
04:09:34 | FromDiscord | <Iliketwertles> (edit) "is" => "it" |
04:09:48 | FromDiscord | <Iliketwertles> didnt know that was part of strutils |
04:09:50 | FromDiscord | <Yepoleb> had someone with the same problem yesterday 😄 |
04:10:35 | FromDiscord | <Iliketwertles> weird |
04:10:50 | FromDiscord | <Iliketwertles> still outputs all the lines of the pkgs not just the ones with : |
04:11:03 | FromDiscord | <Iliketwertles> but it also outputs [IOError] |
04:11:09 | FromDiscord | <Iliketwertles> (edit) "but it also outputs [IOError] ... " added "at the end with nothing else" |
04:11:22 | FromDiscord | <Iliketwertles> sent a code paste, see https://play.nim-lang.org/#ix=4ocX |
04:11:38 | FromDiscord | <Iliketwertles> i only want the top line with : so i can count it |
04:12:36 | FromDiscord | <Yepoleb> are you aware of this proc? https://nim-lang.org/docs/os.html#walkPattern.i%2Cstring |
04:13:03 | FromDiscord | <amadan> Think you are meant to use splitLines and not lines |
04:13:12 | FromDiscord | <amadan> Lines iterates through lines in a file iirc |
04:13:41 | FromDiscord | <Iliketwertles> ayy i might have got it |
04:13:53 | FromDiscord | <Iliketwertles> it worked |
04:13:58 | FromDiscord | <Iliketwertles> splitLines |
04:14:17 | FromDiscord | <Iliketwertles> In reply to @Yepoleb "are you aware of": i dont think that would work for like `/some/dir//` |
04:16:48 | FromDiscord | <Yepoleb> it most likely would if it works for console commands |
04:19:04 | * | rockcavera quit (Remote host closed the connection) |
04:21:01 | FromDiscord | <Iliketwertles> my fetch works speedily on gentoo now https://media.discordapp.net/attachments/371759389889003532/1075632871240368168/screenshot_2023-02-15-232040.png |
04:47:07 | FromDiscord | <Iliketwertles> sent a code paste, see https://play.nim-lang.org/#ix=4od5 |
04:47:18 | FromDiscord | <Iliketwertles> (edit) "https://play.nim-lang.org/#ix=4od5" => "https://play.nim-lang.org/#ix=4od6" |
04:47:23 | FromDiscord | <Iliketwertles> this got the number i needed |
05:34:10 | FromDiscord | <ringabout> Hi FedericoCeratto, what's your opinion of https://github.com/nim-lang/Nim/pull/21292 |
06:07:28 | * | kenran joined #nim |
06:09:44 | * | kenran quit (Remote host closed the connection) |
06:31:46 | FromDiscord | <Drygord> Can anyone help with super slow compile time? It's taking 3-4 seconds for a very basic 'hello world' type script. |
06:32:14 | FromDiscord | <ringabout> Which is the C compiler you are using? |
06:32:40 | FromDiscord | <Drygord> minGW 64 |
06:33:12 | FromDiscord | <ringabout> Code and Nim version and OS info? |
06:33:29 | FromDiscord | <Drygord> 1.9.1, windows 10 |
06:33:48 | FromDiscord | <Drygord> for code, just imagine `echo "hello world"` |
06:38:18 | FromDiscord | <ringabout> `nim c -f test.nim` yields `1.546s` on My Win11 |
06:39:07 | FromDiscord | <ringabout> Perhaps the Nim hasn't yet cached some stdlibs if you are running the code for the first time/ |
07:15:27 | * | advesperacit joined #nim |
07:35:50 | FromDiscord | <Drygord> Now I am trying on a different machine. this was literally working yesterday. God I hate windows. https://media.discordapp.net/attachments/371759389889003532/1075681896777924608/image.png |
07:37:29 | FromDiscord | <Phil> In reply to @Drygord "Now I am trying": nim.exe-directory no longer on the PATH I assume? |
07:37:36 | FromDiscord | <Phil> Or did MS-Defender change its mind and wipe your nim install? |
07:37:59 | FromDiscord | <Drygord> lol i am investigating now |
07:38:23 | FromDiscord | <Phil> In reply to @Drygord "lol i am investigating": Good luck! |
07:40:28 | FromDiscord | <Phil> This reminds me that I'll really have to contemplate how I want to deal with the GUI app I'm writing for windows. I don't have a windows PC and even if I can assume that it installs, I'd still somehow need to test it and I'm not even sure if the GUI-testing-lib I found works |
07:40:51 | FromDiscord | <Phil> (edit) "This reminds me that I'll really have to contemplate how I want to deal with the GUI app I'm writing for windows. I don't have a windows PC and even if I can assume that it installs, I'd still somehow need to test it and I'm not even sure if the GUI-testing-lib I found works ... " added "on windows" |
07:41:16 | FromDiscord | <Phil> (edit) "writing for windows." => "writing, or rather how I want to deal with windows when it comes to it." |
07:43:54 | FromDiscord | <Elegantbeef> No clue if you want to crosscompile to windows or not, but it's not that fun for gtk 😄 |
07:44:03 | FromDiscord | <Elegantbeef> Atleast if you statically do it |
07:45:52 | * | jmdaemon quit (Ping timeout: 246 seconds) |
07:46:37 | FromDiscord | <Phil> Well, LDTP is apparently a thing and that appears to run on windows AND support gtk.↵Also has python bindings and with numpy that means I have access to LDTP bindings |
07:47:00 | FromDiscord | <Phil> For testing I'm willing to eat the more complex setup of having to deal with installing python dependencies |
07:56:15 | FromDiscord | <Phil> Actually, couldn't I just use a windows vm to see how my application functions under windows? |
07:57:05 | FromDiscord | <Phil> Stuff to ponder for when it becomes relevant in like half a year |
08:12:55 | * | azimut joined #nim |
08:16:08 | * | PMunch joined #nim |
09:12:19 | FromDiscord | <0x454d505459> sent a code paste, see https://play.nim-lang.org/#ix=4odV |
09:14:57 | * | advesperacit quit () |
09:19:39 | * | advesperacit joined #nim |
09:19:40 | FromDiscord | <Coachonko> Bruh |
09:20:15 | FromDiscord | <0x454d505459> yeah |
09:21:31 | FromDiscord | <Phil> In reply to @0x454d505459 "Hello there, I need": Hmm I'm trying to figure out how to best elaborate on that.↵How familiar are you with the difference between compileTime and runtime? |
09:21:55 | FromDiscord | <0x454d505459> In reply to @Isofruit "Hmm I'm trying to": I can sometime mix them, but that's pretty rare |
09:22:11 | FromDiscord | <Phil> Because the answer is "In general no, but you can cheat the system a bit with generics or clever use of e.g. seq" |
09:23:00 | FromDiscord | <0x454d505459> I tried using varargs of type auto (don't ask why idk) and it broke the compiler |
09:23:25 | FromDiscord | <Phil> In reply to @0x454d505459 "I can sometime mix": So in nim, in the end when all the magic of generics, templates etc. is done, everything has a static type.↵There is no ambiguity, you have a strictly defined e.g. `proc(x: int): str+ing` |
09:23:26 | FromDiscord | <Rika> auto varargs would only allow a homogeneous-type arg list |
09:24:06 | FromDiscord | <0x454d505459> ik |
09:24:19 | FromDiscord | <0x454d505459> I tried on simple functions |
09:24:22 | FromDiscord | <Phil> So you can't have type-stuff at runtime, you must know it ahead of time.↵You could use a seq[string] parameter for example to allow users to define a lot of different things, but that means you're necessitating everything you pass in there to be a string |
09:24:40 | FromDiscord | <0x454d505459> yeah I thought of that |
09:25:19 | FromDiscord | <Phil> You could use generics (which is the direction using auto goes towards), but that still means you must know all the types you want to use this with ahead of time, you're just reducing your copy-paste effort and let the compiler do that for you |
09:25:42 | FromDiscord | <0x454d505459> In reply to @0x454d505459 "yeah I thought of": what I could do, is find a way to serialise the data, that way I only pass serialized data and deserialize it after |
09:26:05 | FromDiscord | <Phil> It should also be noted that unless the procedure you want to use does not take any input and does not produce any output, `proc()` is not the correct type |
09:26:05 | FromDiscord | <0x454d505459> In reply to @Isofruit "You could use generics": feels janky |
09:26:23 | FromDiscord | <0x454d505459> In reply to @Isofruit "It should also be": what is it then ? |
09:26:39 | FromDiscord | <Rika> a `proc()` is a function with no params and void return |
09:26:45 | FromDiscord | <0x454d505459> Yeah ik |
09:26:52 | FromDiscord | <Rika> thats what phil said |
09:26:59 | FromDiscord | <0x454d505459> ok ok |
09:27:54 | FromDiscord | <0x454d505459> i'll try puting everything into a serialized type which will be the one passed and then deserializing it after |
09:32:45 | FromDiscord | <0x454d505459> thanks for your help |
09:43:00 | FromDiscord | <Phil> In reply to @0x454d505459 "i'll try puting everything": Do you know what the type looks like ahead of time? |
09:43:21 | FromDiscord | <0x454d505459> nope |
09:43:44 | FromDiscord | <Phil> Ahh yeah, in that case your serialization solution is pretty much your only way forward.↵Hey, this is where JsonNode from std/json excels! |
09:43:58 | FromDiscord | <0x454d505459> yeah |
09:48:24 | * | dza quit (Quit: ) |
09:52:57 | FromDiscord | <0x454d505459> I managed to break the compiler lol |
09:53:23 | FromDiscord | <0x454d505459> it SIGSEVed for illegal storage access |
09:54:42 | FromDiscord | <Phil> SIGSEV always sounds like somebody is accessing nil somewhere |
09:54:47 | FromDiscord | <Phil> (edit) "SIGSEV always sounds like somebody is accessing nil somewhere ... " added "to me" |
09:54:50 | FromDiscord | <0x454d505459> yeah |
09:55:38 | FromDiscord | <Rika> you didnt really break the compiler |
09:55:45 | FromDiscord | <Rika> theres just an error you made in the code |
09:57:05 | FromDiscord | <0x454d505459> sent a code paste, see https://paste.rs/TcO |
09:57:20 | FromDiscord | <Elegantbeef> `: typedesc` and `: auto` are invalid for that type |
09:57:20 | FromDiscord | <0x454d505459> In reply to @Rika "theres just an error": thanks I knew this |
09:57:28 | FromDiscord | <0x454d505459> In reply to @Elegantbeef "`: typedesc` and `:": oh bruh |
09:57:34 | FromDiscord | <Elegantbeef> You're attempting to make a generic type with no generic arguments |
09:57:50 | FromDiscord | <Elegantbeef> typedesc cannot exist as a field, it's compile time only |
09:58:13 | FromDiscord | <Elegantbeef> `: auto` needs to be replaced with `AType[T] = ...` and `value: T` |
09:58:36 | FromDiscord | <0x454d505459> In reply to @Elegantbeef "`: auto` needs to": that's what I was gonna do, but thanks |
09:58:47 | FromDiscord | <0x454d505459> it was just for testing anyways |
10:02:18 | * | azimut quit (Remote host closed the connection) |
10:03:16 | * | azimut joined #nim |
10:05:19 | * | PMunch quit (Quit: Leaving) |
10:09:52 | * | PMunch joined #nim |
10:20:15 | * | dza joined #nim |
10:59:56 | FromDiscord | <I have 50GB of nothing on my PC> does anyone here have experience with haxe? what are nim's advantages over it? |
11:06:12 | * | Guest35 joined #nim |
11:18:53 | * | woofwoof joined #nim |
11:20:47 | PMunch | No experience with it, but from what I can see from their site I'd say that Nim is more flexible |
11:21:28 | PMunch | Haxe has a VM and can be interpreted, this means you will likely never hit native performance, even when building for e.g. C |
11:21:34 | PMunch | No meta-programming |
11:21:51 | PMunch | Well, it has conditional compilation, but so does C |
11:22:13 | PMunch | Oh wait, it does have macros it seems |
11:22:24 | FromDiscord | <exelotl> Haxe does have AST based macros like Nim |
11:22:53 | PMunch | Yes I can see that now, but it seems like it's only on untyped nodes? |
11:23:01 | PMunch | Judging from this: https://haxe.org/manual/macro.html |
11:25:12 | FromDiscord | <exelotl> Haxe has a heavy runtime and less efficient codegen because it's not trying to be a systems programming language. It has more dynamic features, I think it has its roots in ml (ocaml etc). Which means pointers galore and you can't easily turn off the GC |
11:31:21 | woofwoof | is there a way to run helloworld.nim without compiling it to .exe first? |
11:34:14 | Zevv | nim r helloworld.nim |
11:35:28 | woofwoof | it still compiles but to another folder, i.e. nimcache\helloworld_DFCBBF75B1B0E07B277E990CB8CF00E9E7CC4479.exe |
11:37:30 | woofwoof | I want to achieve the execution purely in memory, without wearing out the disk |
11:39:23 | PMunch | woofwoof, put the nimcache and binary output in the /tmp folder I guess |
11:39:34 | PMunch | As long as your /tmp folder is mounted as a tmpfs of course |
11:40:10 | PMunch | You can run `nim e helloworld.nim` which executes it as nimscript, but this isn't exactly the same |
11:40:30 | PMunch | But depending on what you're trying to do it might be enough |
11:41:33 | woofwoof | I am on Windows, ramdisk is not an option, hmm. yes, 'e' seems to be the very option for my case |
11:41:59 | PMunch | But unless you bought your harddrive on Wish.com you probably shouldn't worry this much about disk writes |
11:43:39 | woofwoof | indeed, 'e' enables me to see the output way faster, and by adding --verbosity: "0" to nim.cfg, I see the output without service messages |
11:49:27 | PMunch | Still, keep in mind that this is now NimScript, not Nim |
12:05:47 | FromDiscord | <Hourglass [She/Her]> (NimScript lacks C interop and FFI, so bindings to C libraries won't work, if it still works for you, great!) |
12:05:48 | FromDiscord | <Rika> You will have a somewhat more limited standard library |
12:06:04 | FromDiscord | <Rika> And also a more limited number of external libraries you can use |
12:44:00 | * | woofwoof left #nim (#nim) |
13:22:30 | FromDiscord | <Nerve> If I have a proc with a `varargs` parameter and I want to pass those to another proc with a `varargs` parameter and a similar signature, how would I do that? |
13:25:45 | FromDiscord | <enthus1ast> any idea why this complains?I have a proc like so\:`func getComponent(reg: Registry, ent: Entity, ty: typedesc): ty {.inline.} =`Then i have a template, that just omits the `reg``template getComponent(ent: Entity, ty: typedesc): ty =`but it complains like so\:` Error: type mismatch: got 'Health' for 'getComponent(reg, ee, Health_436233388)' but expected 'None'` |
13:27:05 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4of1 |
13:34:59 | FromDiscord | <enthus1ast> oh i got it it must be\:`template getComponent(ent: Entity, ty: typedesc): untyped =` |
13:37:23 | * | rockcavera joined #nim |
14:38:37 | PMunch | Hmm, the Nimble documentations specify that it will auto-detect hg or git from a URL, but when I try to use it it just fails because hg isn't installed |
14:38:41 | PMunch | I'm using a github link.. |
14:44:32 | * | xet7 joined #nim |
14:51:47 | advesperacit | I've had that happen as well, can't remember exactly what the problem was |
14:53:30 | advesperacit | 'requires "https://github.com/<user>/<repo>#HEAD"' is working in one of my projects right now |
14:55:43 | PMunch | Hmm, nope, can't get it to work |
14:55:50 | PMunch | Guess it might be because the repo is private |
14:58:31 | advesperacit | I think that was the problem I was having |
14:59:13 | FromDiscord | <jtv> You can use github's auth capability to pre-auth to the repo basically |
15:00:32 | PMunch | Hmm, how is that done? |
15:03:15 | FromDiscord | <hotdog> Anyone got a good example of a project that uses the compiler as a library? |
15:03:29 | PMunch | nimlsp? |
15:04:01 | PMunch | nimscripter as well |
15:04:21 | PMunch | Gotta go |
15:04:22 | * | PMunch quit (Quit: Leaving) |
15:05:32 | FromDiscord | <hotdog> Cheers @PMunch good suggestions |
15:09:46 | * | xet7 quit (Quit: Leaving) |
15:23:03 | * | arkurious joined #nim |
15:33:47 | FromDiscord | <jtv> @PMunch install the github command line: https://cli.github.com/ and then just do `gh auth` |
16:06:35 | FromDiscord | <matrix07012> How do I setup loggers in one files and export them so that I can use info(), error() everywhere? |
16:06:56 | FromDiscord | <matrix07012> How do I setup loggers in one file and export them so that I can use info(), error() everywhere in the projekt? |
16:09:11 | Amun-Ra | std/logging |
16:14:42 | FromDiscord | <matrix07012> Oh thanks, I thought just importing my logger was enough. I'm dumb |
16:18:35 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4og0 |
16:23:05 | FromDiscord | <Hourglass [She/Her]> Really tempted to try and working on implementing a basic Minecraft server again in Nim |
16:25:04 | FromDiscord | <Hourglass [She/Her]> How would I make my code run on multiple threads and distribute the load somewhat evenly? |
16:25:51 | FromDiscord | <enthus1ast> @4zv4l\: good question, it looks ok to me (while reading the docs of SetWindowsHookExA) |
16:26:09 | FromDiscord | <4zv4l> In reply to @enthus1ast "<@329196212282458112>\: good question, it": to me too 🥺 |
16:26:28 | FromDiscord | <enthus1ast> can you just try SetWindowsHookEx |
16:26:50 | FromDiscord | <enthus1ast> not the ascii version |
16:26:58 | FromDiscord | <4zv4l> the same error |
16:27:00 | FromDiscord | <4zv4l> 🥺 |
16:27:03 | FromDiscord | <4zv4l> 87 |
16:27:34 | FromDiscord | <enthus1ast> mh |
16:28:10 | FromDiscord | <enthus1ast> could it be a 32/64 bit issue? |
16:28:30 | FromDiscord | <enthus1ast> so the process that you start is this 64 bit? |
16:28:30 | FromDiscord | <4zv4l> except that (when I hook all processes it crashes explorer.exe)↵my manager was really impressed how the Nim code was much shorter and simpler than the previous one in C |
16:28:37 | FromDiscord | <4zv4l> yep 64 bit |
16:28:42 | FromDiscord | <4zv4l> dll too |
16:28:46 | FromDiscord | <enthus1ast> k |
16:29:40 | FromDiscord | <4zv4l> it's really since I modified the `dwThreadID` before when I just put `0` it was working fine |
16:34:31 | FromDiscord | <enthus1ast> the HOOKPROC |
16:34:35 | FromDiscord | <enthus1ast> is is https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ms644981(v=vs.85) |
16:34:35 | FromDiscord | <enthus1ast> ? |
16:34:41 | FromDiscord | <enthus1ast> GetMsgProc |
16:35:49 | FromDiscord | <enthus1ast> ah ok when it was working before |
16:44:50 | FromDiscord | <4zv4l> it was working before yes |
16:44:59 | FromDiscord | <4zv4l> with `0` as threadID |
16:45:06 | FromDiscord | <4zv4l> so the hook was set for all processus |
16:49:51 | FromDiscord | <enthus1ast> would be interesting to see what is in pi.dwThreadId and if the thread exists actually |
16:50:03 | FromDiscord | <enthus1ast> and if the thread is special in some way who knows |
16:51:11 | FromDiscord | <4zv4l> the threadID isn't null at least↵I echoed it and got `26308` |
16:51:33 | FromDiscord | <enthus1ast> and does the thread exists? |
16:51:44 | FromDiscord | <4zv4l> I'll check that now |
16:51:50 | FromDiscord | <enthus1ast> ah and also, the calling convention in the exported dll, is this correctß |
16:51:52 | FromDiscord | <enthus1ast> ? |
16:52:59 | FromDiscord | <enthus1ast> but i think if it would be incorrect it would just crash, and not warn you i guess |
16:53:17 | FromDiscord | <4zv4l> yeah yeah since that was working before for all processes |
16:53:23 | FromDiscord | <4zv4l> the function in the dll works |
16:53:24 | FromDiscord | <enthus1ast> ok \:) |
16:53:33 | FromDiscord | <4zv4l> In reply to @enthus1ast "and does the thread": I can see the PID but idk how to see the thread id |
16:53:53 | FromDiscord | <enthus1ast> with proc explorer for example |
16:55:49 | FromDiscord | <4zv4l> hmmm either I can't see it or I just don't know how to lol |
16:58:02 | FromDiscord | <4zv4l> ok yeah |
16:58:27 | FromDiscord | <4zv4l> can see the number https://media.discordapp.net/attachments/371759389889003532/1075823483860299957/image.png |
16:58:36 | FromDiscord | <4zv4l> 7048 |
16:59:27 | * | rez joined #nim |
17:03:52 | FromDiscord | <4zv4l> most error I see about 87 with SetWindowHookEx is that they put the processID but I put the ThreadID so it should be fine |
17:09:17 | FromDiscord | <Hourglass [She/Her]> Could someone explain to me what a pointer is exactly? I kinda know what they are but I realised that in reality, I don't |
17:10:06 | FromDiscord | <Elegantbeef> It's a fancy name for memory address |
17:10:59 | FromDiscord | <Hourglass [She/Her]> And ref objects are just wrappers built on pointers? |
17:11:06 | FromDiscord | <Hourglass [She/Her]> Wrapping it nicely for Nim to use and stuff? |
17:11:58 | FromDiscord | <Elegantbeef> Refs are really just pointers, but with memory managing data allocated before the block |
17:12:10 | FromDiscord | <Hourglass [She/Her]> Ah alright then |
17:13:07 | FromDiscord | <Coachonko> Bruh |
17:18:48 | * | Guest35 quit (Quit: Client closed) |
17:19:28 | FromDiscord | <enthus1ast> @4zv4l\: i got it working \:) |
17:19:33 | FromDiscord | <enthus1ast> let me make this nice |
17:21:51 | FromDiscord | <eyes> sent a code paste, see https://play.nim-lang.org/#ix=4ogj |
17:21:55 | FromDiscord | <eyes> i think i just dont get the async programming |
17:22:11 | FromDiscord | <Elegantbeef> `os.sleep` sleeps your entire thread |
17:24:08 | FromDiscord | <Elegantbeef> Async isnt multi threaded which means that also halts your async logic |
17:24:49 | FromDiscord | <enthus1ast> @4zv4l\: the problem is that the application might has not fully started the thread, so stick in a `WaitForSingleObject(pi.hThread, 2_000)` in there |
17:24:58 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4ogm |
17:25:18 | FromDiscord | <eyes> In reply to @Elegantbeef "`os.sleep` sleeps your entire": i am so dumb |
17:25:29 | FromDiscord | <eyes> is sleepAsync what I need in this case? |
17:26:17 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4ogo |
17:26:42 | FromDiscord | <enthus1ast> or waitForever()? |
17:27:27 | FromDiscord | <Elegantbeef> I think they're after a main loop and async loop process |
17:28:07 | FromDiscord | <enthus1ast> asyncCheck does not block |
17:28:08 | FromDiscord | <Hourglass [She/Her]> Isn't it possible to use async and threading in conjunction with eachother? |
17:28:12 | FromDiscord | <enthus1ast> waitFor does |
17:28:30 | FromDiscord | <Hourglass [She/Her]> Would it provide any advantages or |
17:28:34 | FromDiscord | <Elegantbeef> It is possible to |
17:28:47 | FromDiscord | <Hourglass [She/Her]> But a pain I'm assuming? |
17:28:52 | FromDiscord | <enthus1ast> it depends on what you want |
17:28:55 | FromDiscord | <Elegantbeef> It allows you to use async in a threaded program |
17:28:59 | FromDiscord | <Rika> It provides advantages in very specific circumstances |
17:29:12 | FromDiscord | <Elegantbeef> It's not a pain cause it's not possible to transfer futures across threads iirc |
17:30:59 | FromDiscord | <eyes> I don’t need multiple threads |
17:31:22 | FromDiscord | <eyes> i’m just trying to write two loops, both of which sleep and only operate every few seconds, as if they were two threads |
17:31:27 | FromDiscord | <Hourglass [She/Her]> In reply to @enthus1ast "it depends on what": Planning on writing a Minecraft server software with a somewhat decent layer of abstraction aha |
17:31:35 | FromDiscord | <eyes> the library i’m using suggests asyncCheck |
17:32:38 | FromDiscord | <Hourglass [She/Her]> And I'm thinking of using threads for certain things, such as a dedicated thread for networking and another for chunk generation.. vetc |
17:32:40 | FromDiscord | <Hourglass [She/Her]> Etc |
17:32:44 | FromDiscord | <enthus1ast> is the minecraft proto tcp or udp? |
17:34:23 | FromDiscord | <enthus1ast> ok tcp |
17:35:33 | FromDiscord | <Hourglass [She/Her]> In reply to @enthus1ast "is the minecraft proto": Tcp yeah |
17:35:34 | FromDiscord | <Hourglass [She/Her]> Why? |
17:35:53 | FromDiscord | <Hourglass [She/Her]> Bedrock is udp tho so that'll be fun lmao |
17:36:23 | FromDiscord | <enthus1ast> it the minecraft server not also generating the map etc pp? |
17:36:23 | FromDiscord | <enthus1ast> thats a huge project, to be honest \:) |
17:36:36 | FromDiscord | <enthus1ast> because for udp you do not really need async |
17:36:58 | FromDiscord | <enthus1ast> can all happen in one loop then |
17:37:08 | FromDiscord | <enthus1ast> you must do your "connection mapping" yourself anyhow |
17:39:10 | FromDiscord | <4zv4l> In reply to @enthus1ast "<@329196212282458112>\: the problem is": oh thank you so much !!!!!!!! |
17:39:13 | FromDiscord | <4zv4l> works great ! |
17:39:19 | FromDiscord | <enthus1ast> nice |
17:39:42 | FromDiscord | <4zv4l> thank you so so so so much |
17:39:42 | FromDiscord | <4zv4l> xD |
17:43:06 | FromDiscord | <Hourglass [She/Her]> In reply to @enthus1ast "it the minecraft server": That'll be pushed back for a long time lmao |
17:43:18 | FromDiscord | <Hourglass [She/Her]> Right now I wanna do something like Minestom, barebones af |
17:43:43 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4ogt |
17:44:00 | FromDiscord | <Hourglass [She/Her]> I'm making my server software abstract on purpose, it'll be meant to improve upon gradually |
17:44:03 | FromDiscord | <enthus1ast> maybe you can start with a minecraft proxy server? |
17:44:20 | FromDiscord | <Hourglass [She/Her]> Ideally, once I have a structure for the core working, I can forget about that code and work on plugins haha |
17:44:33 | FromDiscord | <enthus1ast> so that you can parse the protocol, step by step |
17:45:06 | FromDiscord | <Hourglass [She/Her]> In reply to @enthus1ast "maybe you can start": I've already gotten a working server that allows you to join and quit a while ago, which was fun |
17:46:00 | FromDiscord | <enthus1ast> and it would be also nice for minecraft hacking |
17:47:56 | FromDiscord | <Hourglass [She/Her]> I'll make a crappy mc proxy first then 😎 |
17:48:10 | FromDiscord | <Hourglass [She/Her]> Though, it'll probably be absolute hell for lower versions hah |
17:49:44 | FromDiscord | <Hourglass [She/Her]> I'll need to reimplement the VarInt stuff again ughh |
17:51:21 | FromDiscord | <4zv4l> if I use `defer` will it be executed if I use |
17:51:26 | FromDiscord | <4zv4l> (edit) "if I use `defer` will it be executed if I use ... " added "`quit` ?" |
17:52:20 | FromDiscord | <Hourglass [She/Her]> No, not from what I know |
17:52:56 | FromDiscord | <Hourglass [She/Her]> `quit` just exits the program straightaway |
17:52:59 | FromDiscord | <Hourglass [She/Her]> Afaik |
17:54:58 | FromDiscord | <wiga> am I the only one who's not able to pull nim's docker image? |
17:55:50 | FromDiscord | <wiga> wait nvm I think i found the issue |
18:05:17 | FromDiscord | <4zv4l> I don't really get how to interact with registry key↵if that's a good way to load a configuration↵is it possible to get an example code on how to get/set a registry key in Nim ? |
18:06:22 | FromDiscord | <auxym> personally I'd juste write a config file in $APPDATA instead. Cross platform too, if you use the XDG config dir standard |
18:07:03 | FromDiscord | <auxym> any specific reason why you want to use the windows registry? |
18:07:30 | FromDiscord | <Hourglass [She/Her]> Now.... Naming |
18:07:32 | FromDiscord | <4zv4l> the previous version of the soft was using registry key to save the config |
18:07:54 | FromDiscord | <Hourglass [She/Her]> What do I name a Minecraft proxy in Nim? |
18:08:01 | FromDiscord | <4zv4l> I'm rewriting it from scratch from C to Nim↵so I can choose how to deal with the config |
18:08:16 | FromDiscord | <4zv4l> but they told me they would prefer keeping the registry config if possible |
18:14:41 | FromDiscord | <Hourglass [She/Her]> I'm gonna skip the proxy for now :p |
18:15:15 | * | rockcavera quit (Remote host closed the connection) |
18:16:13 | FromDiscord | <auxym> you'll have to use winim ig and dig a bit into the win32 registry api |
18:16:33 | FromDiscord | <auxym> https://learn.microsoft.com/en-us/windows/win32/sysinfo/registry-functions |
18:17:04 | FromDiscord | <auxym> look at whatever the C app was doing and find the winim binding for it |
18:17:16 | FromDiscord | <auxym> should be pretty much 1:1 translation |
18:20:26 | * | jmdaemon joined #nim |
18:21:45 | FromDiscord | <sOkam!> Is there any way to force a stack trace, even when things didn't go wrong? |
18:25:24 | FromDiscord | <BobBBob> sent a code paste, see https://play.nim-lang.org/#ix=4ogP |
18:28:46 | advesperacit | try the writeStackTrace proc https://nim-lang.org/docs/system.html#writeStackTrace |
18:44:53 | FromDiscord | <eyes> sent a code paste, see https://play.nim-lang.org/#ix=4ogY |
18:48:08 | FromDiscord | <jtv> @sOkam! you can just `echo getStackTrace()` at any point |
18:57:10 | FromDiscord | <Hourglass [She/Her]> What's the difference between having my object as a ref object, and doing `T: ref object` in an argument for a proc? |
18:57:24 | FromDiscord | <Hourglass [She/Her]> Is there any downsides to doing `ref myObj` or? |
19:00:56 | FromDiscord | <Recruit_main707> one means the type is always a reference, the other one means the argument is a reference to that type |
19:04:53 | FromDiscord | <Hourglass [She/Her]> Is there any downsides to that approach? |
19:05:04 | FromDiscord | <Hourglass [She/Her]> References are always mutable, right? |
19:07:25 | FromDiscord | <sOkam!> @jtv ty ✍️ |
19:08:26 | FromDiscord | <Hourglass [She/Her]> Help I'm doing a Java |
19:08:38 | FromDiscord | <Hourglass [She/Her]> `AbstractConnection` |
19:08:52 | FromDiscord | <Hourglass [She/Her]> Is there a better name for this? Anything using my API should inherit from it |
19:12:42 | FromDiscord | <Nerve> Instead of making a ref object you can pass the object to procs that need it as `var` |
19:13:05 | FromDiscord | <Nerve> I believe that means it remains a stack object but additional stack frames can mutate it |
19:13:16 | FromDiscord | <Nerve> (edit) "ref" => "`ref`" |
19:16:18 | FromDiscord | <enthus1ast> argh i'm fighting with rawProc and rawEnv, only to try devel and there it's working |
19:16:34 | FromDiscord | <enthus1ast> BUT, the stuff i'm useing does not work with devel ;\_; |
19:17:12 | FromDiscord | <enthus1ast> rawProc and rawEnv for closures is a hack anyhow, but no idea to make it better \:/ |
19:19:37 | Zevv | what are you trying to *do*, actually |
19:21:49 | FromDiscord | <Hourglass [She/Her]> In reply to @Nerve "Instead of making a": I think using a ref object would be better here, considering that it's the main server object |
19:21:50 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4oh5 |
19:23:17 | FromDiscord | <enthus1ast> and i can connect multiple procs to same MyObj, they'll be called when the event is triggered |
19:23:51 | FromDiscord | <Elegantbeef> Is this a real ECS or just an EC like your previous? 😄 |
19:23:52 | FromDiscord | <enthus1ast> in my tests all work, but in my application it sigseg |
19:23:58 | FromDiscord | <enthus1ast> yes EC |
19:24:00 | FromDiscord | <enthus1ast> \:) |
19:24:23 | FromDiscord | <enthus1ast> the S is overrated any how |
19:25:02 | FromDiscord | <enthus1ast> and i also have troubles to reproduce the issue unfortunately |
19:25:08 | FromDiscord | <enthus1ast> because the code above works |
19:27:34 | FromDiscord | <enthus1ast> also beef i currently just use the event system from the ec(s) |
19:27:56 | FromDiscord | <enthus1ast> argh i hate it when i must fix bugs from past me \: ( |
19:28:09 | FromDiscord | <Elegantbeef> I was just curious if you were making a true ECS |
19:31:30 | FromDiscord | <enthus1ast> the rawEnv does it caputres everything? |
19:31:31 | FromDiscord | <enthus1ast> so |
19:31:40 | FromDiscord | <carsonfarmer> Hey folks, sorry to just barge in here and ask a question... but just wondering if it is possible to create a generic seq typed by a concept? |
19:31:44 | FromDiscord | <enthus1ast> so when there are multiple closures involved? |
19:32:49 | FromDiscord | <carsonfarmer> Something like `var blah: seq[MyConcept] = @[ObjOneThatMatchesMyConcept, ObjTwoThatMatchesMyConcept]` (I know that isn't valid syntax) |
19:32:59 | FromDiscord | <enthus1ast> @carsonfarmer\: either do Object variants or use ref objects |
19:33:15 | FromDiscord | <carsonfarmer> In reply to @enthus1ast "<@499071680841252884>\: either do Object": Ok, this is what I figured! Nice. |
19:33:20 | FromDiscord | <Elegantbeef> Nope concepts do not support runtime polymorphism |
19:35:04 | FromDiscord | <carsonfarmer> (edit) "figured! Nice." => "figured... rats." |
19:36:19 | FromDiscord | <Hourglass [She/Her]> Is it possible to check if a shared library has a method? |
19:36:41 | FromDiscord | <Hourglass [She/Her]> Also, can I access variables from a shared library? |
19:45:23 | FromDiscord | <Hourglass [She/Her]> Is liberal use of `privateAccess` acceptable for my own library code? I'm splitting it all up because it's getting chunky quite quick, but I don't want to make it public because developers who use my library shouldn't be able to use those APIs |
19:45:57 | * | PMunch joined #nim |
19:53:20 | FromDiscord | <enthus1ast> when i remove all the other code, around the problem it works \:/ |
19:53:22 | FromDiscord | <enthus1ast> next project? |
19:53:24 | FromDiscord | <enthus1ast> sooo |
20:04:18 | FromDiscord | <4zv4l> sent a long message, see http://ix.io/4ohh |
20:05:59 | FromDiscord | <Yepoleb> Just tell them to not use certain modules↵(@Hourglass [She/Her]) |
20:08:15 | FromDiscord | <Saint> https://media.discordapp.net/attachments/371759389889003532/1075871246148964453/image.png |
20:08:22 | FromDiscord | <Saint> Shoudl this be import std/httpclient |
20:08:23 | FromDiscord | <Saint> In the dogs |
20:08:26 | FromDiscord | <Saint> (edit) "dogs" => "docs" |
20:09:47 | FromDiscord | <Saint> (edit) "Shoudl" => "Should" | "std/httpclient" => "std/httpclient?" |
20:11:25 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4ohk |
20:13:48 | FromDiscord | <Hourglass [She/Her]> In reply to @Yepoleb "Just tell them to": I personally think it's just cleaner to structure it like I am |
20:21:35 | FromDiscord | <Yepoleb> I don't understand how littering your code with privateaccess is cleaner but you do you |
20:28:19 | FromDiscord | <Yandall> When I try to use `await` inside a handler in prologue it doesn't compile. It says that my func is not `gcsafe`. Anyone know how to fix this? |
20:29:17 | FromDiscord | <enthus1ast> annotate it with the {.gcsafe.} pragma, but it could be that you must lock access to a shared resource |
20:29:39 | FromDiscord | <enthus1ast> imho prologue can use multiple threads |
20:31:05 | * | Guest7068 joined #nim |
20:33:02 | FromDiscord | <Yandall> In reply to @enthus1ast "annotate it with the": But when I do that I had this warning `Warning: 'getProductListNimAsyncContinue' is not GC-safe as it calls 'nameIterVargensym3' [GcUnsafe2]`. Its ok to ignore that? |
20:33:09 | FromDiscord | <Yandall> (edit) "had this" => "getthis" |
20:33:12 | FromDiscord | <Yandall> (edit) "getthis" => "get this" |
20:35:17 | FromDiscord | <Yepoleb> Are you using windows? |
20:35:20 | FromDiscord | <Yandall> Yes |
20:35:37 | FromDiscord | <Hourglass [She/Her]> In reply to @Yepoleb "I don't understand how": Tbf I've only used it once in my entire library so maybe it's as bad as I thought |
20:36:07 | * | Guest7068 quit (Quit: Client closed) |
20:36:23 | FromDiscord | <enthus1ast> this i do not know↵(@Yandall) |
20:37:50 | FromDiscord | <Yepoleb> Just try it tbh |
20:37:55 | FromDiscord | <Hourglass [She/Her]> Is the nim playground dead again? |
20:38:45 | FromDiscord | <Yepoleb> Some parts of asyncdispatch on windows use threads but i don't know which |
20:41:56 | FromDiscord | <Yepoleb> The gcsafe warning is there because you might get random memory corruption issues from the threading |
20:43:02 | FromDiscord | <Hourglass [She/Her]> How do I make a plugin system if I have to cast to the original plugin and don't know what the original type is |
20:43:03 | FromDiscord | <Yandall> In reply to @Yepoleb "The gcsafe warning is": If I compile for linux this issue will dissappear? |
20:43:22 | FromDiscord | <Hourglass [She/Her]> (Since I store all the plugin objects as an `AbstractPlugin` in a sequence) |
20:44:18 | FromDiscord | <Yepoleb> In reply to @Yandall "If I compile for": Linux uses epoll which does not use threads |
20:46:25 | FromDiscord | <Hourglass [She/Her]> Maybe I should just do something like `AbstractPlugin(setup: proc(srv: NbServer) = echo "hello")` |
20:46:56 | FromDiscord | <Yepoleb> Don't quote me on anything though, i spent way too much time trying to understand asyncdispatch without much success |
20:49:34 | FromDiscord | <sOkam!> In reply to @Hourglass, When the Hour Strikes "Is liberal use of": why don't you export explicitely from a second file that imports the public procs, and you import that file manually yourself?↵thinking of `from bla import nil; export bla.thing` |
20:50:48 | FromDiscord | <sOkam!> if you have that file contained in a `private/` or `internal/` folder, it should send the message quite clear that its not meant for external use |
20:54:35 | FromDiscord | <Hourglass [She/Her]> Hm I may do that if I need to do more code that accesses private things, but currently it's only one method so |
20:54:42 | FromDiscord | <Hourglass [She/Her]> field |
20:55:43 | FromDiscord | <sOkam!> imo privateaccess is like unsafe procedures. sure, they are there and usable. but they are never gonna be seen as "good code" |
20:56:21 | FromDiscord | <sOkam!> there are certainly cases for them being good, but as a rule i wouldn't say they are a good first option |
21:00:46 | PMunch | Ugh, getting instantiationInfo is so fickle |
21:01:10 | PMunch | I just keep getting where my macro is implemented and not where it is called |
21:03:50 | * | derpydoo quit (Quit: derpydoo) |
21:13:18 | FromDiscord | <planetis> PMunch are you using instantiationInfo for error message in your macro? |
21:13:46 | PMunch | Well, kinda |
21:13:51 | PMunch | It's for a logging thing |
21:13:59 | PMunch | But I figured it out |
21:14:17 | FromDiscord | <planetis> how setLineInfo? |
21:15:01 | PMunch | Huh? |
21:15:10 | PMunch | setLineInfo is to attach line information to a node |
21:15:24 | PMunch | I want to get the location I was called from |
21:15:55 | FromDiscord | <planetis> oh ok, didn't know |
21:18:34 | PMunch | The idea with setLineInfo was to add line information to nodes generated e.g. from a template language |
21:19:52 | PMunch | Or for example I could add it to protobuf which parses protobuf files and generates code |
21:20:22 | PMunch | With setLineInfo the generated type for a protobuf message could now point to the protobuf file and not the macro code |
21:20:53 | FromDiscord | <planetis> oh you wrote it! Awesome |
21:21:22 | PMunch | setLineInfo? Yeah that was my doing :) |
21:22:01 | FromDiscord | <Elegantbeef> Isnt instantiation info only set inside a template? |
21:22:08 | FromDiscord | <Elegantbeef> So you might need to forward you code through a template |
21:22:20 | FromDiscord | <Elegantbeef> Well templates/generics iirc |
21:22:24 | PMunch | Correct |
21:22:46 | PMunch | I was creating a template in a macro and calling instantiationInfo from that, but the template was then instantiatied from the macro |
21:22:59 | PMunch | So I had to do it the other way around and wrap the macro call in a template call |
21:24:40 | FromDiscord | <Elegantbeef> Would be nice if there was a `macroLineInfo` or something like that, which would store/fetch the instantiation info of the active macro call |
21:24:58 | PMunch | That would indeed be super helpful! |
21:31:04 | FromDiscord | <Elegantbeef> Hmm the Macro calling convention could be expanded so a hidden `instantiationInfo` is passed as the first parameter and accessed with `macroInstantionInfo` |
21:31:29 | FromDiscord | <Elegantbeef> That seems feasible, but do not know if it'd destroy code 😄 |
21:32:05 | FromDiscord | <Elegantbeef> In theory it doesnt change anything, it just means that the VM op for a call pops a value off the stack 😄 |
21:32:55 | PMunch | Yeah that shouldn't really do anything bad |
21:33:29 | PMunch | But I don't know how instantiationInfo is actually implemented |
21:33:56 | PMunch | So there might be an easier way of doing it |
21:34:44 | FromDiscord | <Elegantbeef> It's a compiler magic |
21:35:17 | FromDiscord | <Elegantbeef> Manually handled |
21:35:27 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/fc35f83eee55610af3931f95771b6d1bce1fc845/compiler/semmagic.nim#L97-L111 |
21:39:06 | * | rockcavera joined #nim |
22:06:42 | FromDiscord | <BobBBob> sent a code paste, see https://play.nim-lang.org/#ix=4ohO |
22:11:12 | FromDiscord | <BobBBob> sent a code paste, see https://play.nim-lang.org/#ix=4ohP |
22:11:39 | FromDiscord | <Elegantbeef> `doAssertRaises` |
22:13:48 | FromDiscord | <BobBBob> ahhh thank you |
22:17:12 | FromDiscord | <tsoj> How do errors manifest themselves when using httpclient (e.g. getContent or newHttpClient), for example when the internet connection fails? Is an exception thrown? In the doc there's only specified that when newHttpClient() is called with a max timeout, it may throw a TimeoutError. |
22:17:26 | FromDiscord | <tsoj> as far as I can see at least |
22:18:10 | FromDiscord | <Elegantbeef> Click the three dots |
22:19:06 | FromDiscord | <Elegantbeef> Uhhh wait, seems multisync procs do not get raises...? |
22:24:52 | FromDiscord | <huantian> that's weird, the sync version of the multisync should at least |
22:25:11 | FromDiscord | <Elegantbeef> Do they just not raise then? |
22:25:25 | FromDiscord | <huantian> I doubt that |
22:26:19 | FromDiscord | <Elegantbeef> Oh is the issue they're generic and as such do not show raises... |
22:27:37 | FromDiscord | <Elegantbeef> If that's the issue I vote on instantiating constrained generics on declaration |
22:27:39 | FromDiscord | <Elegantbeef> It only makes sense |
22:48:00 | * | advesperacit quit () |
22:49:40 | FromDiscord | <Yepoleb> In reply to @Hourglass, When the Hour Strikes "Is it possible to": I just saw this again, do you still need help with that? |
22:53:00 | FromDiscord | <Yepoleb> The basic idea is to use dynlib and symaddr |
22:53:57 | FromDiscord | <Yepoleb> symAddr returns a pointer to either a proc or variable and you need to cast that to the correct type. If it returns nil the name does not exist |
22:58:38 | * | PMunch quit (Quit: leaving) |
23:06:53 | FromDiscord | <Hourglass [She/Her]> Good to know, thanks! |
23:07:27 | FromDiscord | <Hourglass [She/Her]> Does arc play nicely with shared libraries? |
23:08:12 | FromDiscord | <Yepoleb> Arc is irrelevant to shared libraries |
23:08:25 | FromDiscord | <Yepoleb> You can't pass references to them |
23:08:30 | FromDiscord | <Hourglass [She/Her]> Use case: Grab a Plugin object from a shared library, since the plugin object is a free hanging variable |
23:08:39 | FromDiscord | <Hourglass [She/Her]> Ah |
23:08:57 | FromDiscord | <Hourglass [She/Her]> Wait so I can't pass ref objects to a shared library? |
23:09:00 | FromDiscord | <Yepoleb> Oh, if it is a rare nim shared library the answer is more complicated |
23:09:07 | FromDiscord | <Hourglass [She/Her]> Ah |
23:09:30 | FromDiscord | <Hourglass [She/Her]> The idea is to have the Nim core load Nim shared libraries |
23:10:42 | FromDiscord | <Hourglass [She/Her]> Since, it's a plugin system for a reason :p |
23:10:55 | FromDiscord | <Yepoleb> https://nim-lang.org/docs/nimc.html#dll-generation |
23:11:21 | FromDiscord | <Yepoleb> You need to link the gc as a shared library as well |
23:12:56 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4oi7 |
23:12:57 | FromDiscord | <Hourglass [She/Her]> In reply to @Yepoleb "You need to link": Oh? |
23:14:39 | FromDiscord | <Hourglass [She/Her]> I thought arc wasn't a gc |
23:15:03 | FromDiscord | <Hourglass [She/Her]> Also no threading support... Sounds painful for when I want to work on speed aha |
23:15:54 | FromDiscord | <Yepoleb> It might be completely outdated |
23:17:19 | FromDiscord | <Yepoleb> I also work on a minecraft clone sometimes and quickly realized a lot of things are new territory in nim |
23:17:38 | FromDiscord | <Yepoleb> So you might have to figure out a lot yourself |
23:18:28 | FromDiscord | <Hourglass [She/Her]> Fair enough haha |
23:18:46 | FromDiscord | <Hourglass [She/Her]> A client sounds like pain, i despise anything graphical :p |
23:20:20 | FromDiscord | <Hourglass [She/Her]> I'm working on a server software which is supposed to be bare bones with plugins doing the heavy lifting (you probably gathered that lol), but I'm breaking it down so networking... The actual blocks, worldgen... Etc is all separate |
23:20:22 | FromDiscord | <Yepoleb> Rendering is actually pretty easy as it works the same as in c |
23:20:31 | FromDiscord | <Hourglass [She/Her]> I'm not good in C either lol |
23:20:55 | FromDiscord | <Yepoleb> What i mean is there is enough documentation |
23:21:21 | FromDiscord | <Hourglass [She/Her]> Ah fair |
23:21:40 | FromDiscord | <Yepoleb> Threading and memory management is a much harder problem |
23:21:58 | FromDiscord | <Yepoleb> Very little documentation on the edge cases of arc |
23:22:03 | FromDiscord | <Hourglass [She/Her]> I just think it's horrible in general, feels like a pain to manage a UI, the game, the physics etc |
23:22:18 | FromDiscord | <Hourglass [She/Her]> I'm probably overcomplicating it in my head |
23:22:40 | FromDiscord | <Hourglass [She/Her]> Oh yeah, does threading work differently with arc at all or? |
23:23:14 | FromDiscord | <Yepoleb> You can theoretically share refcounted memory across threads |
23:23:40 | FromDiscord | <Yepoleb> But also not really because arc is not threadsafe by default, i had to patch it |
23:24:07 | FromDiscord | <Hourglass [She/Her]> That doesn't sound fun at all |
23:24:31 | FromDiscord | <Hourglass [She/Her]> Hm, would threading with arc actually be better than refc because of how it works? |
23:25:00 | FromDiscord | <Yepoleb> Yes, definitely |
23:25:09 | FromDiscord | <Hourglass [She/Her]> Tbf i don't understand how refc works so I can't exactly draw comparisons |
23:25:19 | FromDiscord | <Hourglass [She/Her]> I remembered reading about it but I've forgotten |
23:25:42 | FromDiscord | <Yepoleb> When i learnt about how bad threading support is i quit nim for a few months lol |
23:27:20 | FromDiscord | <Yepoleb> Now i just accept that i can't take anything for granted |
23:27:38 | FromDiscord | <Hourglass [She/Her]> In reply to @Yepoleb "When i learnt about": Rip |
23:27:54 | FromDiscord | <Hourglass [She/Her]> Yeah tbf nothing will be perfect, just closer to perfect than something else |
23:30:56 | FromDiscord | <Yepoleb> I need to go, if you want we can discuss plugins and threading some other time again. Good night! |
23:49:52 | FromDiscord | <Hourglass [She/Her]> Goodnight! |