00:02:34 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=DHEbIpUnypXG |
00:03:23 | FromDiscord | <Elegantbeef> `mixin read` inside your `read[T: Server....]` |
00:03:53 | FromDiscord | <Elegantbeef> Actually why are you doing `static int32`? |
00:04:02 | FromDiscord | <Elegantbeef> It's static just make it `static int` 😄 |
00:04:38 | FromDiscord | <Elegantbeef> PS it's `name, field` not `typ` |
00:05:26 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "PS it's `name, field`": Aaah okay |
00:05:31 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "It's static just make": Fair |
00:05:38 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "`mixin read` inside your": I shall do that tomorrow~ |
00:05:56 | FromDiscord | <Robyn [She/Her]> Also, why do I need to do mixin? I forgot when they're supposed to be used |
00:06:04 | FromDiscord | <Elegantbeef> The reason I suggest that static change is I assume `FixedLength[255]` has `int(255)` inside not `int32(255)` |
00:06:19 | FromDiscord | <Elegantbeef> You don't need it here, but I generally just suggest it inside any proc that has a generic interface |
00:07:28 | * | jmdaemon joined #nim |
00:08:14 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "The reason I suggest": That'd make sense |
00:08:25 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "You don't need it": Ah, does it provide cleaner error messages? |
00:08:33 | FromDiscord | <Elegantbeef> Nope |
00:08:45 | FromDiscord | <Elegantbeef> It just ensures that the symbol is open so it considers instantiation scope |
00:09:08 | FromDiscord | <Elegantbeef> You also no longer need anymore `read` procs for specific packets btw |
00:09:15 | FromDiscord | <Elegantbeef> you just do `read[MyChildType](buf)` |
00:12:52 | FromDiscord | <that_dude.> If I have multiple NimMains due to creating multiple static libraries, does it matter which one I call? |
00:13:08 | FromDiscord | <Elegantbeef> Use `--nimMainPrefix` |
00:13:27 | FromDiscord | <Elegantbeef> Yes it matters cause each NimMain has it's own top level code |
00:14:03 | FromDiscord | <Elegantbeef> You need to call all NimMains |
00:15:00 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "you just do `read[MyChildType](buf)`": Fun :D |
00:16:04 | FromDiscord | <that_dude.> I'm already using `nimMainPrefix`, Thanks again |
00:25:37 | FromDiscord | <luteva> isn't there a 'result' in templates? if no, why not? |
00:26:50 | FromDiscord | <huantian> Templates are code substitution |
00:26:55 | FromDiscord | <huantian> They don’t have result or return |
00:27:12 | FromDiscord | <huantian> Idk how to explain it lol |
00:27:44 | FromDiscord | <Elegantbeef> Since templates are not existent callables and disappear when expanded they do not have any concept of `result` or `return` |
00:27:55 | FromDiscord | <Elegantbeef> Is that better or worse huan? |
00:28:35 | FromDiscord | <luteva> ah ok! thx. |
00:29:03 | FromDiscord | <luteva> but they have/init a new scope, right? |
00:29:25 | FromDiscord | <Elegantbeef> Nope |
00:29:33 | FromDiscord | <Elegantbeef> If you want a new scope use `if true:` |
00:29:42 | * | jmdaemon quit (Ping timeout: 255 seconds) |
00:29:50 | FromDiscord | <huantian> Why not block |
00:30:02 | FromDiscord | <Elegantbeef> `if true` does not fight with `break` |
00:30:18 | FromDiscord | <luteva> uh. ok, no. i don't need the new scope at the moment. just wondering 🙂 |
00:30:36 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=pCbGdQFpEqoN |
00:30:40 | FromDiscord | <huantian> In reply to @Elegantbeef "`if true` does not": Oh right |
00:31:00 | FromDiscord | <Elegantbeef> Depends what you're doing |
00:31:23 | FromDiscord | <Elegantbeef> But generally prefer `if true` for scopes inside templates as it's unclear what will happen otherwise unless the template is a loopy struct |
00:31:27 | FromDiscord | <Elegantbeef> loopy construct\ |
00:41:03 | * | jmdaemon joined #nim |
01:01:12 | * | jmdaemon quit (Ping timeout: 255 seconds) |
01:08:27 | FromDiscord | <MDuardo> What do you think of this issue?↵For using alternative JS runtimes like Deno or Bunhttps://github.com/nim-lang/Nim/issues/20428 |
01:14:41 | * | jmdaemon joined #nim |
01:37:37 | * | jmdaemon quit (Ping timeout: 264 seconds) |
01:41:27 | * | jmdaemon joined #nim |
01:46:37 | * | jmdaemon quit (Ping timeout: 264 seconds) |
01:50:07 | * | nazgulsenpai quit (Ping timeout: 268 seconds) |
01:50:44 | * | nazgulsenpai joined #nim |
01:58:50 | * | jmdaemon joined #nim |
02:04:29 | * | jmdaemon quit (Ping timeout: 260 seconds) |
02:20:15 | * | The_Buhs quit (Quit: Ping timeout (120 seconds)) |
02:20:34 | * | The_Buhs joined #nim |
03:42:30 | FromDiscord | <bung8954> how to set window icon on windows when use fidget ? |
03:45:15 | * | krux02 quit (Remote host closed the connection) |
04:02:05 | * | derpydoo quit (Ping timeout: 256 seconds) |
05:03:35 | * | SchweinDeBurg quit (Ping timeout: 264 seconds) |
05:05:11 | * | SchweinDeBurg joined #nim |
05:36:09 | * | rockcavera quit (Remote host closed the connection) |
05:38:08 | * | junaid_ joined #nim |
06:17:44 | * | spacelucy quit (Quit: WeeChat 4.2.1) |
06:25:06 | * | junaid_ quit (Remote host closed the connection) |
06:37:41 | * | azimut joined #nim |
06:54:22 | * | advesperacit joined #nim |
07:15:22 | * | PMunch joined #nim |
07:49:52 | * | ntat joined #nim |
08:11:43 | FromDiscord | <Robyn [She/Her]> I wonder if there's any use for a pure Nim WASM runtime |
08:12:24 | FromDiscord | <Elegantbeef> The same use as anything in pure nim |
08:13:45 | FromDiscord | <Elegantbeef> But you really should finish your vegetables before you move onto dessert |
08:14:02 | FromDiscord | <Robyn [She/Her]> Don't worry, I'm actually fixating on one thing for once :p |
08:14:23 | FromDiscord | <Elegantbeef> X |
08:14:23 | FromDiscord | <Robyn [She/Her]> Just was wondering if there's a use for one eventually once I get to a stage I implement a plugin system for the server |
08:14:29 | FromDiscord | <Robyn [She/Her]> Hey! |
08:14:46 | FromDiscord | <Elegantbeef> I mean of course there is a use of one, if you want to write Nim and not have to deal with FFI 😄 |
08:15:00 | FromDiscord | <Robyn [She/Her]> I've made an NBT library and polished my events library! I'd say I'm doing well so far- |
08:15:11 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "I mean of course": That's true |
08:15:17 | FromDiscord | <Robyn [She/Her]> Definitely a positive |
08:25:03 | termer | Pure Nim libraries will stop being such a pain in the ass when IC gets implemented |
08:25:17 | termer | right now, the more Nim, the longer the build time |
08:25:22 | termer | uniformly |
08:25:53 | termer | so FFI to a dynlib isn't so bad compared to having to recompile a giant Nim lib repeatedly, even if pure Nim is nicer |
08:27:54 | FromDiscord | <mratsim> sent a long message, see https://pasty.ee/mrrdnBpmfUbY |
08:32:22 | * | azimut quit (Remote host closed the connection) |
08:33:16 | * | azimut joined #nim |
08:54:35 | * | azimut quit (Quit: ZNC - https://znc.in) |
08:55:27 | * | azimut joined #nim |
09:05:27 | FromDiscord | <nnsee> @mratsim saw you in the wild https://media.discordapp.net/attachments/371759389889003532/1207251246474330142/image.png?ex=65def756&is=65cc8256&hm=8c4e40dea6104bf6ad2e9999634d88fabb39323a7140016bbc20d184efa12f48& |
09:20:55 | PMunch | For a second there I thought that was going to be a creep-shot of mratsim somewhere in public |
09:21:13 | PMunch | (On IRC all images are just turned into links) |
09:21:14 | FromDiscord | <nnsee> haha no, those stay in my private collection |
09:23:04 | FromDiscord | <mratsim> In reply to @nnsee "<@570268431522201601> saw you in": https://tenor.com/view/pikachu-break-dance-pokemon-gif-26311247 |
09:57:41 | PMunch | Damn it, not possible to do `varargs[openArray[char]]`? |
09:59:33 | Zevv | not even via an intermediate type |
10:00:13 | Zevv | "The openarray type [...] can only be used for parameters" |
10:04:03 | PMunch | I tried to cheat it via a template with `varargs[untyped]`, but I ran into an issue with the compiler crashing.. |
10:04:11 | PMunch | Trying to stay away from strings |
10:07:59 | Zevv | the compiler crashing |
10:11:42 | FromDiscord | <Elegantbeef> What was the crash? |
10:15:17 | NimEventer | New thread by pixel: Behaviour of procedures marked with 'lent', see https://forum.nim-lang.org/t/10991 |
10:16:04 | PMunch | Elegantbeef, an assertion in renderer.nim saying `n.len == 2` 3 |
10:16:09 | PMunch | Whatever that means |
11:24:49 | * | ntat quit (Read error: Connection reset by peer) |
11:26:28 | * | ntat joined #nim |
11:33:53 | FromDiscord | <kiloneie> how does one use `\` without escaping the next char ? |
11:34:08 | FromDiscord | <kiloneie> need it for markdown |
11:38:40 | FromDiscord | <kiloneie> \ html code, ascii table. |
11:46:45 | FromDiscord | <Benjamin> Either escape it \`\\\\\` or use a raw string literal https://nim-lang.org/docs/manual.html#lexical-analysis-raw-string-literals |
11:56:01 | * | ntat quit (Quit: Leaving) |
12:03:25 | FromDiscord | <Myrkvi> `\\`?↵(@kiloneie) |
12:05:18 | FromDiscord | <Myrkvi> if it's a string literal, you might need `"\\\\"` |
12:05:29 | FromDiscord | <Myrkvi> if it's a string literal, you might need `"\\\\"` (not raw) |
12:05:54 | FromDiscord | <Myrkvi> if you want a \\ in markdown |
12:15:37 | * | baalajimaestro quit (Remote host closed the connection) |
12:31:31 | * | ntat joined #nim |
12:33:29 | FromDiscord | <kiloneie> okay, was having lunch so i haven't tested yet |
12:38:04 | FromDiscord | <Robyn [She/Her]> In reply to @termer "so FFI to a": How about: Dynlib Nim library |
12:38:24 | FromDiscord | <Robyn [She/Her]> That way it'd interact nicer as long as it's the same/similar version of Nim? |
12:38:37 | FromDiscord | <Robyn [She/Her]> Well, GC would have to be linked though so that's a downside |
13:28:00 | * | azimut_ joined #nim |
13:29:08 | * | azimut quit (Ping timeout: 255 seconds) |
14:08:58 | termer | there are things to facilitate that |
14:09:04 | termer | it would be nicer |
14:10:24 | * | rockcavera joined #nim |
14:24:19 | FromDiscord | <Robyn [She/Her]> In reply to @termer "there are things to": True! |
14:30:33 | FromDiscord | <kiloneie> In reply to @Myrkvi "if it's a string": r"\" worked, needed it to do this " - 123\. something" so that it doesn't indent or break |
14:54:46 | * | lucasta joined #nim |
15:31:05 | * | azimut_ quit (Ping timeout: 255 seconds) |
15:32:52 | * | PMunch_ joined #nim |
15:34:37 | * | PMunch quit (Ping timeout: 264 seconds) |
15:39:18 | * | PMunch joined #nim |
15:40:10 | * | PMunch_ quit (Ping timeout: 264 seconds) |
15:46:11 | * | PMunch_ joined #nim |
15:46:53 | * | PMunch quit (Ping timeout: 252 seconds) |
16:41:04 | * | lucasta quit (Quit: Leaving) |
16:45:43 | * | sunset joined #nim |
16:48:12 | sunset | hiya! i'm having some funky issues building Nim (2.0.0 and 2.0.2) from source - the initial compiler builds but the Koch step explodes spectacularly in two different ways; on 2.0.2 it's "Error: redefinition of 'not'; previous declaration here: /home/sunset/nim-2.0.2/lib/system/basic_types.nim(76, 6)" while on 2.0.0 it's "/home/sunset/nim-2.0.0/lib/pure/random.nim(705, 34) Error: 'sizeof' requires '.importc' |
16:48:18 | sunset | types to be '.completeStruct'" |
16:50:36 | sunset | i apologize, i trimmed the first error message's location - it was in arithmetics.nim |
16:57:41 | * | deadmarshal_ quit (Ping timeout: 260 seconds) |
17:09:42 | FromDiscord | <graveflo> looks like there are two different library paths. Are you using the "build_all" script? |
17:11:26 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=WltrsxDEsaYe |
17:12:15 | sunset | nope, just build.sh - note that this is from tarballs, not from git (and i think that the tarballs are missing the ci/ dir which would break build_all anyway) |
17:12:41 | FromDiscord | <graveflo> build all doesn't run the CI |
17:13:45 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=GKOTbphRVEzw |
17:14:14 | sunset | ci/funs.sh isn't in the source tarball, tho |
17:14:18 | FromDiscord | <graveflo> the flags probably help it not pick up your previous install library paths |
17:15:42 | sunset | actually... huh. forcing build.sh to use O2 as the optim level fixes 2.0.2, it looks like?? |
17:15:45 | sunset | what a weird failure mode |
17:17:25 | sunset | thanks for taking a look at my issue, graveflo! |
17:17:50 | FromDiscord | <graveflo> sounds like it cleared a cache maybe. No problem 🙂 |
17:17:59 | * | azimut joined #nim |
17:18:19 | sunset | nah, O3 on this platform is kinda nuked, but usually it just ICE's rather than generating a broken binary |
17:18:23 | sunset | (but sometimes it's the latter too) |
17:18:44 | sunset | i probably should have checked that first |
17:18:53 | FromDiscord | <graveflo> what platform are you on? |
17:19:08 | sunset | linux/ia64 |
17:19:33 | FromDiscord | <graveflo> is that intel 64? |
17:19:41 | sunset | it's intel and it's 64, but it's not intel 64 :) |
17:20:01 | * | rockcavera quit (Read error: Connection reset by peer) |
17:20:05 | FromDiscord | <graveflo> oh :x I've only ever seen 1 pc that used intel's 64 bit spec |
17:20:20 | * | rockcavera joined #nim |
17:20:40 | sunset | well, Intel 64 is equivalent to AMD64 - they're identical ISAs |
17:20:45 | sunset | but IA64 (Itanium) is distinct |
17:21:16 | sunset | and gcc on it has become shaky in recent years - i'm putting together some patches to make O3 less of a minefield, but it takes time |
17:21:54 | FromDiscord | <offenseteacher> sent a long message, see https://pasty.ee/xgtikkciGHYw |
17:22:19 | * | PMunch_ quit (Quit: Leaving) |
17:22:26 | * | azimut quit (Remote host closed the connection) |
17:23:13 | * | azimut joined #nim |
17:26:43 | * | derpydoo joined #nim |
17:27:34 | FromDiscord | <graveflo> I guess try and list all the COM objects that are available. It's possible that the computer doesn't have that feature enabled |
17:28:53 | FromDiscord | <.bobbbob> In reply to @sunset "linux/ia64": you must be the only person using nim on itanium |
17:29:40 | sunset | it's possible! |
17:30:20 | sunset | i don't know if anyone else in my usergroup is, but now i'm wondering |
17:38:24 | Amun-Ra | do not worry, I'm probably the only AmigaOS user ;) |
17:38:36 | FromDiscord | <odexine> its likely someone else has, but not publicly |
17:38:52 | sunset | Amun-Ra: heck yeah! are there Intuition bindings? |
17:39:13 | Amun-Ra | sunset: not yet, but I have it in TODO :P |
17:39:16 | sunset | <3 |
17:39:57 | Amun-Ra | true :> |
17:40:55 | sunset | i'd like to check at some point if Nim runs on HP-UX, since that's where most Itanium users are, but i'm also faintly dreading it |
17:41:56 | Amun-Ra | hppa is on the list |
17:42:37 | * | deadmarshal_ joined #nim |
17:43:15 | sunset | my luck with HP C compilers has gotten worse and worse over the years, and gcc on UX is olddddddd (all of this is on the Itanium side - none of the HP users i know of are still running PA systems) |
17:43:35 | Amun-Ra | hmm |
17:45:01 | * | def- quit (Quit: -) |
17:46:42 | * | rockcavera quit (Remote host closed the connection) |
17:46:58 | * | def- joined #nim |
17:51:17 | * | rockcavera joined #nim |
17:57:48 | * | def- quit (Quit: -) |
17:58:01 | * | def- joined #nim |
18:09:54 | FromDiscord | <morgan> In reply to @mratsim "that's a standard one,": thanks for the suggestion. i don’t really have a kernel that’s looping over it, there’s no bounds on the math (although i am considering changing the math to be bounded at the input border size). and i already have avx2 simd code running that math |
19:12:26 | * | krux02 joined #nim |
19:13:14 | FromDiscord | <varriount> Regarding https://github.com/nim-lang/Nim/issues/23307 , anyone know if checksums/hashes are listed anywhere for the zip file releases and/or their contents? |
19:14:39 | FromDiscord | <varriount> @sunset There are still Itanium users? 😛 |
19:15:54 | FromDiscord | <varriount> (seriously though, I've always felt it was somewhat a shame that Itanium failed. The architecture had a number of nice features) |
19:16:01 | sunset | several thousand, many of who are in an advanced stage of panic over HP-UX EOL next year |
19:16:43 | sunset | (plus whoever's still running VMS) |
19:18:20 | FromDiscord | <varriount> x86 feels like an old instruction manual that has had thousands of sticky notes, graphs, and pop-up charts added to it. |
19:18:51 | sunset | Itanium has its problems too, but i also don't wanna veer too off-topic. :P |
19:21:23 | sunset | (also i'm increasingly convinced that my Nim build is at least slightly broken - the tools build but nimble either hangs or crashes) |
19:41:30 | * | spacelucy joined #nim |
19:41:46 | * | spacelucy quit (Max SendQ exceeded) |
19:43:52 | * | spacelucy joined #nim |
19:43:52 | * | spacelucy is now known as lx12ucy |
19:43:57 | * | lx12ucy quit (Client Quit) |
19:44:14 | * | spacelucy joined #nim |
19:44:17 | * | spacelucy quit (Client Quit) |
19:46:43 | * | lx12ucy joined #nim |
20:14:45 | FromDiscord | <amarevite> sent a code paste, see https://play.nim-lang.org/#pasty=TDfLKhlUNchZ |
20:17:59 | FromDiscord | <odexine> id say something suspicious is going on because of the cast |
20:19:36 | FromDiscord | <odexine> but i dont think so either, seems strange |
20:19:58 | FromDiscord | <amarevite> if i combine lines 39 and 40 to echo the cast directly, the issue persists↵but it only happens for the casted string, even if i have other lines ot echo just before or after it↵so it probably does have something to do with the cast, but im not sure what |
20:20:17 | FromDiscord | <amarevite> (edit) "have other lines ot echo" => "`echo "test"`" |
20:23:52 | FromDiscord | <amarevite> im still stumped though because it only happens if i `echo vowelSeq` between the two for loops |
20:24:43 | FromDiscord | <amarevite> (edit) "loops" => "loops↵and commenting out line 29 doesnt resolve the issue, so it's not `reverse()` doing anything funky" |
20:24:53 | FromDiscord | <odexine> it sure is a strange bug i would say? |
20:25:01 | FromDiscord | <odexine> i still think its some thing to do with outstring |
20:26:00 | FromDiscord | <odexine> im not sure why you have outseq, since you can do `outstring.add` directly |
20:26:07 | * | lx12ucy quit (Ping timeout: 260 seconds) |
20:26:07 | FromDiscord | <odexine> maybe you can refactor your code to do that instead |
20:26:20 | FromDiscord | <odexine> then skip the cast |
20:27:20 | FromDiscord | <amarevite> that resolved the issue |
20:27:45 | FromDiscord | <amarevite> i didnt realize you could add directly to the string like that but it makes sense thinking about it now |
20:28:33 | FromDiscord | <odexine> btw, cast is a dangerous operation and you should opt for "conversions" instead next time↵conversions look like `type(value)` so `string(outSeq)` or (UFCS) `outSeq.string` works too |
20:29:08 | FromDiscord | <odexine> if you know C++, cast is like reinterpret cast |
20:30:10 | FromDiscord | <amarevite> i do not know c++ so im not familiar with that↵why is cast a dangerous operation? |
20:31:14 | FromDiscord | <odexine> it's saying "dont change any of the bits of the value, but change the type" |
20:31:45 | FromDiscord | <odexine> so like if i cast an int to a float its going to take the raw bits of how that int is represented, then put it into a float, no conversions |
20:31:56 | FromDiscord | <odexine> which is usually wrong |
20:32:05 | FromDiscord | <odexine> unless intended, which sometimes it is |
20:34:09 | FromDiscord | <amarevite> ill avoid it going forward, thank you |
20:34:22 | FromDiscord | <odexine> i think you will know when you need to use it |
20:34:53 | FromDiscord | <amarevite> should i open a github issue about the sequence cast bug? i dont think it's intended behavior |
20:35:09 | termer | is it possible to write a conversion for a type like string |
20:35:16 | termer | so I can do MyType.string |
20:35:38 | termer | I'm sure it is, but I don't know how without using converter which is too implicit |
20:35:39 | FromDiscord | <odexine> no i dont think so, custom conversions like that are not a thing (strangely, id say) |
20:35:53 | termer | that's really weird that it doesn't have that |
20:36:17 | FromDiscord | <odexine> In reply to @amarevite "should i open a": i'm not sure if it's a "bug" in the traditional sense, but perhaps you should |
20:43:41 | * | azimut_ joined #nim |
20:44:17 | * | azimut quit (Ping timeout: 255 seconds) |
20:46:30 | * | sunset left #nim (#nim) |
21:03:44 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=JGDPsmbPDOQD |
21:04:11 | FromDiscord | <graveflo> not exactly the same but it's close |
21:06:24 | FromDiscord | <Robyn [She/Her]> Code go brrr, gonna try and get the login stuff working for my MC server within 3 hours |
21:21:09 | * | lx12ucy joined #nim |
21:26:33 | * | PMunch joined #nim |
21:26:46 | FromDiscord | <Robyn [She/Her]> Ugh painful error I've been playing around with for a while now |
21:27:08 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=daidBxwrRinD |
21:28:50 | FromDiscord | <Elegantbeef> Change that to `distinct string` and see if it's different |
21:29:08 | PMunch | Hmm, did Nim remove some automatic dereferencing feature for C++= |
21:29:45 | FromDiscord | <Elegantbeef> The experimental pragma is gone if that's what you mean |
21:29:57 | PMunch | What was the name of that pragma again? |
21:29:58 | FromDiscord | <Elegantbeef> Ref object and ptr object still implicitly dereference on dot exprs |
21:30:03 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Change that to `distinct": No dice |
21:30:09 | PMunch | Oh yeah, that I'm aware of |
21:30:22 | PMunch | I'm trying to get these old WxNim bindings to work again |
21:30:27 | FromDiscord | <Robyn [She/Her]> Distinct string has no difference at all in the error |
21:30:30 | FromDiscord | <Elegantbeef> Push that to a repo and I'll throw darts |
21:30:43 | * | xet7 joined #nim |
21:31:03 | FromDiscord | <Robyn [She/Her]> Assuming that's to PMunch or? |
21:31:15 | FromDiscord | <Elegantbeef> That's to you |
21:32:45 | FromDiscord | <Elegantbeef> Though you it's likely just the `[Length: static StrLen]` |
21:33:00 | FromDiscord | <Elegantbeef> Probably can do `res: var FixedString` and then just do `res.Length` |
21:34:51 | FromDiscord | <Robyn [She/Her]> Yep that fixed it |
21:34:57 | FromDiscord | <Robyn [She/Her]> Thanks :p |
21:35:12 | FromDiscord | <Elegantbeef> Nim has functioning generics |
21:35:17 | FromDiscord | <Elegantbeef> That is a lie |
21:36:05 | FromDiscord | <Robyn [She/Her]> Eyyy my code compiles |
21:36:09 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "That is a lie": :P |
21:36:23 | PMunch | Hmm, my problem is that I have a bunch of wrapped C++ functions which take a `var SomeType`, but in my code I've used `ptr SomeType`. This wasn't an issue in 1.6.14, but apparently it is now.. |
21:36:45 | PMunch | And I seem to remember there being some flag or experimental or something about this.. |
21:38:47 | * | ntat quit (Quit: Leaving) |
21:39:02 | * | xet7 quit (Remote host closed the connection) |
21:40:45 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/devel/compiler/options.nim#L56 |
21:40:49 | FromDiscord | <Elegantbeef> Have at 'er 😄 |
21:44:04 | * | xet7 joined #nim |
21:44:38 | * | ntat joined #nim |
21:57:36 | * | lx12ucy quit (Ping timeout: 255 seconds) |
21:59:26 | * | lx12ucy joined #nim |
22:00:43 | FromDiscord | <Robyn [She/Her]> Server list packet works! Now time for a quick code restructure then I shall continue |
22:01:19 | FromDiscord | <Robyn [She/Her]> Wonder what'd be the best way to go about this... |
22:01:33 | FromDiscord | <Robyn [She/Her]> Table that maps packet IDs to functions? |
22:01:40 | FromDiscord | <Robyn [She/Her]> Semi-clean but feels icky |
22:01:46 | FromDiscord | <Robyn [She/Her]> But better than one large function |
22:04:06 | PMunch | Fun, it just has the pragma {.experimental.} at the top of it.. |
22:04:19 | PMunch | Does that just turn on all the experimental features? |
22:04:26 | FromDiscord | <Elegantbeef> If it's id -\> packetParser just use an array |
22:04:43 | PMunch | I found the one I was looking for though: {.experimental: "implicitDeref".} |
22:04:53 | PMunch | But it doesn't appear to work in Nim 2.0.0 |
22:05:05 | FromDiscord | <Elegantbeef> Yea as I said it was removed |
22:05:28 | PMunch | Wait, did you say it was removed? |
22:05:48 | FromDiscord | <Elegantbeef> > The experimental pragma is gone if that's what you mean |
22:05:53 | PMunch | Oh right, you said the pragma was gone |
22:06:00 | PMunch | I thought you meant that it was now the default.. |
22:06:11 | FromDiscord | <Elegantbeef> Ah sorry |
22:06:13 | PMunch | Sooo, I'm shit out of luck? |
22:06:19 | FromDiscord | <Elegantbeef> It's been ripped out and you must manually deref |
22:16:03 | FromDiscord | <Robyn [She/Her]> Should I link the Nim Discord server in my README.md when I mention it? |
22:16:18 | FromDiscord | <Robyn [She/Her]> Posting my code to GitHub and I'm trying to give credit where due |
22:16:42 | FromDiscord | <Elegantbeef> Nah don't credit anyone |
22:16:55 | FromDiscord | <Robyn [She/Her]> Why :P |
22:17:10 | FromDiscord | <Robyn [She/Her]> You specifically helped me realise I was dumb and not using the unicode lib where I needed to- |
22:17:29 | FromDiscord | <Robyn [She/Her]> Eh, no links, I can't be bothered for that |
22:20:09 | FromDiscord | <Elegantbeef> mmmk |
22:22:46 | * | PMunch quit (Quit: Leaving) |
22:28:28 | FromDiscord | <Robyn [She/Her]> https://github.com/Nimberite-Development/Nimberite-Server :) |
22:37:26 | FromDiscord | <Robyn [She/Her]> Code restructure time~ |
22:41:42 | * | lx12ucy quit (Ping timeout: 255 seconds) |
22:42:40 | FromDiscord | <Robyn [She/Her]> Hm, does `asyncdispatch` play nicely when awaiting closures, out of curiousity? |
22:45:07 | * | ntat quit (Quit: Leaving) |
22:45:16 | FromDiscord | <odexine> futures are closures |
22:45:30 | FromDiscord | <Robyn [She/Her]> Oooh okay, sweet :) |
22:45:49 | FromDiscord | <odexine> its not really clear what you mean by awaiting closures though |
22:48:35 | FromDiscord | <Robyn [She/Her]> In reply to @odexine "its not really clear": I'm not super sure either |
22:49:45 | FromDiscord | <Robyn [She/Her]> Wait, actually, if I await an async function that I've casted from a pointer, to a type like `proc(): Future[string] {.async.}`, and the function at the pointer location also matches, I'm assuming the dispatcher is smart enough to not have a panic attack? |
22:51:03 | termer | please don't start a new project in asyncnet |
22:51:51 | termer | Since you're going to be doing a game server, most of your logic will be able to be threaded |
22:52:26 | termer | you could use asyncnet for reading and writing packets, but I highly recommend you avoid tying yourself to asyncdispatch |
22:52:57 | termer | Keep logic in worker threads, keep I/O somewhere else |
22:53:38 | FromDiscord | <Robyn [She/Her]> In reply to @termer "please don't start a": I did wanna use std/net but I didn't understand how I'd put all networking on one thread (since I don't want to spawn millions of threads) |
22:53:59 | FromDiscord | <Elegantbeef> You'd use selectors... and we just reinvented async |
22:54:14 | termer | I mean you can use asyncnet |
22:54:24 | termer | but don't riddle your code with asyncdispatch stuff |
22:54:44 | termer | Make your stuff event based and run those events on worker threads |
22:54:58 | termer | basically what the Mummy webserver does |
22:55:05 | termer | async I/O, threaded logic |
22:55:37 | termer | Your code will be simpler and easier to debug, and your performance won't be as hampered by doing hard logic because it won't have any ability to block an event loop |
22:55:52 | FromDiscord | <Robyn [She/Her]> In reply to @termer "but don't riddle your": Ah I've only done that for the networking code, I'm gonna try separating that from everything else, but not sure how I'd handle events then since packets need to be sent somehow... Unless I make a packet queue or something...↵↵Sorry, I know I'm not making much sense :p |
22:56:05 | termer | Queue is a good idea |
22:57:21 | termer | I don't think you need to wait on packets to be sent to do more work most of the time since event based architecture works pretty well for Minecraft |
22:58:08 | FromDiscord | <Robyn [She/Her]> Okay so if I wanted to separate network I/O from the application's logic, I should not use asynchronous functions and such, and I should use a packet queue that, so that way I can make different sorts of logic run on different threads? |
22:58:50 | termer | more or less |
22:59:25 | termer | you can still use async for your I/O thread, but pass off packet handling once the packets are parsed to a handler thread in your thread pool |
22:59:31 | FromDiscord | <Robyn [She/Her]> I'm assuming I should probably not spawn an unknown number of threads, and I should split them up by what they'll be handling? For example, entity logic on one thread, chunk gen on another (could be 2 or more threads, but 1 for now seems fine), and continue following that mindset? |
22:59:35 | termer | you can use a channel to do thid |
22:59:59 | termer | There are a number of threadpool libs and impls in Nim, I don't remember many of them |
23:00:03 | * | advesperacit quit () |
23:00:03 | termer | I think stdlib has one |
23:00:11 | termer | and yeah, avoid spawning threads randomly |
23:00:27 | termer | Yes, your reasoning is sound |
23:00:30 | FromDiscord | <Robyn [She/Her]> Yeah that's what I'm thinking of using, but would be nice if I can avoid copying memory with channels |
23:00:49 | termer | You can have a global ring buffer instead |
23:00:57 | FromDiscord | <Robyn [She/Her]> Since it can be guaranteed to only be sent to the network thread I shouldn't have to worry about race conditions? |
23:01:05 | FromDiscord | <Robyn [She/Her]> In reply to @termer "You can have a": What's that? |
23:01:36 | termer | Are you familiar with ring buffers, or double ended queues |
23:01:48 | termer | in stdlib it's called deques |
23:02:04 | FromDiscord | <Robyn [She/Her]> I am not :p |
23:02:14 | FromDiscord | <Robyn [She/Her]> Don't usually mess with anything to do with threading |
23:02:38 | termer | basically resizable queues that can have items popped and pushed from both ends |
23:03:03 | FromDiscord | <leorize> insideout is killer for what you want |
23:03:14 | termer | wikipedia has a good graphic showing what I'm talking about |
23:03:20 | FromDiscord | <Robyn [She/Her]> Oh that seems useful! So I can read the first item in a queue, and add another item at the end? |
23:03:24 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "insideout is killer for": Oh? |
23:03:32 | termer | yes Robyn |
23:04:00 | FromDiscord | <Robyn [She/Her]> https://github.com/disruptek/insideout ? |
23:04:15 | FromDiscord | <Robyn [She/Her]> In reply to @termer "yes Robyn": Sweet, sorry you're having to explain basic concepts to me aha |
23:04:33 | termer | So you can add packets to the queue and the I/O thread can pull from the other side, no memory shifting or copying required |
23:04:46 | FromDiscord | <leorize> pretty much, although disruptek is working on the next generation of this stuff\: https://github.com/disruptek/insideout/blob/loony/examples/telegram.nim |
23:05:17 | FromDiscord | <Robyn [She/Her]> Ah doesn't support `orc`, kind of an issue since my code makes use of cycles |
23:05:18 | termer | I wish CPS and nim-sys were at a point where they could be used for everything lol |
23:05:37 | FromDiscord | <Robyn [She/Her]> In reply to @termer "So you can add": Damn, that sounds super useful! |
23:06:09 | FromDiscord | <Robyn [She/Her]> Okay well, time to try and shove the network IO onto a single thread |
23:06:18 | FromDiscord | <Robyn [She/Her]> Or I can first restructure it to use queues |
23:06:21 | termer | Robyn Anyway, you've got the right idea with threads doing work and using queues to read and send packets to the IO thread |
23:06:23 | FromDiscord | <Robyn [She/Her]> That's probably smarter |
23:06:32 | FromDiscord | <leorize> termer\: soonâ„¢ |
23:06:55 | FromDiscord | <leorize> if you have a queue and you need it to be threadsafe\: https://github.com/nim-works/loony |
23:06:57 | FromDiscord | <Robyn [She/Her]> In reply to @termer "Robyn Anyway, you've got": Thank you! :D |
23:07:18 | termer | see what leorize is posting cause I don't remember if deques is threadsafe lol |
23:07:35 | FromDiscord | <leorize> if it doesn't say thread in the docs, it's not |
23:08:07 | FromDiscord | <Robyn [She/Her]> Definitely looking into `loony`, deques isn't threadsafe |
23:08:14 | FromDiscord | <Robyn [She/Her]> Doesn't say it is, at least |
23:08:44 | termer | Lockfree nature of loony is great |
23:09:03 | termer | Man, I wish I didn't have to tell people not to use the stdlib so often |
23:09:47 | termer | Robyn Another thing I noticed that's a bit if a nitpick, but you're using literals for your packet types. Consider using an enum whose values are those literals |
23:09:55 | FromDiscord | <Robyn [She/Her]> Hm... I feel like isolating stuff like entity logic to a single thread is gonna be difficult |
23:10:16 | FromDiscord | <leorize> disruptek is looking to build out insideout as an AIO solution so just keep watch of that |
23:10:22 | FromDiscord | <Elegantbeef> Termer you can let people walk down the stdlib trail and never come back! |
23:10:38 | FromDiscord | <leorize> ask phil how they felt going down that path with threads |
23:10:57 | termer | You don't need to isolate entity logic to a single thread, you can process logic in parallel based on chunks, but that's even more complex |
23:11:05 | FromDiscord | <Robyn [She/Her]> In reply to @termer "Robyn Another thing I": For stuff like `NextState`? That's because I was looking into a decentralised auth login system for MC which looked neat, and used `69` as the state lol |
23:11:06 | termer | better performance though since entity tick is expensive |
23:11:09 | FromDiscord | <Elegantbeef> I havent seen phil for a few weeks so I assume all hope is lost |
23:11:30 | FromDiscord | <Robyn [She/Her]> In reply to @termer "You don't need to": Oof yeah that sounds worse |
23:11:44 | FromDiscord | <Robyn [She/Her]> I'm so used to async code that threading will be a whole new world for me |
23:11:50 | termer | I'm talking about the packet IDs |
23:11:59 | termer | I see 0x00 etc in there |
23:13:05 | termer | leorize, Why doesn't insideout support ORC |
23:13:10 | FromDiscord | <Robyn [She/Her]> Aaah okay, that makes more sense, yeah I was already planning on that |
23:13:18 | FromDiscord | <leorize> threaded + orc = disaster |
23:13:29 | termer | oh yeah |
23:13:34 | termer | I almost forgot |
23:13:40 | FromDiscord | <Elegantbeef> Cycle collector be like "what's a thread" |
23:14:06 | termer | it's caused a lot of crashes for me |
23:14:33 | termer | It's what causes Prologue to crash in threaded mode |
23:14:40 | FromDiscord | <Robyn [She/Her]> Ah... Loony also says no orc |
23:14:48 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Cycle collector be like": Pain... |
23:14:51 | FromDiscord | <Elegantbeef> Cycles are bad anyway |
23:15:09 | termer | They're bad, but ORC saves your ass if you weren't perfect |
23:15:11 | FromDiscord | <Robyn [She/Her]> I don't think I can use asyncdispatch, and this'll cause issues for me too, I think |
23:15:29 | FromDiscord | <leorize> you will leak memory with asyncdispatch + threads |
23:15:33 | FromDiscord | <Elegantbeef> Yea I'm more being satirical termer |
23:15:51 | termer | Robyn Do you want to go down an interesting but rewarding path? |
23:15:55 | FromDiscord | <Elegantbeef> stdlib's async dispatch creates cycles like mad |
23:16:04 | termer | constant cycles and constant leaks |
23:16:10 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=GRITfvVzVMRW |
23:17:01 | termer | You should try out CPS with nim-sys library |
23:17:18 | FromDiscord | <leorize> sys doesn't do udp yet, if your game uses that |
23:17:23 | termer | or use selectors if you want to take a detour and do all the IO yourself |
23:17:30 | termer | Minecraft is TCP leorize |
23:17:46 | FromDiscord | <leorize> the horroor |
23:17:51 | FromDiscord | <leorize> the horror |
23:17:53 | termer | it works fine |
23:18:10 | FromDiscord | <Elegantbeef> I mean it's a game written in java with a shit load of instanced data that's the scary part |
23:18:34 | FromDiscord | <Elegantbeef> What is a user defined value type |
23:18:42 | termer | Minecraft server is super inefficient in many ways |
23:18:49 | termer | everything in it is immutable basically |
23:19:00 | termer | so you're allocating and throwing away objects constsntly |
23:19:15 | FromDiscord | <Elegantbeef> Vector math inside java is scary |
23:19:42 | termer | Let's pretend that we're in a functional language where we can have immutable data that's optimized |
23:19:56 | termer | just SURPRISE get hit with a 1 second GC fullcollect |
23:20:28 | FromDiscord | <Robyn [She/Her]> In reply to @termer "or use selectors if": ...hm, do you think I'd learn a decent amount from that, to the point that it'd be worth it? |
23:20:32 | FromDiscord | <Elegantbeef> I love looking at MC performance graphs |
23:20:43 | FromDiscord | <Elegantbeef> I mean selectors are not complicated |
23:20:43 | termer | If you like networking, you'll like it |
23:20:51 | termer | it's worth understanding |
23:21:03 | termer | wait, does it do Windows |
23:21:19 | FromDiscord | <Elegantbeef> It's quite literally "Here is are FDs alert me when any are ready to read" |
23:21:22 | termer | wasn't there a wrapper over POSIX selectors made by ringabout that wrapped Windows |
23:21:43 | FromDiscord | <Elegantbeef> std/selectors partially works on windows |
23:21:58 | termer | The issue for multiplayer aio is the fact that Windows requires you to ask first, POSIX tells you when you can read |
23:22:05 | FromDiscord | <Elegantbeef> > Windows (only sockets and user events) |
23:22:06 | termer | "multiplatform |
23:22:21 | FromDiscord | <leorize> y'know, sys handles all of those |
23:22:31 | FromDiscord | <leorize> though I haven't benchmarked sys on windows |
23:22:49 | FromDiscord | <Elegantbeef> Leo advertising ahead of schedule |
23:22:53 | FromDiscord | <Elegantbeef> Too the moon! |
23:22:58 | FromDiscord | <Elegantbeef> To\ |
23:23:11 | FromDiscord | <girvo> Good news: the chronos server(s) are now _far_ more performant and less resource leaky than our threadpool version |
23:23:20 | FromDiscord | <Elegantbeef> You did it! |
23:23:22 | termer | I don't give a shit about Windows for server other than that it works correctly so devs on Windows can work on it to later deploy on a POSIX system |
23:23:43 | FromDiscord | <girvo> In reply to @termer "I don't give a": even _on_ windows we dev in WSL2 anyway lmao |
23:23:45 | FromDiscord | <leorize> in the future you could expect linux's aio to be similar to windows |
23:23:56 | FromDiscord | <leorize> io\_uring is pretty much iocp but better |
23:23:59 | FromDiscord | <Robyn [She/Her]> In reply to @termer "it's worth understanding": Fair |
23:24:00 | termer | that's how IOUring is |
23:24:06 | termer | yeah |
23:24:19 | termer | There's a Russian guy I forget the name of working on a Nim wrapper for it |
23:24:30 | termer | really excited about it and I hope support can be added to sys |
23:24:33 | FromDiscord | <Elegantbeef> > works correctly so devs on Windows ...↵I mean they're using windows so what's 'correct' 😛 |
23:24:47 | FromDiscord | <leorize> well... https://github.com/disruptek/yourang |
23:24:52 | FromDiscord | <girvo> In reply to @leorize "sys doesn't do udp": aw, will be fun to test once it does. we use udp extensively for our server to receive sensor data |
23:25:22 | termer | I love disruptek's names |
23:25:23 | FromDiscord | <leorize> I still need users to stress test my TCP API |
23:25:32 | FromDiscord | <girvo> In reply to @Elegantbeef "You did it!": my only gripe is the documentation lmao. or like... complete lack thereof. the `tests` folder came to my rescue |
23:25:45 | FromDiscord | <Elegantbeef> I'm still quite amazed that windows does not error when sending a packet to port 0 |
23:25:50 | FromDiscord | <Robyn [She/Her]> Oof, yeah I can't test (easily) on Windows since while I can dualboot, the start menu freezes |
23:25:52 | termer | same for me girvo |
23:25:53 | FromDiscord | <Elegantbeef> Or atleast some APIs do not error |
23:25:57 | FromDiscord | <Robyn [She/Her]> Linux brings new life :P |
23:25:59 | FromDiscord | <leorize> something something backward compatibility |
23:25:59 | FromDiscord | <girvo> In reply to @leorize "I still need users": if I get some time I can port our two tcp servers to it and see how it runs |
23:26:02 | FromDiscord | <Elegantbeef> Robyn imagine CI existing |
23:26:03 | FromDiscord | <leorize> and that includes bugs |
23:26:24 | FromDiscord | <girvo> In reply to @termer "same for me girvo": its rough hey haha. like to the point where im tempted to document it myself :/ |
23:26:37 | FromDiscord | <girvo> I've half needed to for my team anyway |
23:26:42 | FromDiscord | <Elegantbeef> Leo I think it's unlikely to get users for any library 😛 |
23:26:52 | termer | The comments are there, just not the module guides or anything you can read at a high level to understand |
23:26:59 | FromDiscord | <Elegantbeef> Perhaps I'm just cynical about traitor |
23:27:02 | FromDiscord | <Elegantbeef> I want issues! |
23:27:12 | termer | You need more people shilling |
23:27:18 | FromDiscord | <leorize> I will look into your traitor eventually |
23:27:20 | termer | and to get it used in something bigger |
23:27:24 | FromDiscord | <leorize> after I study proper streams |
23:27:26 | FromDiscord | <girvo> In reply to @termer "The comments are there,": yeah. hence why the tests folder was at least useful to match up "heres how to start a tcp server, heres how to use transportstream, etc" |
23:27:43 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Robyn imagine CI existing": Don't feel like committing every minor tweak either |
23:28:05 | termer | Chronos and sys have next to no docs, but Chronos is so much more complicated |
23:28:08 | FromDiscord | <Elegantbeef> I mean you should have functioning tests that can be ran 😄 |
23:28:31 | FromDiscord | <girvo> But like, chronos/apps/http/httpclient is amusing, once you understand how it works its nice, but like making HttpSessionRef then passing that to HttpClientRequestRef is not how I expected it to work lol, when crafting particular request objects and such |
23:28:32 | FromDiscord | <girvo> Works well thoguh |
23:28:32 | * | azimut_ quit (Ping timeout: 255 seconds) |
23:28:38 | FromDiscord | <Robyn [She/Her]> Could I get a link to nim sys to check it out? :p |
23:28:47 | FromDiscord | <Elegantbeef> I do realise now that it's more of an interface library than traits, but it does have some aspects of traits so it's like just on the edge |
23:28:47 | FromDiscord | <leorize> hey sys has plenty of docs |
23:28:55 | FromDiscord | <girvo> https://github.com/alaviss/nim-sys |
23:28:56 | FromDiscord | <leorize> no examples though, I admit |
23:29:00 | FromDiscord | <Elegantbeef> Sadly I cannot represent things like `Literal` or `Numeric` |
23:29:17 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "I mean you should": Sure, but how am I supposed to check my code works, quickly |
23:29:32 | FromDiscord | <Robyn [She/Her]> CI takes a bit to start and I can't debug code that isn't running on my system |
23:29:40 | FromDiscord | <Elegantbeef> Run your tests locally if they pass on your PC push them |
23:29:43 | FromDiscord | <leorize> this is why you need balls |
23:29:44 | FromDiscord | <Robyn [She/Her]> In reply to @girvo "https://github.com/alaviss/nim-sys": Thanks! |
23:29:47 | FromDiscord | <Elegantbeef> When the CI fails on windows say "PRs welcome" |
23:29:57 | FromDiscord | <Elegantbeef> Leo that is an offensive line to some |
23:29:58 | FromDiscord | <girvo> @leorize can I set SO_REUSEADDR on a nim-sys tcp socket? |
23:30:10 | FromDiscord | <leorize> soonâ„¢ |
23:30:12 | FromDiscord | <girvo> (I'm reading the tsockets.nim test atm) |
23:30:16 | FromDiscord | <girvo> fair haha 🙂 |
23:30:33 | FromDiscord | <leorize> I still need to decide what to do for v6 sockets |
23:30:33 | FromDiscord | <Elegantbeef> Oh leo do you guys do anything inside CPS to do nicer names for debugging? |
23:30:41 | FromDiscord | <girvo> we use that, plus we also use UDP broadcast which needs some wonky flags |
23:30:45 | FromDiscord | <leorize> which will introduce listen flags where reuseaddr could come back |
23:30:54 | FromDiscord | <girvo> In reply to @leorize "which will introduce listen": fair |
23:30:59 | * | bcksl quit (Quit: \) |
23:30:59 | * | end quit (Quit: end) |
23:31:02 | FromDiscord | <Elegantbeef> I got some `exportC`s but those of course are too sketchy to enable by default |
23:31:16 | FromDiscord | <leorize> sys allows you to construct your own socket before handing it over |
23:31:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=RVdfCFbCFgoz |
23:31:33 | FromDiscord | <leorize> although I guess I could make it a bit nicer |
23:31:48 | FromDiscord | <leorize> beef\: we do |
23:32:03 | FromDiscord | <leorize> though this is like, disruptek turf |
23:32:13 | FromDiscord | <girvo> In reply to @leorize "sys allows you to": oh neat |
23:32:14 | FromDiscord | <leorize> but we generate a bunch of `space separated name` |
23:32:27 | FromDiscord | <Elegantbeef> I don't want to talk to him as he's going to attempt to sell me on adding dynamic dispatch to CPS |
23:32:32 | FromDiscord | <Elegantbeef> 😄 |
23:32:35 | FromDiscord | <girvo> lmao |
23:32:45 | FromDiscord | <girvo> hey as long as its optional 😉 |
23:33:12 | FromDiscord | <Elegantbeef> It wouldn't be from what he's said afaik |
23:33:25 | FromDiscord | <Elegantbeef> But what do I know my eyes glaze over and I curl up in a bal |
23:33:55 | FromDiscord | <girvo> aw |
23:34:24 | FromDiscord | <leorize> yea I'm nicer than go people \:p, so you basically make your own socket, bound it then `Listener[TCP](newSocket(fd))`↵(@girvo) |
23:34:44 | FromDiscord | <girvo> paying dynamic dispatch costs in embedded land is not always a good idea, and I still reckon cps has tonnes of potential for wrangling RTOS tasks and such |
23:34:54 | FromDiscord | <girvo> In reply to @leorize "yea I'm nicer than": oh awesome, I can port to it then haha |
23:35:10 | FromDiscord | <girvo> If I get some spare time I'll give it a go and see how it fares and let ya know! |
23:35:25 | FromDiscord | <leorize> the docs should tell you what is expected of a socket\: https://alaviss.github.io/nim-sys/sockets.html#newAsyncSocket%2CSocketFD |
23:35:27 | termer | CPS is good for everything |
23:35:51 | FromDiscord | <leorize> a `Listener` is just a distinct socket so I can scope operations to it |
23:35:55 | termer | you can't pay asyncdispatch costs anywhere without throwing away performance and memory in ORC |
23:36:06 | FromDiscord | <girvo> I wanna look at your AsyncFile stuff, because I want to port/replicate/etc. it to chronos. Their lack of an `asyncfile` alternative is a little pain |
23:36:09 | termer | it was ok in refc land |
23:36:17 | termer | in ORC land, total hazard |
23:36:23 | FromDiscord | <leorize> it's not because they didn't want it |
23:36:29 | FromDiscord | <Robyn [She/Her]> Hm. Might use nim sys, still to be decided |
23:36:30 | FromDiscord | <girvo> In reply to @termer "you can't pay asyncdispatch": do you meant `std/asyncdispatch` or broader asyncdispatch? |
23:36:40 | FromDiscord | <Elegantbeef> the stdlib of course |
23:36:42 | FromDiscord | <leorize> it's because it never does what you want |
23:36:45 | FromDiscord | <Elegantbeef> The cyclical one |
23:36:51 | FromDiscord | <girvo> okay cool lol |
23:36:54 | FromDiscord | <leorize> https://alaviss.github.io/nim-sys/files.html#read,AsyncFile,ptr.UncheckedArray[byte],Natural \<- read the notes at the bottom |
23:37:02 | FromDiscord | <girvo> I've just decided to never ever use `std/asyncdispatch` ever again lmao |
23:37:08 | FromDiscord | <girvo> In reply to @leorize "https://alaviss.github.io/nim-sys/files.html#read,A": sweet, thanks! |
23:37:36 | FromDiscord | <girvo> Hm fascinating |
23:37:48 | FromDiscord | <girvo> What's Node.js et al doing then? Just pretending its async? |
23:38:23 | FromDiscord | <leorize> threads |
23:38:28 | FromDiscord | <girvo> Fair |
23:38:35 | FromDiscord | <leorize> libuv maintains a thread pool for this |
23:38:43 | FromDiscord | <girvo> yeah cool |
23:38:48 | FromDiscord | <girvo> I remember that now actually |
23:39:02 | FromDiscord | <girvo> I was using libuv in PHP once upon a time, just to really make people scream in agony |
23:39:23 | FromDiscord | <leorize> well once insideout rolls around that should stop being a problem |
23:39:42 | FromDiscord | <girvo> insideout? |
23:40:02 | FromDiscord | <leorize> disruptek's concurrency library |
23:40:08 | FromDiscord | <leorize> basically goroutines but better |
23:40:09 | FromDiscord | <girvo> ooooh |
23:40:11 | FromDiscord | <girvo> neat 🙂 |
23:40:46 | FromDiscord | <girvo> arc but not orc is interesting! |
23:41:04 | FromDiscord | <leorize> right now sys still do this weird distinction between async file and normal file |
23:41:10 | FromDiscord | <leorize> it's not a bad idea but it limits us to what the OS could do since we align those defs so close to the OS |
23:41:25 | FromDiscord | <leorize> yea you don't put threads next to orc |
23:41:33 | FromDiscord | <girvo> yeah that makes sense to me tbh |
23:41:54 | FromDiscord | <girvo> Its interesting to see insideout just pull in the pthread headers directly |
23:42:30 | FromDiscord | <girvo> funnily enough that makes it feasible to work directly on esp32 via the pthread freertos task wrapper lmao, though who knows if it would work in practice |
23:42:43 | FromDiscord | <girvo> Ah actually no it wont work |
23:43:03 | FromDiscord | <girvo> coz pthread_kill is not defined on FreeRTOS/ESP-IDF's pthread interface: you can't actually kill/stop a Task |
23:43:24 | FromDiscord | <leorize> I think insideout still needs more time in the oven, but disruptek already build a software with it\: https://github.com/disruptek/balls |
23:43:32 | FromDiscord | <girvo> hehe. balls |
23:43:39 | FromDiscord | <girvo> im 12 |
23:43:58 | FromDiscord | <Elegantbeef> I think dis is 9 |
23:44:07 | FromDiscord | <girvo> lmao |
23:44:17 | FromDiscord | <leorize> https://github.com/disruptek/testes |
23:44:23 | FromDiscord | <Elegantbeef> Ah there it is |
23:44:24 | FromDiscord | <Elegantbeef> Was going to say |
23:44:40 | FromDiscord | <girvo> okay he really puts my immaturity to shame, i bow down to the master lmao thats hilarious |
23:45:01 | FromDiscord | <leorize> idk if yard is still here but you can ask them for disruptek quotes |
23:45:17 | FromDiscord | <Robyn [She/Her]> @Yardanico |
23:45:57 | FromDiscord | <Elegantbeef> Dis and I go in exact opposite in naming schemes, he goes for the dick joke I allude to a dick joke. We're not the same 😄 |
23:46:15 | FromDiscord | <girvo> Beefs much classier 😉 |
23:46:25 | * | bcksl joined #nim |
23:46:36 | FromDiscord | <Elegantbeef> I actually have not named anything with such complete lack of witticism |
23:47:18 | FromDiscord | <girvo> If I wanted to build some async file like system, is there a threadpool impl that I should use that 1) isn't actually `std/threadpool` and 2) will at least semi- play nice with chronos? |
23:47:48 | FromDiscord | <girvo> The straight up blocking file reads in our otherwise completely async servers makes me sad, and it happens on every valid (at the app level) TCP connection |
23:48:12 | FromDiscord | <leorize> insideout \:p |
23:48:34 | FromDiscord | <girvo> is it oven-ed enough :p if it is, I'll give it a crack |
23:48:48 | FromDiscord | <leorize> balls can test your matrix in parallel and all it uses is insideout |
23:48:49 | FromDiscord | <girvo> it's code is straightforward enoguh |
23:50:50 | FromDiscord | <leorize> the loony branch is where it's going afaik |
23:51:01 | FromDiscord | <leorize> the telegram example in there is basically showcasing goroutines |
23:51:04 | FromDiscord | <girvo> okay I'll take a look! |
23:51:31 | FromDiscord | <girvo> i always thought a goroutine like/proper green threading runtime would be a nice fit to Nim, even more so with modern Nim too |
23:51:58 | FromDiscord | <Elegantbeef> Speaking of balls, I'm amazed that traitor fails tsan. It has to be a false positive... right |
23:52:18 | FromDiscord | <leorize> there's no such thing as a tsan fp |
23:52:18 | FromDiscord | <leorize> helgrind fp, sure |
23:52:21 | FromDiscord | <leorize> tsan fp, haven't seen one |
23:52:37 | FromDiscord | <Elegantbeef> Well then it's Nim's generated code failing all the tests 😄 |
23:52:43 | FromDiscord | <Elegantbeef> Since I use no unsafe mechanisms |
23:53:03 | FromDiscord | <leorize> show traces |
23:53:33 | * | end joined #nim |
23:54:05 | FromDiscord | <Elegantbeef> I mean asan shows leaks in init procedures |
23:54:15 | FromDiscord | <Elegantbeef> So... very much seems like not my house not my problem |
23:54:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=dmAIUAFRZBud |
23:54:50 | FromDiscord | <Elegantbeef> Wait that's ASAN isn't it |
23:54:58 | FromDiscord | <leorize> yea |
23:55:02 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=svowBoqzbRAV |
23:55:04 | FromDiscord | <Elegantbeef> That's the one I wanted |
23:55:16 | FromDiscord | <leorize> ah, your kernel is too new |
23:55:24 | FromDiscord | <Elegantbeef> Arch life |
23:55:25 | FromDiscord | <leorize> you need llvm 19 to use tsan with that |
23:55:40 | FromDiscord | <MDuardo> Beef uses Arch BTW |
23:55:41 | FromDiscord | <Robyn [She/Her]> I hope this looks good on my portfolio, even if Nim is a niche language- |
23:55:56 | FromDiscord | <Elegantbeef> I mean I use endeavour so not really Arch BTW |
23:56:51 | FromDiscord | <girvo> anyone know whether I need to do anything more than `onSignal(SIGINT, SIGTERM): server.stop()` to shut down (cleanly) a chronos `StreamServer`? Maybe its coz I'm missing a `quit(0)` there like my setControlCHook uses, but when systemd sends it a SIGTERM, it mostly seems to keep trucking along |
23:57:09 | FromDiscord | <leorize> or run `sudo sysctl vm.mmap_rnd_bits=28` to return to pre-6.6 behavior and get tsan running |
23:57:10 | FromDiscord | <MDuardo> I use Nix (can't download Nim2) |
23:57:10 | FromDiscord | <Elegantbeef> Thank god for immutable systems, really prevent people from changing their systems |
23:57:11 | FromDiscord | <Elegantbeef> Ah there we go tsan is now glowing |
23:57:11 | FromDiscord | <MDuardo> Doesn't Endeavour use the same repos + the Endeavour packages? |
23:57:32 | FromDiscord | <Elegantbeef> Right, but it's not the same as Arch btw |
23:57:38 | FromDiscord | <Elegantbeef> It's like debian vs ubuntu 😛 |
23:58:21 | FromDiscord | <Elegantbeef> One lacks the cred |
23:58:59 | FromDiscord | <Elegantbeef> Ok leo now what about these leaks from the times module? |
23:59:28 | FromDiscord | <Elegantbeef> I know they're probably global thread vars |
23:59:38 | FromDiscord | <Elegantbeef> But what's the best way to ignore the results |
23:59:43 | FromDiscord | <leorize> well if they leaks they leaks |
23:59:43 | FromDiscord | <leorize> sorry |
23:59:45 | FromDiscord | <Elegantbeef> \I really should setup a CI for traitor |
23:59:57 | FromDiscord | <girvo> In reply to @leorize "sorry": hahaha |