<< 02-11-2024 >>

02:55:28*lucasta quit (Quit: Leaving)
04:54:14FromDiscord<morgan (ping with reply)> is there something like `std::byteswap` in nim?
04:58:10FromDiscord<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:39FromDiscord<Elegantbeef> std/endians
05:06:30FromDiscord<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:00FromDiscord<Elegantbeef> They do not
05:41:59FromDiscord<.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:04FromDiscord<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:21FromDiscord<morgan (ping with reply)> i can perf test it later, ill leave myself a note
05:53:34FromDiscord<morgan (ping with reply)> i was partly curious to see how it would turn out with the changes it needed
05:54:52FromDiscord<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:20FromDiscord<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:23FromDiscord<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:21FromDiscord<bubbly_avocado_86424> sent a long message, see https://pasty.ee/AdtyXKrK
08:52:51FromDiscord<bubbly_avocado_86424> (edit) "https://pasty.ee/GkuNKYNM" => "https://pasty.ee/iwXvqkFz"
08:53:43FromDiscord<bubbly_avocado_86424> (edit) "https://pasty.ee/MctbvHOR" => "https://pasty.ee/uOxldutw"
08:54:55Amun-Rakind is of enum type
08:55:16Amun-Raadd "else: discard"
08:56:12FromDiscord<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:46Amun-Rathis behavior is not only related to enums
08:58:10FromDiscord<bubbly_avocado_86424> In reply to @Amun-Ra "this behavior is not": oh, ah↡↡can you point me somewhere ?
08:58:32Amun-Rayou have to cover all possible values explicitely in nim
08:58:35FromDiscord<k0ts> https://nim-lang.org/docs/manual.html#statements-and-expressions-case-statement
09:07:48FromDiscord<bubbly_avocado_86424> In reply to @k0ts "https://nim-lang.org/docs/manual.html#statements-an": makes some sense now
09:14:19FromDiscord<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:38FromDiscord<bubbly_avocado_86424> sent a long message, see https://pasty.ee/FcPeVISt
09:15:03FromDiscord<pmunch> And when I wrapped it on my machine I didn't get that error, which makes it even harder to debug
09:18:17FromDiscord<bubbly_avocado_86424> In reply to @pmunch "And when I wrapped": same OS on both machine ?
09:21:39FromDiscord<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:14FromDiscord<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:14FromDiscord<bubbly_avocado_86424> Thanks for the help to @k0ts and others, threw away all code and started over, almost done now πŸ˜„
10:03:21FromDiscord<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:26FromDiscord<albassort> how can i get the type of an option
10:06:45FromDiscord<albassort> option[string] get T
10:06:49FromDiscord<albassort> (edit) "T" => "string"
10:07:58FromDiscord<k0ts> sent a code paste, see https://play.nim-lang.org/#pasty=WWJJvwDw
10:08:28FromDiscord<albassort> shouldn't that return a proc?
10:08:49FromDiscord<k0ts> no
10:46:04FromDiscord<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:52FromDiscord<pmunch> In reply to @bubbly_avocado_86424 "woah, impressed, now the": Now try using one of the fast ones πŸ˜‰
11:00:33FromDiscord<pmunch> In reply to @bubbly_avocado_86424 "i remember running into": Hmm, could be a binding with clang, building with gcc issue
11:01:19FromDiscord<pmunch> In reply to @.tokyovigilante "<@392962235737047041> did you have": Could you put the wrap output up on pasty.ee or something?
11:01:27FromDiscord<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:00FromDiscord<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:34FromDiscord<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:14FromDiscord<odexine> `macros.dumptree`
13:09:04FromDiscord<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:13FromDiscord<.tokyovigilante> In reply to @pmunch "Could you put the": Sure, https://gist.github.com/tokyovigilante/6ff6be154d79a9d9287f0523dec9d18c
20:09:01FromDiscord<.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:04FromDiscord<.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:20FromDiscord<.tokyovigilante> (edit) "(BYTE_ORDER" => "`BYTE_ORDER`"
20:16:50FromDiscord<.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:08FromDiscord<.tokyovigilante> Presumably nim then doesn't allow that
20:25:36Amun-Rathat's fugly
21:08:29FromDiscord<albassort> how can i check if a type is an option type
21:22:52FromDiscord<fabric.input_output> In reply to @albassort "how can i check": try `compiles(TheType.T) and TheType is Option[TheType.T]`?
21:24:59FromDiscord<albassort> In reply to @fabric.input_output "try `compiles(TheType.T) and TheType": how do i through an exception at compile time?
21:26:41FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=qwPhsEft
21:26:46FromDiscord<albassort> this is a tad cursed
21:29:21FromDiscord<fabric.input_output> sent a code paste, see https://play.nim-lang.org/#pasty=vXwVLsjM
21:29:49FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=uYFlZtNd
21:30:06FromDiscord<albassort> i decided against it
21:31:17FromDiscord<albassort> im not really thinkin about putting this on nimble
21:31:31FromDiscord<albassort> (edit) "im not really thinkin about putting this on nimble ... " added "so being forgiving isn't too important"
21:31:42FromDiscord<fabric.input_output> sent a code paste, see https://play.nim-lang.org/#pasty=OhwUIaMD
21:32:13FromDiscord<fabric.input_output> or maybe call it `OptionMonad` πŸ˜„
21:32:18FromDiscord<albassort> i dont think many are interested in my shitty orm and my api framework
21:32:43FromDiscord<fabric.input_output> I just think this is less janky
21:33:04FromDiscord<fabric.input_output> besides the when thing I showed doesn't really work
21:33:22FromDiscord<fabric.input_output> you have to put the rhs of the `and` in an inner `when`
21:33:57FromDiscord<albassort> its fine it breaks regardless lol
21:34:05FromDiscord<albassort> i'll fix it alter
21:34:24FromDiscord<Elegantbeef> `when y is Option`?
21:35:03FromDiscord<fabric.input_output> oh does that work?
21:35:09FromDiscord<Elegantbeef> Yes
21:35:24FromDiscord<Elegantbeef> Generic types have a generic typeclass
21:35:33FromDiscord<fabric.input_output> maybe you could `[T; O: Option[T]]` in the generic args
21:35:34FromDiscord<albassort> it does work
21:35:35FromDiscord<albassort> (edit) "work" => "work, yes"
21:36:25FromDiscord<Elegantbeef> `error: fmt"field {x} of {T} is not an Option type".}`
21:37:57FromDiscord<Elegantbeef> You could use a macro to emit an error to point to the field sym
21:38:13FromDiscord<fabric.input_output> well this works https://play.nim-lang.org/#pasty=HwhrrlDw
21:38:29FromDiscord<fabric.input_output> idk better to use them generic constraints etc
21:39:23FromDiscord<Elegantbeef> `_: typedesc[auto]` heh just `typedesc`
21:39:40FromDiscord<fabric.input_output> I did `auto` first but it didn't work with types
21:39:51FromDiscord<fabric.input_output> so I put that in a typedesc
21:40:47FromDiscord<fabric.input_output> i wish there was a way to borrow everything for distinct types
21:45:11FromDiscord<fabric.input_output> wonder if my issue of concepts not working has been fixed
21:45:43FromDiscord<Elegantbeef> Probably not
21:45:52FromDiscord<Elegantbeef> New concepts are even less functional than old style
21:52:19FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=anZZKNQk is a somewhat nice error message
21:53:05FromDiscord<Elegantbeef> ` error(fmt"Expected 'Option[{t.getTypeInst()}]' for '{$origSym}', but got '{t.getTypeInst()}'", origSym)` makes it even more readable