| 00:00:02 | * | marcus quit (Remote host closed the connection) |
| 00:00:52 | * | marcus joined #nim |
| 00:07:59 | * | antranigv joined #nim |
| 00:30:32 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
| 00:32:21 | * | antranigv joined #nim |
| 00:40:50 | * | SchweinDeBurg joined #nim |
| 00:54:57 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
| 01:00:48 | * | antranigv joined #nim |
| 01:22:22 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
| 01:30:45 | * | antranigv joined #nim |
| 01:42:35 | * | spacelucy quit (Quit: WeeChat 4.2.1) |
| 01:52:44 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
| 01:55:29 | * | SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev) |
| 01:56:07 | * | antranigv joined #nim |
| 01:59:21 | FromDiscord | <girvo> @ElegantBeef hello! question about `seeya`: `makeHeader("tests/mylib.h")` -> for any nim module I want to generate a header for, is it as simple as having this at the end of the module? That's the compile-time trigger that generates the .h right? |
| 02:00:10 | FromDiscord | <girvo> One would then need to have it output that module as a dynlib or static library for the C entrypoint code to link to? |
| 02:00:29 | FromDiscord | <Elegantbeef> You also need to add the pragma |
| 02:00:41 | FromDiscord | <Elegantbeef> That just generates the header of course |
| 02:01:00 | FromDiscord | <Elegantbeef> You still should have a `nim c --app:lib|--app:staticlib ...` |
| 02:01:01 | FromDiscord | <girvo> Oh yeah of course, this is assuming I've pragma-d the various things I want 🙂 |
| 02:01:04 | FromDiscord | <girvo> Yeah sweet |
| 02:01:23 | FromDiscord | <Elegantbeef> I force two separate steps myself as I do not like the idea of seeya changing your semantics |
| 02:01:29 | FromDiscord | <girvo> Yeah I absolutely agree |
| 02:01:45 | * | casaca joined #nim |
| 02:01:57 | FromDiscord | <Elegantbeef> https://github.com/beef331/libnimib it is dog fooded here and you can see the `config.nims` for an example |
| 02:02:17 | FromDiscord | <girvo> Champion, cheers 🙂 |
| 02:03:59 | FromDiscord | <Elegantbeef> libnimib made me write seeya so it atleast served one purpose |
| 02:04:22 | FromDiscord | <Elegantbeef> Seeya also forces arc/orc which I assume is fine for you, just noting |
| 02:05:42 | FromDiscord | <Elegantbeef> Oh I also do not presently support OOP and have no error to check that so uhh do not share oop objects 😛 |
| 02:06:20 | FromDiscord | <Elegantbeef> I need to opaquely handle OOP objects and structs, but have not gotten to it |
| 02:06:25 | * | khazakar quit (Quit: Connection closed for inactivity) |
| 02:13:28 | FromDiscord | <girvo> Yeah fine for me haha |
| 02:13:36 | FromDiscord | <girvo> imagine doing oop 😛 |
| 02:13:39 | FromDiscord | <girvo> I certainly can't |
| 02:14:25 | FromDiscord | <girvo> Question: is there a linter/formatter that's okay for Nim? Specifically I'd like to catch `example("hello",someVar)` that missing space after the `,` |
| 02:15:32 | FromDiscord | <zumi.dxy> there's `nimpretty`, but `nph` is more recent: https://github.com/arnetheduck/nph |
| 02:16:12 | FromDiscord | <zumi.dxy> (edit) "`nimpretty`," => "`nimpretty` (which apparently comes with Nim)," |
| 02:16:58 | FromDiscord | <girvo> Cheers! |
| 02:29:52 | FromDiscord | <girvo> Is it possible to get the range of an enum type, short of doing `Example.low.int..Example.high.int`? |
| 02:29:53 | FromDiscord | <Elegantbeef> In regard to linting, for semantic linting Nim provides term rewriting macros that a devilish person could use if so inclined 😄 |
| 02:30:01 | FromDiscord | <girvo> In reply to @Elegantbeef "In regard to linting,": evil lmao |
| 02:30:19 | FromDiscord | <Elegantbeef> `Example.low..Example.high`? |
| 02:30:24 | FromDiscord | <Elegantbeef> Or do you really want it as an `int` |
| 02:30:28 | FromDiscord | <girvo> I do yeah |
| 02:30:43 | FromDiscord | <Elegantbeef> `Example.low.ord .. Example.high.ord` is the best you get |
| 02:30:49 | FromDiscord | <girvo> Okay cheers |
| 02:31:20 | FromDiscord | <Elegantbeef> Make a `template intRange(e: typedesc[enum]: untyped = range[e.low.ord..e.high.ord]` if you want it for multiple types |
| 02:31:29 | FromDiscord | <girvo> Converting a (transmitted over the network, semi-untrusted) int to an enum, wanting to make sure it doesn't cause any funkiness |
| 02:31:58 | FromDiscord | <girvo> wait no, not network, but from a C library `esp_get_log_level` \ |
| 02:32:00 | FromDiscord | <girvo> (edit) removed "\" |
| 02:32:20 | FromDiscord | <Elegantbeef> For non holey enums `x in Enum.low.ord..Enum.high.ord` is the most idiomatic check 😄 |
| 02:32:27 | FromDiscord | <girvo> Sweet as 🙂 |
| 02:32:29 | FromDiscord | <Elegantbeef> For holey enums you have `enumutils` |
| 02:32:33 | FromDiscord | <girvo> Yeah this is non holey |
| 02:32:40 | FromDiscord | <Elegantbeef> Though enumutils falls apart with large ranges |
| 02:32:51 | FromDiscord | <Elegantbeef> Since it uses a set constructor |
| 02:32:53 | FromDiscord | <girvo> Oh interesting. how large is large? |
| 02:33:20 | FromDiscord | <Elegantbeef> uint.high range between `low` and `high` |
| 02:35:00 | FromDiscord | <girvo> Is that the maximum wrt. set or? |
| 02:35:22 | FromDiscord | <Elegantbeef> Yes `set[T]` is limited to uint16.high entries |
| 02:35:28 | FromDiscord | <Elegantbeef> Whoops made a typo before 😄 |
| 02:37:59 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/8188 is basically where you're at for holey |
| 02:38:40 | FromDiscord | <girvo> Good to know, cheers 🙂 |
| 02:38:55 | FromDiscord | <girvo> Whats the status of the Nim LSP? I notice the VSCode extension supports it, but defaults to nimsuggest |
| 02:39:11 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
| 02:39:53 | FromDiscord | <Elegantbeef> Are you using the official extension? |
| 02:40:04 | FromDiscord | <Elegantbeef> I believe nimlangserver is now the default with vscode |
| 02:40:09 | FromDiscord | <Elegantbeef> Well the official extension |
| 02:45:00 | * | antranigv joined #nim |
| 02:55:37 | * | krux02 quit (Remote host closed the connection) |
| 03:04:40 | FromDiscord | <girvo> I think I'm using the other one? |
| 03:05:08 | FromDiscord | <girvo> nimsaem.nimvscode |
| 03:05:41 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
| 03:06:34 | * | antranigv joined #nim |
| 03:07:41 | FromDiscord | <girvo> Question around `range[0..2]` `type`: ↵With an actual range literal, I can do:↵`if 3 in 0..5:`↵But if I define a type (`type Test = range[0..5]`) I obviously can't do `if 3 in Test` because it's a typedesc. Can I "extract" the "real" range from it to use in a check like that? |
| 03:08:12 | FromDiscord | <girvo> I guess its the same thing as before? `if 3 in Test.low..Test.high` |
| 03:08:17 | FromDiscord | <Elegantbeef> `Test.low.ord..Test.high.ord` |
| 03:08:37 | FromDiscord | <girvo> Seems interesting that theres not a stdlib template, I guess this isn't that common? |
| 03:08:46 | FromDiscord | <Elegantbeef> You can also make a `proc contains(i: int, rng: typedesc): bool = ....` |
| 03:08:52 | FromDiscord | <Elegantbeef> There was a PR which was declined |
| 03:08:57 | FromDiscord | <girvo> Oh interesting |
| 03:09:30 | FromDiscord | <Elegantbeef> Leo points to it in that PR |
| 03:09:37 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/pull/15212 |
| 03:09:39 | FromDiscord | <Elegantbeef> I mean forum post |
| 03:11:35 | FromDiscord | <leorize> I wrote two impl and both of them stayed in limbo until I just let them die because it's clear that no one else but me have that problem |
| 03:11:52 | FromDiscord | <Elegantbeef> Oh I also have that problem 😄 |
| 03:12:04 | FromDiscord | <girvo> Haha I also have that problem tbf |
| 03:12:17 | FromDiscord | <Elegantbeef> Range types are wholly unsafe though sadly |
| 03:12:26 | FromDiscord | <girvo> Yeah I've picked up on that |
| 03:12:37 | FromDiscord | <girvo> Makes sense, thats in the dependant type system space |
| 03:12:56 | FromDiscord | <leorize> it's gonna be that PR's 4th birthday in a few months \:p |
| 03:13:02 | FromDiscord | <Elegantbeef> Well the reason they're unsafe is there is no explicit conversion so you get defects without knowing |
| 03:13:31 | FromDiscord | <Elegantbeef> One could make a much more usable range type using distincts 😄 |
| 03:13:43 | FromDiscord | <girvo> In reply to @Elegantbeef "Well the reason they're": Is there a simple example that shows this? |
| 03:14:19 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=OTujDpDYenkk |
| 03:14:29 | FromDiscord | <leorize> it's actually the reason why `len()` doesn't return `Natural` |
| 03:14:48 | FromDiscord | <Elegantbeef> You do not explicit convert, there is no tracking for defects, there is 0 information |
| 03:14:52 | FromDiscord | <leorize> if you `len() - 1` and `len()` is `0` you get a free defect |
| 03:15:07 | FromDiscord | <Elegantbeef> A hint, warning, or tracking should exist |
| 03:15:23 | FromDiscord | <Elegantbeef> Something to indicate what you're doing is unsafe and might result in a panic |
| 03:15:35 | FromDiscord | <Elegantbeef> Presently `std/times` makes you parse a string before parsing the string |
| 03:15:52 | FromDiscord | <Elegantbeef> I'm not even kidding 😄 |
| 03:16:05 | FromDiscord | <girvo> In reply to @Elegantbeef "I'm not even kidding": lmao really? |
| 03:16:19 | FromDiscord | <girvo> In reply to @leorize "if you `len() -": Oh goody lol |
| 03:16:34 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/RFCs/issues/493#issuecomment-1321777162 |
| 03:16:52 | FromDiscord | <girvo> But yeah I noticed that there wasn't really any errors being thrown around checking whether my value was in the correct range |
| 03:17:15 | FromDiscord | <girvo> Hence the questions. Makes sense now |
| 03:17:20 | FromDiscord | <Elegantbeef> Well there are static assurances and defects but nothing catchable 😄 |
| 03:17:51 | FromDiscord | <Elegantbeef> If a value is out of range you get a panic and have no static indication that your code relies on a range value |
| 03:19:13 | FromDiscord | <girvo> Yeah thats not ideal |
| 03:19:21 | FromDiscord | <girvo> We've honestly not really used them much at all |
| 03:20:53 | FromDiscord | <girvo> > We should embrace exceptions and forget about the idea of static checking runtime errors that are about arbitrary run-time resource constraint↵Funnily enough I sort of agree with Araq here, but the fact range[] exists and we do not have a dependant type system means it has to have as much static checking as we can get plus some runtime catchable errors. Theres no other way, other than going the proof-checker/Idris route |
| 03:22:35 | FromDiscord | <girvo> And I agree with @.elcritch that theres some funky inconsistency between whats a defect and what's an exception in the stdlib, which has tripped me up before |
| 03:23:52 | FromDiscord | <Elegantbeef> Don't agree with him it'll go straight to his head! |
| 03:24:09 | * | derpydoo quit (Ping timeout: 256 seconds) |
| 03:24:41 | FromDiscord | <girvo> Which one 😛 |
| 03:25:59 | FromDiscord | <Elegantbeef> He's not a hydra |
| 03:26:05 | FromDiscord | <Elegantbeef> We don't do lame dick jokes here |
| 03:26:21 | FromDiscord | <snick001> any DDS/ROS2 examples in nim? |
| 03:27:07 | FromDiscord | <Elegantbeef> https://github.com/Pylgos/rclnim exists |
| 03:27:43 | FromDiscord | <snick001> thanks! |
| 03:28:56 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
| 03:29:49 | FromDiscord | <girvo> In reply to @Elegantbeef "We don't do lame": No lol, I meant which one out of elcritch and araq 😂 |
| 03:29:58 | FromDiscord | <girvo> Get your mind out of the gutter 😉 |
| 03:34:45 | * | antranigv joined #nim |
| 03:35:35 | FromDiscord | <Elegantbeef> Never! |
| 03:43:51 | * | disso-peach joined #nim |
| 03:45:29 | * | SchweinDeBurg joined #nim |
| 03:49:09 | * | disso-peach quit (Quit: Leaving) |
| 03:57:08 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
| 03:58:06 | * | antranigv joined #nim |
| 04:22:01 | FromDiscord | <pmp_p> on 2.0.2 and git i get a bad scope with --exceptions:goto https://media.discordapp.net/attachments/371759389889003532/1202468873094434877/badscope.txt?ex=65cd9168&is=65bb1c68&hm=dbcee80aca355cbb6a5ecbbca4fecac69b9fe01b691c2d8b4664d3a5da356d4d& |
| 04:35:46 | FromDiscord | <pmp_p> i'm not sure that --cincludes is passed to the script when using --genScript:on |
| 04:36:36 | FromDiscord | <pmp_p> same for --clibdir for last liking line |
| 04:36:50 | FromDiscord | <graveflo> In reply to @pmp_p "i'm not sure that": that shouldn't be the issue. I do that sometimes |
| 04:37:17 | FromDiscord | <pmp_p> yeah it is a diffrent issue |
| 04:37:26 | FromDiscord | <pmp_p> i wanted to fix the scope and rebuild |
| 04:37:41 | FromDiscord | <pmp_p> that how i noticed missing include |
| 04:37:51 | FromDiscord | <pmp_p> (edit) "i wanted to fix the scope and rebuild ... " added "with the script" |
| 04:37:57 | FromDiscord | <pmp_p> (edit) "i wanted to fix the scope and rebuild with the script ... " added "from cache dir" |
| 04:39:08 | FromDiscord | <graveflo> those are search paths for the headers / modules. You'll still need to `importc` to get the include in the generated .c file if that is what you mean. If the first error only happens with `goto` it's prob a bug |
| 04:39:15 | FromDiscord | <graveflo> and I would open a github issue |
| 04:42:59 | FromDiscord | <graveflo> well you're right. I'm not seeing the `cincludes` in the generated script either. I could have sworn I just did that too |
| 04:43:18 | FromDiscord | <pmp_p> i cheated with --passC |
| 04:43:37 | FromDiscord | <graveflo> well I guess that's two bugs |
| 04:48:01 | FromDiscord | <pmp_p> hmm i guess C++ goto is different than from C |
| 04:51:49 | FromDiscord | <pmp_p> ha no i see alloc of result would be done after the jump |
| 04:51:56 | FromDiscord | <pmp_p> yeah big bug |
| 04:52:03 | * | khazakar joined #nim |
| 04:53:06 | FromDiscord | <pmp_p> sent a code paste, see https://play.nim-lang.org/#pasty=WnYixvhlMDBw |
| 05:08:15 | FromDiscord | <girvo> sent a code paste, see https://play.nim-lang.org/#pasty=MauUeFiDWRXN |
| 05:11:14 | FromDiscord | <girvo> sent a code paste, see https://play.nim-lang.org/#pasty=UPEIHKVzBelQ |
| 05:11:21 | FromDiscord | <Elegantbeef> Emit the `var` inside the template |
| 05:12:17 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=bTnSsbXNOjXT |
| 05:12:35 | FromDiscord | <Elegantbeef> Do not recal if `var (enabled, logLevel {.inject.}) = getSysLog()` would work |
| 05:13:55 | FromDiscord | <girvo> sent a code paste, see https://play.nim-lang.org/#pasty=bONtpqNCzSgP |
| 05:14:01 | FromDiscord | <girvo> Yay 🙂 thanks 🙂 |
| 05:15:09 | FromDiscord | <Elegantbeef> Why are you making `enabled` a var? |
| 05:16:02 | FromDiscord | <girvo> because the other dev used a tuple here and I hate bare index accesses when I forget the context |
| 05:16:14 | FromDiscord | <girvo> tbh I'd use an object instead for that reason |
| 05:16:20 | FromDiscord | <Elegantbeef> Sure but `let` exists |
| 05:16:21 | FromDiscord | <girvo> enabled can happily be a `let` |
| 05:16:22 | FromDiscord | <girvo> yeah |
| 05:17:55 | FromDiscord | <Elegantbeef> Eh I'd probably just use tuples as named return here |
| 05:18:03 | FromDiscord | <Elegantbeef> `tuple[isEnabled: bool, level: int]` 😄 |
| 05:18:18 | FromDiscord | <girvo> Oh I forgot that that is a thing! |
| 05:18:22 | FromDiscord | <Elegantbeef> But I generally dislike tuples aswell |
| 05:20:29 | * | jmdaemon quit (Ping timeout: 240 seconds) |
| 05:20:41 | FromDiscord | <girvo> I've not actually checked the implementation differences between tuples v simple objects with respect to the C output |
| 05:21:03 | FromDiscord | <girvo> I wonder if theres a "godbolt compiler explorer" but for Nim -> C output lol |
| 05:21:14 | FromDiscord | <Elegantbeef> There is but it's 1.6.x |
| 05:21:20 | FromDiscord | <Elegantbeef> They're both structs of course |
| 05:21:25 | FromDiscord | <Elegantbeef> Nim just structually types tuples |
| 05:21:58 | FromDiscord | <Elegantbeef> `type MyTup = tuple[a: int, b: int]; type MyTup2 = tuple[a: int, b: int]` implies `MyTup is MyTup2` and `MyTup is (int, int)` |
| 05:23:10 | FromDiscord | <girvo> Ah right I see |
| 05:23:27 | FromDiscord | <girvo> Tbf, we're still on 1.6.18 right now D: |
| 05:27:29 | FromDiscord | <girvo> Though we have a PR in place to get us on to 2.0 |
| 05:28:22 | FromDiscord | <Elegantbeef> 2.0.0 or 2.0.x? 😄 |
| 05:35:25 | FromDiscord | <girvo> haha whatever ends up being the latest. I think its on 2.0.2 |
| 05:36:38 | FromDiscord | <Elegantbeef> Do tell me how seeya works out in whatever you're doing though 😄 |
| 05:36:56 | FromDiscord | <girvo> Will do! |
| 05:37:00 | FromDiscord | <Elegantbeef> More than interested than making it better |
| 05:37:20 | FromDiscord | <girvo> Yeah absolutely. Being able to integrate back to C _nicely_ without a tonne of annoying handholding is so nice, I'll let ya know how we go 🙂 |
| 05:38:21 | FromDiscord | <Elegantbeef> I'd prefer it to be an external tool that would not require the macro at all, but alas I did not feel like dealing with the compiler API |
| 05:39:23 | FromDiscord | <Elegantbeef> The compiler API is really not made for human consumption afaict |
| 05:55:59 | FromDiscord | <girvo> yeah I remember that being true even way back when I first picked up Nim; I was trying to integrate with the compiler without just delegating out to the `nim` binary when I was writing an extension for Komodo IDE/Edit. That was... a mistake, on my part |
| 05:56:21 | FromDiscord | <Elegantbeef> Hey I did start it but I hide it on gitlab 😄 |
| 05:56:26 | FromDiscord | <girvo> smart 😛 |
| 05:56:42 | FromDiscord | <girvo> hides private bitbucket repos with all sorts of horrible projects |
| 05:59:10 | FromDiscord | <Elegantbeef> You'd imagine it'd just be a `compile(...): Context` 😄 |
| 05:59:18 | FromDiscord | <Elegantbeef> Buuuuut no it's a weird madness |
| 05:59:22 | FromDiscord | <girvo> If only lol |
| 06:35:00 | FromDiscord | <that_dude.> I'm trying to pass a callback to malebolgia threads, but I'm hitting a gc safety issue. I know what I'm doing is gc safe (nothing outside of the proc is touched) but I can't seem to get it passed as an argument. I've managed to throw `{.noSideEffect.}` on things to get past the gc issue, but now I'm getting `'toTask'ed function cannot have a parameter of nnkProcTy kind ` |
| 06:36:30 | FromDiscord | <Elegantbeef> You're not calling the procedure? |
| 06:37:16 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#pasty=vJwYunNCEKsN |
| 06:37:55 | FromDiscord | <Elegantbeef> annotated `matcher` with `{.nimcall.}`? |
| 06:38:01 | FromDiscord | <Elegantbeef> I doubt it'll change anything |
| 06:38:13 | FromDiscord | <Elegantbeef> I assume the malebolgia macro just prevents all proc types for whatever reason |
| 06:38:49 | FromDiscord | <that_dude.> No doesn't look like nimcall does anything |
| 06:39:18 | FromDiscord | <that_dude.> Got any ideas around it? I was looking into weave, but I think I want a lock style mechanism but it doesn't seem to provide one |
| 06:39:30 | FromDiscord | <Elegantbeef> `cast[pointer]` 😄 |
| 06:39:38 | FromDiscord | <that_dude.> (It's to I can update the progress of whats being worked on) |
| 06:40:26 | FromDiscord | <that_dude.> I tried to do `unsafeaddr` earlier but I got some issue where it said expression has no address. Maybe I can mess with it though |
| 06:41:10 | FromDiscord | <Elegantbeef> procs have no address |
| 06:41:27 | FromDiscord | <Elegantbeef> just `cast[pointer](matcher)` and on the `gen_temp` cast[yourProcType](matcher)\` |
| 06:41:33 | FromDiscord | <Elegantbeef> Well I fucked that up 😄 |
| 06:41:49 | FromDiscord | <nnsee> oh for fucks sake beef |
| 06:42:34 | FromDiscord | <Elegantbeef> Sorry not sorry |
| 06:50:50 | FromDiscord | <girvo> Can Testament be told to show the (echo'd) output of the various test modules without forcing it to fail the test with `output: ""` or something in the top `discard` block? |
| 06:52:01 | FromDiscord | <Elegantbeef> @that_dude. if you ever want to make a PR for this https://github.com/nim-lang/Nim/blob/devel/lib/std/tasks.nim#L180 needs a `of nnkProcTy` that checks whether it's a closure afaik |
| 06:56:50 | FromDiscord | <that_dude.> I'll take a look at it later, I'm going to have to shelf multithreading for now :( |
| 06:57:24 | FromDiscord | <girvo> 😦 |
| 06:59:23 | FromDiscord | <girvo> What does Malebolgia cancellation actually _do_? https://github.com/Araq/malebolgia?tab=readme-ov-file#cancelation↵↵Especially in an embedded context |
| 07:00:44 | FromDiscord | <girvo> sent a code paste, see https://play.nim-lang.org/#pasty=ILVLoFnhKJKO |
| 07:01:02 | FromDiscord | <that_dude.> I would assume it means stop crunching numbers after some condition is hit. I'd imagine it's useful for things like chess engines or path finding |
| 07:01:16 | FromDiscord | <girvo> Ah so it tries to use an Atomic to stop the spawned tasks from continuing |
| 07:01:39 | FromDiscord | <girvo> Which won't help if the spawned task is blocked forever (in an embedded context without pre-emption) |
| 07:02:08 | FromDiscord | <girvo> Damn, I was hoping I'd miss a possible approach to task/thread cancelling lol |
| 07:03:54 | FromDiscord | <girvo> This is really similar to the approach I partially built on top of FreeRTOS/Task, although this is cleaner than mine |
| 07:06:03 | FromDiscord | <girvo> In FreeRTOS land, the final approach I've ended up with is basically "ban the use of any blocking call that cannot take a timeout"; thankfully all the FreeRTOS primitives all do, and most of the Nim stdlib stuff we're using does. Mostly. Though I do wish Channel did lol |
| 07:14:26 | FromDiscord | <Elegantbeef> No clue I do not do multi threading so read the source 😛 |
| 07:14:27 | * | advesperacit joined #nim |
| 07:14:28 | FromDiscord | <Elegantbeef> Would you prefer to drop messages or garuentee they are sent? |
| 07:14:47 | FromDiscord | <girvo> drop messages. but really it's lower level than even that |
| 07:15:38 | FromDiscord | <Elegantbeef> I just mean you can make your own channels module that imports std/channels and omits exporting the `send` and `recv` procs |
| 07:15:55 | FromDiscord | <girvo> ah right I'm with you |
| 07:16:02 | FromDiscord | <girvo> I might have play with that |
| 07:17:32 | FromDiscord | <nnsee> In reply to @Elegantbeef "No clue I do": do you do single threading or no threading whatsoever? |
| 07:18:07 | FromDiscord | <Elegantbeef> Obviously single threaded code |
| 07:18:21 | * | PMunch joined #nim |
| 07:19:33 | * | rockcavera quit (Remote host closed the connection) |
| 07:21:39 | FromDiscord | <Elegantbeef> But that's mostly cause I do not write code for anything but fun |
| 07:57:34 | PMunch | How do you do no threading? |
| 07:57:50 | FromDiscord | <Elegantbeef> I don't right serious code |
| 07:58:04 | FromDiscord | <Elegantbeef> Plus the games I make do not need any offloading |
| 07:58:28 | PMunch | Nah I meant in reply to @Ras, he asked if you do single threaded or no threading |
| 07:58:45 | FromDiscord | <Elegantbeef> 99% it was a joke |
| 08:22:28 | FromDiscord | <nnsee> In reply to @PMunch "How do you do": compile once, run never |
| 08:25:00 | PMunch | Haha :P |
| 08:27:59 | FromDiscord | <nnsee> i saw someone at the gym this morning who really, really looked like pmunch |
| 08:28:02 | FromDiscord | <nnsee> had to do a double take |
| 08:28:43 | PMunch | Well, the fact that they where in a gym (and especially in the morning) would be enough to disqualify me.. |
| 08:29:31 | FromDiscord | <nnsee> lol |
| 08:46:08 | Amun-Ra | :P |
| 09:02:42 | advesperacit | Is there a good way to avoid "Connection was closed before full request has been made" when using std/httpclient? Been seeing it a lot on longer requests and/or long lived client instances |
| 09:05:00 | PMunch | Probably by avoiding long requests |
| 09:05:13 | PMunch | I guess this is the server shutting you down to avoid a slow loris or something like that |
| 09:08:59 | FromDiscord | <nnsee> long http requests timeout if the server hasn't received any data in a while |
| 09:12:35 | advesperacit | It's servers on a corporate network, I haven't heard of anyone else having problems and their requests should not differ from mine in execution time.. I'll try puppy instead, never had issues with curl |
| 09:14:29 | FromDiscord | <nnsee> are you using keepalive? |
| 09:15:00 | advesperacit | good question |
| 09:15:02 | FromDiscord | <nnsee> curl sends keepalive probes by default |
| 09:15:26 | PMunch | Wireshark is always good for stuff like this by the way |
| 09:15:30 | FromDiscord | <nnsee> also note that the http keepalive header and the tcp keepalive are different concepts |
| 09:15:38 | Amun-Ra | there can be (and usually is) a time limit for how long client connection can be kept alive |
| 09:18:16 | advesperacit | keepalives probably the issue |
| 09:18:52 | advesperacit | I'll lift the curl default and see if it improves |
| 09:19:59 | advesperacit | wireshark would be nice, but it's a nightmare working with these things at my company |
| 09:21:00 | PMunch | How so? You'd just be looking at the requests made from your script to the server |
| 09:21:30 | FromDiscord | <nnsee> probably can't install stuff on corporate machines |
| 09:21:47 | FromDiscord | <nnsee> wireshark requires libcap which requires admin to install (or root on linux) |
| 09:23:08 | * | termer quit (Quit: ZNC 1.7.5+deb4 - https://znc.in) |
| 09:27:04 | advesperacit | Limited ability to install stuff. I can't connect to the application I need to contact from my machine, need to test from a server, logging in to the server requires using mobile phone, the server disconnects automatically after some amount of time unless theres input/output |
| 09:27:27 | advesperacit | It's a lovely way to work, the best, you might say |
| 09:27:34 | advesperacit | If you want nothing to work right |
| 09:27:59 | advesperacit | (there's no test systems) |
| 09:28:03 | PMunch | That sounds pretty horrible |
| 09:28:16 | PMunch | But you're still allowed to use Nim? I guess that's worth something |
| 09:28:45 | FromDiscord | <nnsee> sounds like some banks i know |
| 09:29:08 | advesperacit | Yes that is a saving grace, I'm pretty free to choose as I wish |
| 09:30:43 | advesperacit | Oh, and the server is in a VM cluster that is overprovisioned and often freezes for several seconds, that is infuriating |
| 09:30:56 | * | termer joined #nim |
| 09:34:18 | advesperacit | Thanks for the HTTP keepalive tip btw, I wasn't aware that was a header. I should read up some more on that. |
| 09:44:02 | * | termer quit (Quit: ZNC 1.7.5+deb4 - https://znc.in) |
| 10:08:26 | * | azimut quit (Ping timeout: 255 seconds) |
| 10:21:03 | * | krux02 joined #nim |
| 10:50:59 | FromDiscord | <summarity> Is there a way to establish an incomplete struct in Nim? E.g. if there's a complex C type I want to access, but only need some fields, can I declare another field as "this is of size X, but I never need to access it", so that Nim still knows how big the entire struct is in memory. |
| 11:14:10 | Amun-Ra | summarity: there is incompleteStruct pragma |
| 11:14:25 | Amun-Ra | but it's used for opaque C types |
| 11:15:00 | Amun-Ra | as long as it's returned from C as pointer to such object, you're fine |
| 11:21:08 | Amun-Ra | otherwise you have to add big enough padding, but it's meh |
| 11:33:44 | * | termer joined #nim |
| 12:01:46 | * | PMunch quit (Ping timeout: 264 seconds) |
| 12:02:17 | * | PMunch joined #nim |
| 12:29:35 | NimEventer | New thread by Solo-Leveler: What would happen if a time traveler took Nim source code to the 70s or 80s or 90s?, see https://forum.nim-lang.org/t/10937 |
| 13:00:30 | FromDiscord | <pmp_p> is there a way to change the exe runner from cmdline eg node for .js / some wasi interpreter for wasi ? |
| 13:20:25 | * | rockcavera joined #nim |
| 13:34:12 | NimEventer | New thread by Solo-Leveler: How do Nim exceptions work?, see https://forum.nim-lang.org/t/10938 |
| 13:51:32 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
| 13:52:01 | * | antranigv joined #nim |
| 13:52:50 | FromDiscord | <nnsee> lol, bootstrapping nim results in a lot of these https://media.discordapp.net/attachments/371759389889003532/1202612527599587348/image.png?ex=65ce1732&is=65bba232&hm=67efc1e411f0856ca20edeabb7735924e87eb400ef3761f83b3eb46a59a5f4d3& |
| 13:55:08 | * | azimut joined #nim |
| 13:59:13 | FromDiscord | <Robyn [She/Her]> Nimph should be ran on it \~\~it already was I think tho\~\~ |
| 14:00:37 | * | PMunch quit (Read error: Connection reset by peer) |
| 14:00:47 | * | PMunch joined #nim |
| 14:19:03 | * | PMunch_ joined #nim |
| 14:21:54 | * | PMunch quit (Ping timeout: 260 seconds) |
| 14:57:49 | FromDiscord | <pmunch> In reply to @Robyn "Nimph should be ran": It was done as a test, it hasn't been comited upstream |
| 14:58:04 | FromDiscord | <pmunch> (edit) "comited" => "committed" |
| 14:58:09 | FromDiscord | <nnsee> hm |
| 14:58:20 | FromDiscord | <nnsee> how would one statically build nim using koch? |
| 14:58:43 | FromDiscord | <nnsee> it doesn't seem to be accepting my flags |
| 14:58:50 | FromDiscord | <pmunch> Throw the static switches into the Nim config file? |
| 14:58:59 | FromDiscord | <nnsee> fair enough |
| 15:04:43 | FromDiscord | <Robyn [She/Her]> Ah fair↵(@pmunch) |
| 15:04:43 | FromDiscord | <masterplayz.> Sup guys |
| 15:12:49 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
| 15:15:42 | * | Lord_Nightmare joined #nim |
| 15:16:13 | FromDiscord | <saint.___.> In reply to @Robyn "Ah fair (<@392962235737047041>)": Are you on IRC now? |
| 15:16:25 | FromDiscord | <saint.___.> Or matrix? |
| 15:18:20 | FromDiscord | <Robyn [She/Her]> Wait converters for different measurement types are an actual usecase |
| 15:18:34 | FromDiscord | <Robyn [She/Her]> In reply to @saint.___. "Or matrix?": Matrix, but I switch between that and disc a lot :p |
| 15:19:13 | FromDiscord | <nnsee> In reply to @masterplayz. "Sup guys": hello |
| 15:24:15 | * | PMunch_ quit (Quit: Leaving) |
| 16:26:23 | * | PotentialUser-25 joined #nim |
| 16:27:23 | * | PotentialUser-93 joined #nim |
| 16:27:30 | * | PotentialUser-93 quit (Client Quit) |
| 16:34:29 | * | PotentialUser-25 quit (Quit: Client closed) |
| 16:34:37 | * | PotentialUser-25 joined #nim |
| 16:34:48 | * | PotentialUser-78 joined #nim |
| 16:43:28 | * | PotentialUser-25 quit (Quit: Client closed) |
| 16:43:39 | * | jmdaemon joined #nim |
| 16:46:56 | * | tiorock joined #nim |
| 16:46:57 | * | rockcavera quit (Killed (zinc.libera.chat (Nickname regained by services))) |
| 16:46:57 | * | tiorock is now known as rockcavera |
| 16:59:10 | FromDiscord | <saint.___.> In reply to @chronos.vitaqua "Matrix, but I switch": Ah gotcha |
| 17:00:28 | * | jmdaemon quit (Ping timeout: 268 seconds) |
| 17:06:44 | * | SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev) |
| 17:51:20 | * | jmdaemon joined #nim |
| 18:41:52 | * | PotentialUser-78 quit (Quit: Client closed) |
| 18:49:57 | * | SchweinDeBurg joined #nim |
| 19:16:31 | * | jmdaemon quit (Ping timeout: 255 seconds) |
| 19:56:54 | * | jmdaemon joined #nim |
| 20:33:50 | * | jmdaemon quit (Ping timeout: 260 seconds) |
| 22:19:55 | FromDiscord | <Robyn [She/Her]> What's the `{.acyclic.}` pragma for? |
| 22:20:26 | FromDiscord | <Elegantbeef> Disabling Orc on objects that can be cyclic but you know won't be |
| 22:21:09 | FromDiscord | <Robyn [She/Her]> Ah alright |
| 22:21:54 | FromDiscord | <Robyn [She/Her]> Also for a 'signed byte', should I use `int8` or use `byte` anyway? |
| 22:22:05 | FromDiscord | <Elegantbeef> One of those is not signed |
| 22:22:29 | FromDiscord | <Robyn [She/Her]> Yeah I know `byte` isn't signed, that's why I'm asking what's better to use :p |
| 22:22:36 | FromDiscord | <Elegantbeef> It wholly depends on what you're doing but it's suggested to use all the `int` variants and only use unsigned if you want the behaviour of a unsigned that can overflow |
| 22:23:14 | FromDiscord | <Robyn [She/Her]> Alright, good to know |
| 22:24:43 | FromDiscord | <Robyn [She/Her]> Modified UTF-8 and UTF-16 seem like something with a place only in Java |
| 22:25:44 | FromDiscord | <Elegantbeef> "Modified UTF"... ah yes standard |
| 22:26:23 | FromDiscord | <Robyn [She/Her]> https://docs.oracle.com/javase/8/docs/api/java/io/DataInput.html#modified-utf-8 need to parse this in Nim... Gonna hope I can find a lib for it later |
| 22:26:56 | FromDiscord | <Elegantbeef> "Standard m4 0.3 bolts that are modified to be 20tpi" |
| 22:27:33 | FromDiscord | <Robyn [She/Her]> Pain |
| 22:42:25 | * | advesperacit quit () |
| 23:07:55 | FromDiscord | <.bobbbob> In reply to @Elegantbeef "Disabling Orc on objects": still not entirely clear on what cyclic types even are, and what happens if you use arc with them? |
| 23:09:54 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=emUDvitzPIGy |
| 23:10:53 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=MPUwLJvABkrj |
| 23:11:14 | FromDiscord | <Robyn [She/Her]> So it can cause memory leaks since it'll never be collected |
| 23:11:30 | FromDiscord | <Robyn [She/Her]> That's why you use `orc`, since it can detect and collect cycles |
| 23:12:00 | FromDiscord | <.bobbbob> I see, thanks |
| 23:12:13 | FromDiscord | <Robyn [She/Her]> `asyncdispatch` is an actual library that has a cyclic references I believe |
| 23:12:20 | FromDiscord | <Robyn [She/Her]> In reply to @.bobbbob "I see, thanks": No worries! |
| 23:12:24 | FromDiscord | <.bobbbob> So kind of like algebraic types in ie haskell? |
| 23:12:37 | FromDiscord | <Robyn [She/Her]> I don't know Haskell :P↵@odexine, is this true? |
| 23:47:05 | * | xet7 quit (Ping timeout: 260 seconds) |
| 23:51:32 | * | khazakar quit (Quit: Connection closed for inactivity) |
| 23:58:43 | FromDiscord | <Elegantbeef> They leak↵(@.bobbbob) |