00:00:04 | FromDiscord | <sOkam! 🫐> In reply to @asviest "ok, is the penultimate": https://github.com/heysokam/slate/blob/master/src/slate/nimc.nim↵you can get an answer to this question by inspecting some test code with this set of tools |
00:01:56 | FromDiscord | <sOkam! 🫐> I know some fields in the AST are kept empty in some cases, as they are not used for that specific thing↵but if you inspect the raw AST, before semantics, you will be able to see how the ast as it is understood by the parser↵unknown fields make a lot more sense in the raw ast, as the syntax itself supports more things than Nim uses |
00:02:16 | FromDiscord | <sOkam! 🫐> (edit) "thing↵but" => "thing but used in others↵but" |
00:02:19 | FromDiscord | <Elegantbeef> You can just use `macros.dumptree` |
00:02:42 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "You can just use": that doesn't show the syntax of illegal code, does it? |
00:02:54 | FromDiscord | <Elegantbeef> dumptree shows the ast of any parsable code |
00:03:08 | FromDiscord | <Elegantbeef> it's practically `dumpTree(t: untyped) = echo t.repr` |
00:03:11 | FromDiscord | <sOkam! 🫐> oh well, then that's much easier to inspect, yeah |
00:03:30 | FromDiscord | <Elegantbeef> `t.treerepr`\ |
00:03:45 | FromDiscord | <Elegantbeef> I say practically but `macro dumpTree(s: untyped): untyped = echo s.treeRepr` is the actual implementation |
00:05:11 | FromDiscord | <sOkam! 🫐> the functions I linked mirror `treeRepr` behavior, so they should be practically equivalent then |
00:11:30 | FromDiscord | <Robyn [She/Her]> The temptation to work on an alternative docs layout for Nim |
00:11:32 | FromDiscord | <Robyn [She/Her]> Hmmm |
00:12:59 | FromDiscord | <Elegantbeef> Docgen is only a few thousuand lines of code, how hard could it be to modify 😛 |
00:15:03 | FromDiscord | <Robyn [She/Her]> Indeed! |
00:17:09 | FromDiscord | <Robyn [She/Her]> I wonder if doing it from scratch is worth it :P |
00:17:11 | FromDiscord | <Robyn [She/Her]> Probably not |
00:59:52 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
01:01:48 | * | jmdaemon joined #nim |
01:21:33 | FromDiscord | <Robyn [She/Her]> I wonder if there's a use for converting the Nim AST to a JSON file |
01:25:03 | FromDiscord | <Elegantbeef> Slow and ugly IC |
01:44:13 | FromDiscord | <Robyn [She/Her]> Lol true |
01:48:56 | * | azimut quit (Ping timeout: 255 seconds) |
01:59:38 | FromDiscord | <Robyn [She/Her]> Nim AST to MC datapacks |
01:59:41 | FromDiscord | <Robyn [She/Her]> That'd be horrific |
02:13:26 | FromDiscord | <sOkam! 🫐> In reply to @chronos.vitaqua "I wonder if there's": YES |
02:14:50 | FromDiscord | <sOkam! 🫐> not being forced to use nim-rst formatting, or regular markdown, and not generating docs with nim's docgen setup↵i was trying to create some form of custom documentation generator that had the features that I wanted, but its hardlocked behind missing that feature |
02:16:21 | FromDiscord | <Robyn [She/Her]> Fair |
02:19:59 | FromDiscord | <sOkam! 🫐> @Robyn [She/Her] https://discord.com/channels/371759389889003530/371759389889003532/1192072359629303870 |
02:20:06 | FromDiscord | <sOkam! 🫐> (edit) "@Robyn [She/Her] ... https://discord.com/channels/371759389889003530/371759389889003532/1192072359629303870" added "See:" |
02:21:19 | FromDiscord | <MDuardo> I would like Nim docgen to let you style it like you can in Pandoc or R Markdown |
02:21:27 | FromDiscord | <Robyn [She/Her]> That makes sense |
02:24:21 | FromDiscord | <sOkam! 🫐> In reply to @chronos.vitaqua "I wonder if there's": I think this shouldn't be too hard to do with the raw parser/ast↵I thought about it before, but I just never find the time. Too much todo tasks in my list 😔 |
02:24:36 | FromDiscord | <sOkam! 🫐> (edit) "much" => "many" |
02:25:40 | FromDiscord | <Robyn [She/Her]> Yeah fair |
02:25:48 | FromDiscord | <Robyn [She/Her]> I'm thinking about it now :p |
02:27:48 | FromDiscord | <sOkam! 🫐> @ping me if you make it. because I really really want that feature |
02:38:56 | FromDiscord | <Robyn [She/Her]> Fair, I'll try to remember if I do do something with that |
02:43:01 | FromDiscord | <intellij_gamer> In reply to @chronos.vitaqua "The temptation to work": You can make a `nimdoc.cfg` file in your project and change some settings to change most of the layout.↵https://github.com/nim-lang/Nim/blob/devel/config/nimdoc.cfg↵↵Or use use the jsondoc output and build your html from that |
02:46:04 | FromDiscord | <Robyn [She/Her]> Ooh neat |
02:52:07 | FromDiscord | <sOkam! 🫐> In reply to @intellij_gamer "You can make a": much closer to what they are thinking of yeah. ty amadan ✍️ |
02:56:26 | FromDiscord | <Robyn [She/Her]> I was thinking of using the AST to be able to reference symbols from other modules honestly |
02:56:48 | FromDiscord | <Robyn [She/Her]> PMunch aaaand someone else I can't remember was talking about it as a possible improvement for the JSON docs |
03:17:21 | * | SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev) |
03:17:52 | * | SchweinDeBurg joined #nim |
04:33:02 | * | Zevv quit (Ping timeout: 268 seconds) |
05:17:20 | * | Jjp137 quit (Quit: Leaving) |
05:17:46 | * | Jjp137 joined #nim |
05:23:17 | * | Zevv joined #nim |
05:42:34 | * | rockcavera quit (Remote host closed the connection) |
05:42:37 | * | junaid_ joined #nim |
06:23:56 | * | junaid_ quit (Remote host closed the connection) |
07:00:02 | FromDiscord | <Elegantbeef> Oh jeez |
07:00:09 | FromDiscord | <fosster> AHAHAH sorry for the long copy past but it's a lot of code |
07:00:38 | FromDiscord | <fosster> if you can suggest me a pastebin I'd be glad to paste it there |
07:00:46 | FromDiscord | <Elegantbeef> I mean the playground has one |
07:00:53 | FromDiscord | <Elegantbeef> I'd also suggest you stop using macros |
07:00:57 | * | azimut joined #nim |
07:01:03 | FromDiscord | <fosster> why? |
07:01:08 | FromDiscord | <Elegantbeef> Cause that's not a macro |
07:01:09 | FromDiscord | <Elegantbeef> That's a proc |
07:01:15 | FromDiscord | <Elegantbeef> You gained no benefit from using a macro |
07:01:54 | FromDiscord | <fosster> I could not find a way to do it properly with a function since I need different variables and stuff like that |
07:02:08 | FromDiscord | <Elegantbeef> You quite literally remade templates |
07:02:11 | FromDiscord | <Elegantbeef> A proc would work fine |
07:02:36 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#pasty=vCaKusZnFhjb |
07:02:43 | FromDiscord | <Elegantbeef> Though the code is still quite ugh |
07:03:08 | FromDiscord | <fosster> https://play.nim-lang.org/#pasty=LqKMsiWmqFUt |
07:03:49 | FromDiscord | <Elegantbeef> I guess I didn't add another parameter, but just pass it and do `when withInfoDictHash` when accessing |
07:03:53 | FromDiscord | <fosster> thank you, as soon as I can I'll test it and integrate it |
07:06:42 | FromDiscord | <Elegantbeef> And cause I'm silly I'd suggest to refactor that try except stuff like so https://play.nim-lang.org/#pasty=UWnFRjHVRVsU |
07:07:25 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=TfcFYwDyICVu |
07:07:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=KNUUeuHCvXro |
07:19:21 | FromDiscord | <bung8954> does nim has build time constant? |
07:19:44 | FromDiscord | <bung8954> i mean for my program |
07:20:50 | * | ntat joined #nim |
07:21:55 | * | advesperacit joined #nim |
07:26:00 | * | ntat quit (Ping timeout: 268 seconds) |
07:26:40 | * | ntat joined #nim |
07:34:00 | FromDiscord | <sOkam! 🫐> In reply to @bung8954 "does nim has build": `const`? |
07:34:22 | FromDiscord | <sOkam! 🫐> `const` is compile time immutable↵`let` is runtime immutable |
07:34:34 | FromDiscord | <sOkam! 🫐> (edit) "immutable" => "immutable↵`var` is mutable" |
07:34:38 | FromDiscord | <Elegantbeef> They mean the time the program was compiled I assume |
07:35:11 | FromDiscord | <Elegantbeef> The answer is `CompileTime` |
07:37:25 | FromDiscord | <bung8954> ty |
07:54:35 | FromDiscord | <bung8954> is there asymmetric cryptography lib? |
08:38:50 | FromDiscord | <nnsee> there is constantine |
08:48:39 | FromDiscord | <bung8954> it seems it only support sha256 and sysrand |
08:51:29 | FromDiscord | <nnsee> well what exactly are you looking for? |
08:52:17 | FromDiscord | <bung8954> similar to rsa that support public key and private key |
08:57:29 | FromDiscord | <nnsee> does it need to be pure nim? or will a binding library do? |
08:57:31 | FromDiscord | <nnsee> something like https://github.com/FedericoCeratto/nim-libsodium |
09:07:00 | FromDiscord | <bung8954> yeah, it provide public key crypto, I'd prefer pure nim lib, it will be used in my desktop app, if there's no one I'll try this, thanks! |
09:11:02 | FromDiscord | <nnsee> unfortunately I don't think there are pure nim crypto libs that provide something like rsa. I might be wrong here though There is `nimcrypto`, but... it doesn't seem to have any either |
09:14:58 | FromDiscord | <bung8954> seems fine for now, looks like only need ship with libsodium and the site provide prebuild dlls download |
09:21:48 | * | derpydoo joined #nim |
10:41:39 | FromDiscord | <bung8954> duuno why sometimes case expression not work |
10:47:41 | FromDiscord | <penguinite> Does anyone have an idea where a nim compiler gets `$lib` from? and if it's possible to change it? I am trying to debug the install script. |
10:47:41 | FromDiscord | <nnsee> In reply to @bung8954 "duuno why sometimes case": any example? |
10:49:08 | FromDiscord | <bung8954> sent a code paste, see https://play.nim-lang.org/#pasty=XHIyEkmYuuUr |
10:49:33 | FromDiscord | <bung8954> Error: expression '".exe"' is of type 'string' and has to be used (or discarded) |
10:50:36 | FromDiscord | <demotomohiro> In reply to @pengwyns "Does anyone have an": You can add nim module search path with `--path` option: https://nim-lang.org/docs/nimc.html |
10:52:01 | FromDiscord | <nnsee> In reply to @bung8954 "Error: expression '".exe"' is": the problem is you're missing an else |
10:52:01 | FromDiscord | <nnsee> https://play.nim-lang.org/#pasty=ZuXkFIeNiGrP |
10:52:20 | FromDiscord | <nnsee> what would `ext` be if `os` was none of those? |
10:52:29 | FromDiscord | <nnsee> although yes, the error is very misleading |
10:53:36 | FromDiscord | <nnsee> and i swear the error used to be better for this specific case |
10:53:39 | FromDiscord | <nnsee> maybe i'm misremembering |
10:53:43 | FromDiscord | <penguinite> In reply to @demotomohiro "You can add nim": sadly nim still tries to open a non-existent system.nim file, even with the correct path on the top of the config file. (or as a command-line option), I have no idea where nim is getting `/usr/lib/nim/lib/system.nim` from, since I never input that at any stage. |
10:54:39 | FromDiscord | <nnsee> i must be misremembering, trying different versions on the playground just produces the same error message |
11:13:29 | FromDiscord | <bung8954> In reply to @nnsee "the problem is you're": that's really misleading error message. I encouter this two times, and every time I double check the manual : ( |
11:18:17 | FromDiscord | <nnsee> In reply to @bung8954 "that's really misleading error": there is apparently an open bug report for it |
11:18:18 | FromDiscord | <nnsee> https://github.com/nim-lang/Nim/issues/11928 |
11:19:18 | FromDiscord | <nnsee> maybe add your example to that bug report as well, since it seems to more clearly demonstrate the issue |
11:21:41 | FromDiscord | <bung8954> In reply to @nnsee "maybe add your example": indeed |
11:33:24 | FromDiscord | <intellij_gamer> In reply to @pengwyns "sadly nim still tries": There is also the --lib flag↵iirc the lib path defaults to where the nim binary is |
11:34:19 | FromDiscord | <intellij_gamer> If you are up for reading the compiler then iirc [this is where it's set](https://github.com/nim-lang/Nim/blob/773c066634d831a968bb464eab35b25a00026525/compiler/options.nim#L767) |
12:40:03 | FromDiscord | <xtrayambak> Does anyone know how to do CI with Nim? I can't find a good way to do it. |
12:40:10 | FromDiscord | <xtrayambak> I want to use Github Actions, if I can |
12:40:49 | * | jmdaemon quit (Ping timeout: 268 seconds) |
12:41:28 | FromDiscord | <nnsee> what do you mean by "good way"? is using the nim docker image and running `nimble test` or whatever not sufficient for your use case? |
12:44:31 | FromDiscord | <vindaar> Just check out github actions files from some repository. E.g. from ggplotnim https://github.com/Vindaar/ggplotnim/blob/master/.github/workflows/ci.yml↵It might be useful, because it deals with getting dependencies for OSX, Windows as well as linux etc. For simpler stuff it can be quite a bit shorter of course↵(@xtrayambak) |
12:45:08 | FromDiscord | <Robyn [She/Her]> https://github.com/Nimberite-Development/TagForge-Nim/blob/main/.github/workflows/test.yml this is what I use personally unless I have platform specific code |
12:57:51 | * | xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1 - https://znc.in) |
12:57:54 | FromDiscord | <nnsee> sent a code paste, see https://play.nim-lang.org/#pasty=DYMJzanmutJG |
12:58:49 | * | xutaxkamay joined #nim |
13:07:34 | FromDiscord | <saint.___.> asdfajsf |
13:17:07 | * | derpydoo quit (Ping timeout: 260 seconds) |
13:22:47 | FromDiscord | <fosster> thanks for the suggestion |
13:23:09 | FromDiscord | <fosster> btw, is it just me or nim's playground doesn't let me copy the code |
13:35:30 | FromDiscord | <MDuardo> Can you make early if/else escapes?↵I tried return but says "return can't be used here"↵↵Maybe with a procedure would work, haven't tried |
13:39:09 | FromDiscord | <MDuardo> Like this? |
13:39:10 | FromDiscord | <MDuardo> Screenshot\_20240220\_083822\_Firefox\_1.jpg https://media.discordapp.net/attachments/371759389889003532/1209494458488328212/Screenshot_20240220_083822_Firefox_1.jpg?ex=65e7207e&is=65d4ab7e&hm=9a531e0fbbaf26a595c984dc149ac265c7c227462bfe2efdc59d6feb7a030fce& |
13:48:24 | FromDiscord | <egomind> In reply to @MDuardo "Can you make early": Can you share what you tried? early returns should work just fine |
13:49:50 | FromDiscord | <fosster> it works flawlessly, I just had to declare a disposable variable and add `var infoDictHash` to the proc signature |
13:51:17 | * | xet7 joined #nim |
14:11:50 | FromDiscord | <sOkam! 🫐> In reply to @MDuardo "Can you make early": you cannot `return` out of the top level of your code, if thats what you are trying↵return means "exit this function" not "exit this script/file" |
14:13:56 | NimEventer | New Nimble package! amqpstats - Pure Nim library to read AMQP stats via management plugin API, see https://github.com/Q-Master/amqp-stats.nim |
14:18:51 | FromDiscord | <MDuardo> I probably just indented bad the last return↵Thank you 👑↵(@sOkam! 🫐) |
14:30:24 | * | Jjp137 quit (Ping timeout: 256 seconds) |
14:37:48 | * | termer quit (Remote host closed the connection) |
14:38:35 | * | termer joined #nim |
14:45:54 | FromDiscord | <mratsim> In reply to @bung8954 "yeah, it provide public": if you have no specific requirements (blockchain) just use libsodium. |
14:46:02 | FromDiscord | <mratsim> And I say that as the author of Constantine |
14:48:13 | FromDiscord | <mratsim> In reply to @bung8954 "it seems it only": It provides BLS signatures for asymmetric cryptography. But it's a special need for blockchains so that the aggregation of signatures is the signatures of the aggregate. |
14:48:25 | FromDiscord | <mratsim> (edit) "signatures" => "signature" |
14:53:18 | * | alice quit (Killed (lithium.libera.chat (Nickname regained by services))) |
14:53:20 | * | alice joined #nim |
15:01:25 | FromDiscord | <fosster> guys, how can you check if an object field was initialized, meaning that if, for instance, I have initialized an empty object with its constructor AnObject(), and occasionally populate the fields, like while in the process of parsing a document, how can I know if all the fields have been set (and consequently parsed)? |
15:09:18 | FromDiscord | <itr_> What's a good way of memoizing a func? |
15:10:29 | * | lucasta joined #nim |
15:11:04 | FromDiscord | <bung8954> In reply to @mratsim "if you have no": thanks! |
15:17:57 | FromDiscord | <mratsim> In reply to @fosster "guys, how can you": use `Option[MyFieldType]` |
16:04:31 | * | lucasta quit (Quit: Leaving) |
16:39:07 | * | Jjp137 joined #nim |
17:04:50 | FromDiscord | <asviest> sent a code paste, see https://play.nim-lang.org/#pasty=uIUgxPiyUvZQ |
17:13:09 | * | rockcavera joined #nim |
17:37:06 | * | Epsilon joined #nim |
17:43:54 | FromDiscord | <pmunch> In reply to @itr_ "What's a good way": The memoize library comes to mind |
17:44:06 | FromDiscord | <pmunch> https://github.com/andreaferretti/memo |
17:44:13 | FromDiscord | <itr_> In reply to @pmunch "The memoize library comes": only works with procs because {.memoise} technically has side effects |
17:44:33 | FromDiscord | <pmunch> Aah I see |
17:44:56 | FromDiscord | <pmunch> I guess a `cast` pragma to `noSideEffects` |
18:16:12 | FromDiscord | <fosster> to be honest it doesn't seem a good idea to fill up the object of options↵(@mratsim) |
18:34:27 | * | derpydoo joined #nim |
18:47:56 | NimEventer | New thread by thecryptogeek: Do not understand the error when trying to add to seq inside loop, see https://forum.nim-lang.org/t/11052 |
18:48:11 | FromDiscord | <demotomohiro> Why using Option doesn't seem a good idea?↵Another way is adding a bool fields to the object and set it true when it is initialized. |
18:48:31 | FromDiscord | <demotomohiro> @fosster |
19:03:49 | FromDiscord | <fosster> [demotomohiro](https://matrix.to/#/%40_discord_288750616510201856%3At2bot.io) tell me |
19:09:31 | * | rockcavera quit (Remote host closed the connection) |
19:09:50 | * | rockcavera joined #nim |
19:09:50 | * | rockcavera quit (Changing host) |
19:09:50 | * | rockcavera joined #nim |
19:39:15 | FromDiscord | <demotomohiro> Why using Option doesn't seem a good idea? |
19:43:26 | * | rockcavera quit (Remote host closed the connection) |
19:51:20 | FromDiscord | <fosster> because you would fill up your object with options and unwrap values everytime and this just doesn't feel right |
19:51:35 | * | GreaseMonkey quit (Remote host closed the connection) |
19:55:46 | FromDiscord | <demotomohiro> If fields were ref or seq type, you can check if it is initialized with `x.f != nil` or `x.f.len != 0`.↵But there is no generic ways I know to check if it is initialized other than `Option[T]` or adding bool fields like `isXinitialized` that you set to true after initialization. |
19:57:32 | termer | Option is good, syntax around it is not |
19:57:42 | termer | There's a library that makes this easier, but I forget the name |
19:58:20 | termer | Here's one https://github.com/codex-storage/questionable |
20:03:11 | * | greaser|q joined #nim |
20:06:35 | * | greaser|q quit (Remote host closed the connection) |
20:07:36 | * | rockcavera joined #nim |
20:38:49 | FromDiscord | <Robyn [She/Her]> I wonder if I could improve my NBT parser in any way |
20:59:07 | FromDiscord | <maxtachine> any lib to add text over an image? kinda like i think its called canvas in nodejs |
21:00:45 | FromDiscord | <maxtachine> I found one called pixie |
21:15:29 | FromDiscord | <djazz> Pixie ueah |
21:16:41 | * | rockcavera quit (Read error: Connection reset by peer) |
21:17:32 | * | rockcavera joined #nim |
21:17:32 | * | rockcavera quit (Changing host) |
21:17:32 | * | rockcavera joined #nim |
21:17:33 | FromDiscord | <Robyn [She/Her]> Maybe I should learn more about cps in Nim hm... |
21:17:39 | FromDiscord | <Robyn [She/Her]> Not sure where to exactly start though |
21:18:39 | FromDiscord | <Robyn [She/Her]> Oh, I wonder if there's a Nim http server that uses cps |
21:19:05 | FromDiscord | <Elegantbeef> https://github.com/disruptek/httpleast |
21:19:15 | FromDiscord | <Robyn [She/Her]> Ooh |
21:20:40 | FromDiscord | <Robyn [She/Her]> Huh, neat |
21:24:38 | * | rockcavera quit (Read error: Connection reset by peer) |
21:24:58 | * | rockcavera joined #nim |
21:25:26 | FromDiscord | <Robyn [She/Her]> Recycling continuations seems like an odd thing to me ngl |
21:25:44 | FromDiscord | <Robyn [She/Her]> Like, I can't see how you'd do that easily |
21:29:40 | * | dtomato1 quit (Quit: The Lounge - https://thelounge.chat) |
21:33:49 | * | ntat quit (Quit: Leaving) |
21:38:41 | * | rockcavera quit (Read error: Connection reset by peer) |
21:40:08 | * | rockcavera joined #nim |
21:44:41 | FromDiscord | <Robyn [She/Her]> I'm not making progress on my chat platform because I keep putting it off ugh :/ |
21:44:54 | FromDiscord | <Robyn [She/Her]> Mostly the database-related stuff |
21:45:07 | FromDiscord | <Robyn [She/Her]> Maybe I should just make it so I dump the data in a JSON file |
21:55:27 | * | dtomato1 joined #nim |
22:01:48 | FromDiscord | <leorize> well httpleast is a http server |
22:01:50 | FromDiscord | <leorize> it just doesn't do http \:p |
22:07:31 | FromDiscord | <leorize> what is does do is to response to any HTTP requests with a simple 200 OK Hello world response |
22:07:41 | FromDiscord | <leorize> so you can look at it to learn how to setup a server at least |
22:07:59 | FromDiscord | <leorize> it's made for benchmarking cps and queue overhead |
22:15:42 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "it just doesn't do": Ah |
22:15:46 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "it's made for benchmarking": Fair |
22:19:13 | FromDiscord | <leorize> the good news is that it's faster than httpbeast on my computer at least \:p |
22:22:00 | FromDiscord | <Robyn [She/Her]> Also fair, that's a good sign probably? |
22:23:30 | FromDiscord | <leorize> maybe lol |
22:24:01 | * | dtomato1 quit (Quit: The Lounge - https://thelounge.chat) |
22:29:23 | * | dtomato1 joined #nim |
22:36:18 | FromDiscord | <ezquerra> Do you guys know if if there is a built in function that converts and integer to a bool sequence or do I need to make my own? |
22:37:29 | FromDiscord | <leorize> a single integer to bool seq? |
22:37:34 | FromDiscord | <ezquerra> Yes |
22:37:44 | FromDiscord | <leorize> why would you want that... |
22:37:48 | FromDiscord | <leorize> but yea you'd have to make your own |
22:38:18 | FromDiscord | <Robyn [She/Her]> In reply to @ezquerra "Do you guys know": I mean, you could cast a Nim int to an array of bools...? |
22:38:25 | FromDiscord | <leorize> you can't |
22:38:32 | FromDiscord | <ezquerra> Would that work? |
22:39:05 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "you can't": Why not? |
22:39:12 | FromDiscord | <leorize> because a bool is one byte |
22:39:35 | FromDiscord | <ezquerra> In reply to @leorize "why would you want": Long story, I’m implementing a pretty in efficient Linear Feedback Shift Register 😅 |
22:39:45 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "because a bool is": To an array of bools it'd work |
22:40:04 | FromDiscord | <leorize> you can write your own bitshifts for this no? |
22:40:11 | * | advesperacit quit () |
22:40:12 | FromDiscord | <Robyn [She/Her]> `cast[array[sizeof int, bool]](139227222229483)` this works |
22:40:22 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "you can write your": And this is probably much more robust than casting anyway |
22:40:30 | FromDiscord | <leorize> and what exactly did you get from it lol↵(@Robyn [She/Her]) |
22:40:46 | FromDiscord | <Robyn [She/Her]> `[true, true, true, true, false, false, false, false]` |
22:41:08 | FromDiscord | <leorize> as you can see, it meant absolutely nothing \:p |
22:41:16 | FromDiscord | <Robyn [She/Her]> Wait, unless they meant getting the bits as bools |
22:41:45 | FromDiscord | <Robyn [She/Her]> That's what they meant, isn't it |
22:41:54 | FromDiscord | <leorize> what else |
22:42:31 | FromDiscord | <Robyn [She/Her]> 🤷♀️ I didn't question it |
22:43:12 | FromDiscord | <leorize> manual masking is infinitely better, and the compiler could optimize it better too |
22:43:41 | FromDiscord | <leorize> but if you really want to manipulate individual bits by hand, then testBit and setBit from std/bitops is what you want |
22:45:55 | FromDiscord | <ezquerra> OK, it should be simple enough. I thought I’d ask first in case it was already part of the std or something like that. Thanks anyway! |
22:46:54 | FromDiscord | <leorize> a niche case like turning 8 bytes into 64 is unlikely to be in stdlib \:p |
22:47:09 | FromDiscord | <leorize> though I think that's like, an actual thing you could do with SIMD |
22:49:00 | * | Jjp137 quit (Read error: Connection reset by peer) |
22:49:30 | * | Jjp137 joined #nim |
23:12:38 | FromDiscord | <Elegantbeef> We can always just do `cast[set[0..sizeof(int)](myInt)` 😄 |