02:55:28 | * | lucasta quit (Quit: Leaving) |
04:54:14 | FromDiscord | <morgan (ping with reply)> is there something like `std::byteswap` in nim? |
04:58:10 | FromDiscord | <morgan (ping with reply)> i might just do the slight increase in ops for my existing bit hacks to allow it to operate in the reverse order |
04:59:39 | FromDiscord | <Elegantbeef> std/endians |
05:06:30 | FromDiscord | <morgan (ping with reply)> do reactions get forwarded? if not, π |
05:24:06 | * | Onionhammer quit (Quit: Ping timeout (120 seconds)) |
05:24:22 | * | Onionhammer joined #nim |
05:28:49 | * | cornfeedhobo quit (Quit: ZNC - https://znc.in) |
05:29:33 | * | tokyovigilante quit (Ping timeout: 245 seconds) |
05:29:48 | * | tokyovigilante joined #nim |
05:34:33 | * | cornfeedhobo joined #nim |
05:41:00 | FromDiscord | <Elegantbeef> They do not |
05:41:59 | FromDiscord | <.tokyovigilante> @pmunch did you have any more thoughts on those issues with Futhark and pipewire? Specifically `futhark.nim(315, 33) Error: bitsize needs to be positive` after the initial binding is generated. |
05:49:04 | FromDiscord | <morgan (ping with reply)> well i ended up changing the bit hacks instead anyways, which works. it's like one more mult, two more ands, and one or, tho maybe the swapendianx would get compiled down to one op and be faster idk |
05:49:21 | FromDiscord | <morgan (ping with reply)> i can perf test it later, ill leave myself a note |
05:53:34 | FromDiscord | <morgan (ping with reply)> i was partly curious to see how it would turn out with the changes it needed |
05:54:52 | FromDiscord | <morgan (ping with reply)> basically, partway thru it multiplies an int with 0xFF, to make all the bits a set of 8, but that only works if there are 7 0s in between each, what i had before had 8, this had 6, so it would not work correctly, they would overlap and such |
05:55:20 | FromDiscord | <morgan (ping with reply)> so my change was to split it into even and odd bytes and do those separately before combining back together |
05:56:23 | FromDiscord | <morgan (ping with reply)> converting 8 bits to 0u8/1u8 per bit was a neat challenge to code up |
06:30:31 | * | SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev) |
06:30:53 | * | SchweinDeBurg joined #nim |
08:48:26 | * | coldfeet joined #nim |
08:52:21 | FromDiscord | <bubbly_avocado_86424> sent a long message, see https://pasty.ee/AdtyXKrK |
08:52:51 | FromDiscord | <bubbly_avocado_86424> (edit) "https://pasty.ee/GkuNKYNM" => "https://pasty.ee/iwXvqkFz" |
08:53:43 | FromDiscord | <bubbly_avocado_86424> (edit) "https://pasty.ee/MctbvHOR" => "https://pasty.ee/uOxldutw" |
08:54:55 | Amun-Ra | kind is of enum type |
08:55:16 | Amun-Ra | add "else: discard" |
08:56:12 | FromDiscord | <bubbly_avocado_86424> In reply to @Amun-Ra "kind is of enum": figured out the else:discard after posting πβ΅β΅so i have to read up on what enum does |
08:57:46 | Amun-Ra | this behavior is not only related to enums |
08:58:10 | FromDiscord | <bubbly_avocado_86424> In reply to @Amun-Ra "this behavior is not": oh, ahβ΅β΅can you point me somewhere ? |
08:58:32 | Amun-Ra | you have to cover all possible values explicitely in nim |
08:58:35 | FromDiscord | <k0ts> https://nim-lang.org/docs/manual.html#statements-and-expressions-case-statement |
09:07:48 | FromDiscord | <bubbly_avocado_86424> In reply to @k0ts "https://nim-lang.org/docs/manual.html#statements-an": makes some sense now |
09:14:19 | FromDiscord | <pmunch> In reply to @.tokyovigilante "<@392962235737047041> did you have": I haven't had time to look at it unfortunately. But it's a very strange error. Nim grabs the bitsize from Clang, so it should always be correct |
09:14:38 | FromDiscord | <bubbly_avocado_86424> sent a long message, see https://pasty.ee/FcPeVISt |
09:15:03 | FromDiscord | <pmunch> And when I wrapped it on my machine I didn't get that error, which makes it even harder to debug |
09:18:17 | FromDiscord | <bubbly_avocado_86424> In reply to @pmunch "And when I wrapped": same OS on both machine ? |
09:21:39 | FromDiscord | <k0ts> In reply to @bubbly_avocado_86424 "because i've tried and": "mainarray" and "firstarray" are keys that exist on a JsonNode of kind = JObject so you could grab them while iterating over its `pairs` before the recursive call |
09:53:14 | FromDiscord | <pmunch> In reply to @bubbly_avocado_86424 "same OS on both": Gotta be Linux at least, but no idea what distro they where using |
10:01:14 | FromDiscord | <bubbly_avocado_86424> Thanks for the help to @k0ts and others, threw away all code and started over, almost done now π |
10:03:21 | FromDiscord | <bubbly_avocado_86424> In reply to @pmunch "Gotta be Linux at": i remember running into similar awkwardness, proved to be due to not one reason, once was difference in libc ( glibc vs musl) causing compilation to act up |
10:06:26 | FromDiscord | <albassort> how can i get the type of an option |
10:06:45 | FromDiscord | <albassort> option[string] get T |
10:06:49 | FromDiscord | <albassort> (edit) "T" => "string" |
10:07:58 | FromDiscord | <k0ts> sent a code paste, see https://play.nim-lang.org/#pasty=WWJJvwDw |
10:08:28 | FromDiscord | <albassort> shouldn't that return a proc? |
10:08:49 | FromDiscord | <k0ts> no |
10:46:04 | FromDiscord | <bubbly_avocado_86424> woah, impressed, now the json walk is working i notice the Nim std/json is at least as fast as jq to parse a .json of 26MB |
10:59:52 | FromDiscord | <pmunch> In reply to @bubbly_avocado_86424 "woah, impressed, now the": Now try using one of the fast ones π |
11:00:33 | FromDiscord | <pmunch> In reply to @bubbly_avocado_86424 "i remember running into": Hmm, could be a binding with clang, building with gcc issue |
11:01:19 | FromDiscord | <pmunch> In reply to @.tokyovigilante "<@392962235737047041> did you have": Could you put the wrap output up on pasty.ee or something? |
11:01:27 | FromDiscord | <bubbly_avocado_86424> In reply to @pmunch "Now try using one": good enough for me π β΅when i stopped writing output to screen it basically returned an instant count of all keys π |
11:20:00 | FromDiscord | <bubbly_avocado_86424> is there a library with Nim which can enable an application to have UI for either or all of console, GUI, web (not wasm only) ? |
12:40:34 | FromDiscord | <double_spiral> Is there an echo statement I can use that would work on nodes and such? Im looking for some sort of print debugging |
13:08:14 | FromDiscord | <odexine> `macros.dumptree` |
13:09:04 | FromDiscord | <odexine> actually not sure if that works with nodes. `macros.treerepr` then printing that is more appropriate |
13:59:26 | * | lucasta joined #nim |
15:43:54 | * | coldfeet quit (Remote host closed the connection) |
17:35:43 | * | coldfeet joined #nim |
17:59:59 | * | coldfeet quit (Remote host closed the connection) |
20:07:13 | FromDiscord | <.tokyovigilante> In reply to @pmunch "Could you put the": Sure, https://gist.github.com/tokyovigilante/6ff6be154d79a9d9287f0523dec9d18c |
20:09:01 | FromDiscord | <.tokyovigilante> As noted on the github issue, working around it by just deleting the anonymous padding seems to work fine, this would potentially be an issue where time_t isn't 64-bit (ie on 32 bit glibc systems) but not an issue on musl where time_t is always 64 bit. |
20:16:04 | FromDiscord | <.tokyovigilante> My understanding of the timespec definition in alltypes.h is that it's generating a zero-bit type because (BYTE_ORDER is defined as 1234, which always evaluates to zero when compared with 4321: `int :8(sizeof(time_t)-sizeof(long))(BYTE_ORDER==4321);` |
20:16:20 | FromDiscord | <.tokyovigilante> (edit) "(BYTE_ORDER" => "`BYTE_ORDER`" |
20:16:50 | FromDiscord | <.tokyovigilante> (edit) "My understanding of the timespec definition in alltypes.h is that it's generating" => "sent" | "zero-bit type because `BYTE_ORDER` is defined as 1234, which always evaluates to zero when compared with 4321: `int :8(sizeof(time_t)-sizeof(long))(BYTE_ORDER==4321);`" => "code paste, see https://play.nim-lang.org/#pasty=cUWIQcqd" |
20:21:08 | FromDiscord | <.tokyovigilante> Presumably nim then doesn't allow that |
20:25:36 | Amun-Ra | that's fugly |
21:08:29 | FromDiscord | <albassort> how can i check if a type is an option type |
21:22:52 | FromDiscord | <fabric.input_output> In reply to @albassort "how can i check": try `compiles(TheType.T) and TheType is Option[TheType.T]`? |
21:24:59 | FromDiscord | <albassort> In reply to @fabric.input_output "try `compiles(TheType.T) and TheType": how do i through an exception at compile time? |
21:26:41 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#pasty=qwPhsEft |
21:26:46 | FromDiscord | <albassort> this is a tad cursed |
21:29:21 | FromDiscord | <fabric.input_output> sent a code paste, see https://play.nim-lang.org/#pasty=vXwVLsjM |
21:29:49 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#pasty=uYFlZtNd |
21:30:06 | FromDiscord | <albassort> i decided against it |
21:31:17 | FromDiscord | <albassort> im not really thinkin about putting this on nimble |
21:31:31 | FromDiscord | <albassort> (edit) "im not really thinkin about putting this on nimble ... " added "so being forgiving isn't too important" |
21:31:42 | FromDiscord | <fabric.input_output> sent a code paste, see https://play.nim-lang.org/#pasty=OhwUIaMD |
21:32:13 | FromDiscord | <fabric.input_output> or maybe call it `OptionMonad` π |
21:32:18 | FromDiscord | <albassort> i dont think many are interested in my shitty orm and my api framework |
21:32:43 | FromDiscord | <fabric.input_output> I just think this is less janky |
21:33:04 | FromDiscord | <fabric.input_output> besides the when thing I showed doesn't really work |
21:33:22 | FromDiscord | <fabric.input_output> you have to put the rhs of the `and` in an inner `when` |
21:33:57 | FromDiscord | <albassort> its fine it breaks regardless lol |
21:34:05 | FromDiscord | <albassort> i'll fix it alter |
21:34:24 | FromDiscord | <Elegantbeef> `when y is Option`? |
21:35:03 | FromDiscord | <fabric.input_output> oh does that work? |
21:35:09 | FromDiscord | <Elegantbeef> Yes |
21:35:24 | FromDiscord | <Elegantbeef> Generic types have a generic typeclass |
21:35:33 | FromDiscord | <fabric.input_output> maybe you could `[T; O: Option[T]]` in the generic args |
21:35:34 | FromDiscord | <albassort> it does work |
21:35:35 | FromDiscord | <albassort> (edit) "work" => "work, yes" |
21:36:25 | FromDiscord | <Elegantbeef> `error: fmt"field {x} of {T} is not an Option type".}` |
21:37:57 | FromDiscord | <Elegantbeef> You could use a macro to emit an error to point to the field sym |
21:38:13 | FromDiscord | <fabric.input_output> well this works https://play.nim-lang.org/#pasty=HwhrrlDw |
21:38:29 | FromDiscord | <fabric.input_output> idk better to use them generic constraints etc |
21:39:23 | FromDiscord | <Elegantbeef> `_: typedesc[auto]` heh just `typedesc` |
21:39:40 | FromDiscord | <fabric.input_output> I did `auto` first but it didn't work with types |
21:39:51 | FromDiscord | <fabric.input_output> so I put that in a typedesc |
21:40:47 | FromDiscord | <fabric.input_output> i wish there was a way to borrow everything for distinct types |
21:45:11 | FromDiscord | <fabric.input_output> wonder if my issue of concepts not working has been fixed |
21:45:43 | FromDiscord | <Elegantbeef> Probably not |
21:45:52 | FromDiscord | <Elegantbeef> New concepts are even less functional than old style |
21:52:19 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#pasty=anZZKNQk is a somewhat nice error message |
21:53:05 | FromDiscord | <Elegantbeef> ` error(fmt"Expected 'Option[{t.getTypeInst()}]' for '{$origSym}', but got '{t.getTypeInst()}'", origSym)` makes it even more readable |