00:32:25 | * | Ekho quit (Quit: CORE ERROR, SYSTEM HALTED.) |
00:39:35 | * | Ekho joined #nim |
01:04:20 | * | Mister_Magister quit (Quit: bye) |
01:06:16 | * | Mister_Magister joined #nim |
01:13:31 | NimEventer | New Nimble package! threadlogging - A thread safe logging library using Nim's own logging module, see https://pswilde.codeberg.page/threadlogging_docs/threadlogging.html |
02:10:15 | FromDiscord | <taperfade> when do i use isMainModule |
02:10:57 | FromDiscord | <JJ> when you want to check if you are in the main module |
02:11:13 | FromDiscord | <JJ> it's a compile-time known predicate that is useful with `when` statements (also compile time) |
02:23:59 | * | CO2 joined #nim |
02:25:01 | FromDiscord | <taperfade> what does spawn do |
02:31:29 | FromDiscord | <Elegantbeef> > Spawn is a superhero appearing in a monthly comic book of the same name published by American company Image Comics, as well as in a number of films, television series, and video game adaptations set in the Image Universe. |
02:32:32 | FromDiscord | <Elegantbeef> Yes it's a dick move to post an unrelated response, but the manual entry exists for spawn |
02:32:46 | FromDiscord | <taperfade> ok |
02:32:48 | FromDiscord | <taperfade> well |
02:32:53 | FromDiscord | <taperfade> now i have a good question |
02:33:01 | FromDiscord | <taperfade> how do i make something repeat |
02:33:10 | FromDiscord | <taperfade> while also executing other code yk |
02:33:12 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#spawn_1↵https://nim-lang.org/docs/threadpool.html#spawn%2Csinktyped↵To be a glorified search engine |
02:33:12 | FromDiscord | <Elegantbeef> Repeat in what way? |
02:33:27 | FromDiscord | <taperfade> a loop that runs |
02:33:33 | FromDiscord | <taperfade> always |
02:33:40 | FromDiscord | <taperfade> in the background |
02:33:43 | FromDiscord | <taperfade> checking for somethhing |
02:33:47 | FromDiscord | <Elegantbeef> `createThread` |
02:33:51 | FromDiscord | <taperfade> thx |
02:52:55 | FromDiscord | <taperfade> i dont get how createThread works |
02:53:01 | FromDiscord | <taperfade> the docs dumb |
02:54:38 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/typedthreads.html#examples |
02:57:40 | FromDiscord | <taperfade> createThreads |
02:57:40 | FromDiscord | <taperfade> how |
02:59:26 | FromDiscord | <Elegantbeef> Look at the example |
02:59:57 | FromDiscord | <taperfade> i dont get it |
03:00:01 | FromDiscord | <taperfade> the example is dumb |
03:00:27 | FromDiscord | <Elegantbeef> You cannot just call everything you do not understand dumb |
03:01:57 | FromDiscord | <taperfade> why cant they make examples with hello world |
03:02:14 | FromDiscord | <taperfade> i dont want to learn aremaic to understand how that works |
03:02:15 | FromDiscord | <Elegantbeef> That is a hello world example |
03:02:22 | FromDiscord | <taperfade> its not |
03:02:38 | FromDiscord | <Elegantbeef> It quite literally is, you want to do multi threading |
03:02:43 | FromDiscord | <Elegantbeef> That's how you do multi threading |
03:03:02 | FromDiscord | <Elegantbeef> Maybe if instead of saying X is dumb you actually write a question about where you confusion is you will get help |
03:03:29 | FromDiscord | <Elegantbeef> Otherwise I can only assume you want to be spoonfed a solution to your problem and have no willingness to learn |
03:03:38 | FromDiscord | <taperfade> okey |
03:03:44 | FromDiscord | <taperfade> what the flip does the code do |
03:03:58 | FromDiscord | <Elegantbeef> Did you run it? |
03:04:25 | FromDiscord | <taperfade> yes |
03:04:33 | FromDiscord | <taperfade> i dont get the code |
03:04:54 | FromDiscord | <taperfade> theres thr |
03:05:01 | FromDiscord | <Elegantbeef> It usues 5 threads to iterate over a range of numbers printing them |
03:05:04 | FromDiscord | <Elegantbeef> uses\ |
03:05:05 | FromDiscord | <taperfade> and its a array and a thread and a tuple =?? |
03:05:10 | FromDiscord | <taperfade> and l is a lock |
03:05:11 | FromDiscord | <taperfade> what |
03:05:17 | FromDiscord | <taperfade> yeah |
03:05:22 | FromDiscord | <taperfade> i dont get it |
03:05:42 | FromDiscord | <taperfade> currently praying for the downfall of whoever wrote that |
03:06:33 | FromDiscord | <taperfade> doesnt understand = wants to stab person who made it with a machete |
03:06:40 | FromDiscord | <taperfade> :3 |
03:07:26 | FromDiscord | <Elegantbeef> Nim threads are typed for their procedures parameter using a tuple |
03:07:38 | FromDiscord | <Elegantbeef> So that thread needs a `proc(tup: tuple[a, b: int]]` |
03:08:29 | FromDiscord | <taperfade> yeah |
03:08:33 | FromDiscord | <taperfade> ill learn haskell |
03:08:57 | FromDiscord | <taperfade> why cant it be |
03:09:22 | FromDiscord | <taperfade> makeThread( thing you want to execute ) |
03:09:38 | FromDiscord | <Elegantbeef> Have fun |
03:09:58 | FromDiscord | <taperfade> death threats |
03:10:03 | FromDiscord | <taperfade> directed towards you |
03:12:03 | FromDiscord | <odexine> 🆗 |
03:12:33 | FromDiscord | <taperfade> |
03:13:09 | FromDiscord | <taperfade> thanx nim community for the help |
03:13:21 | FromDiscord | <taperfade> appreciate it |
03:15:22 | FromDiscord | <Elegantbeef> We gave you help but you just made a bunch of killing jokes |
03:16:26 | FromDiscord | <taperfade> In reply to @taperfade "appreciate it": https://www.youtube.com/shorts/CnixWuGiZu4 |
03:16:50 | FromDiscord | <taperfade> guys i asked chatgpt |
03:17:09 | FromDiscord | <that_dude.> In reply to @taperfade "makeThread( thing you want": It litteraly is that, you just can seem to see it |
03:17:24 | FromDiscord | <taperfade> yeah |
03:17:39 | FromDiscord | <taperfade> make something that literally echoes hello world |
03:18:23 | FromDiscord | <taperfade> holy shit i love chatgpt |
03:18:35 | FromDiscord | <taperfade> sent a code paste, see https://play.nim-lang.org/#ix=4KNM |
03:18:38 | FromDiscord | <taperfade> now i understand |
03:18:47 | FromDiscord | <taperfade> they should make the docs be written by it |
03:18:47 | FromDiscord | <taperfade> frfr |
03:19:01 | FromDiscord | <that_dude.> Async isnt threading |
03:19:13 | FromDiscord | <leorize> I can see that chatgpt is completely useless with nim \:p |
03:19:19 | FromDiscord | <taperfade> pff whatever you mean |
03:19:19 | FromDiscord | <taperfade> chatgpt did it |
03:19:32 | FromDiscord | <Elegantbeef> It is completely wrong |
03:19:41 | FromDiscord | <leorize> write nim to keep your jobs folks |
03:19:56 | FromDiscord | <taperfade> In reply to @Elegantbeef "It is completely wrong": okey |
03:19:58 | FromDiscord | <taperfade> fix i |
03:20:01 | FromDiscord | <taperfade> (edit) "i" => "it" |
03:20:23 | FromDiscord | <leorize> chatgpt can fix it too 😉 |
03:20:32 | FromDiscord | <taperfade> ill try |
03:22:05 | FromDiscord | <taperfade> yeah |
03:22:20 | FromDiscord | <taperfade> i think chatgpt is poopie-headed |
03:22:28 | FromDiscord | <taperfade> it doesnt make sense and even i can see it |
03:22:37 | FromDiscord | <taperfade> crying sobbing |
03:23:33 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4KNP |
03:24:06 | FromDiscord | <michaelb.eth> threadVar might not be the best name, because the `{.threadvar.}` pragma is a thing, could get confusing |
03:24:18 | FromDiscord | <that_dude.> True |
03:24:39 | FromDiscord | <that_dude.> (edit) "https://play.nim-lang.org/#ix=4KNP" => "https://play.nim-lang.org/#ix=4KNQ" |
03:26:33 | FromDiscord | <that_dude.> @taperfade The docs are quite easy to understand, I don't think you understand strict typing yet. Everything you need to know to make your own versions is listed/can be seen from the example |
03:27:20 | FromDiscord | <taperfade> whatever |
04:14:27 | FromDiscord | <charlie_charlie> Hello guys, it seems that the below socket options are not available in std/net. Is there an alternative method to implement a multicast UDP server? |
04:14:31 | FromDiscord | <charlie_charlie> sent a long message, see http://ix.io/4KNZ |
05:06:29 | FromDiscord | <Elegantbeef> @Phil this is awful and does not work with 100% of types but you did make me implement the logic for extracting variant variable names https://play.nim-lang.org/#ix=4KO6 |
05:08:40 | FromDiscord | <Elegantbeef> To make it work on all types you need to pass in a hashset of names to skip mutating |
05:08:41 | FromDiscord | <Elegantbeef> Too much madness already |
05:23:21 | * | derpydoo joined #nim |
06:28:16 | FromDiscord | <nnsee> In reply to @charlie_charlie "IP_MULTICAST_LOOP IP_MULTICAST_TTL IP_MULTICAST_IF ": in reality these are just enums with corresponding values |
06:28:47 | FromDiscord | <nnsee> if you use nativesockets and pass cints directly, then it's entirely possible |
06:32:55 | FromDiscord | <nnsee> if push comes to shove, you can also construct raw packets manually like I'm doing here with ICMPv6 packets https://play.nim-lang.org/#ix=4KOl |
06:33:02 | FromDiscord | <nnsee> not very pretty, but it works |
06:35:00 | FromDiscord | <nnsee> but you shouldn't have to do that |
07:31:48 | * | PMunch joined #nim |
07:52:22 | FromDiscord | <Chronos [She/Her]> Wish I had something to host a runner on for CI |
07:52:44 | FromDiscord | <odexine> Why? |
07:53:20 | FromDiscord | <Chronos [She/Her]> I wanna move my repos to a Forgejo instance, but the pain point of that is I lose GitHub Actions which is so useful |
07:53:33 | FromDiscord | <Chronos [She/Her]> I'm switching to a public Forgejo instance specifically |
07:54:24 | FromDiscord | <nnsee> In reply to @chronos.vitaqua "I wanna move my": i run my own gitea instance and i have gitea actions |
07:54:37 | FromDiscord | <nnsee> i'm assuming forgejo would have the same as it tracks gitea's codebase |
07:54:58 | FromDiscord | <nnsee> ie https://git.dog/xx/fastcube/actions/runs/6/jobs/0 |
07:55:09 | FromDiscord | <Chronos [She/Her]> Yep, the instance I'm using doesn't have that iirc |
07:55:22 | FromDiscord | <nnsee> ah well |
07:55:46 | FromDiscord | <nnsee> i've always been a fan of self hosting anyways 😅 |
07:56:06 | FromDiscord | <Chronos [She/Her]> I can't self-host at the moment aha |
07:56:17 | FromDiscord | <Chronos [She/Her]> No source of income so I don't have money to spend on stuff like this |
07:56:44 | FromDiscord | <nnsee> well my gitea instance is costing me exactly 0 dollars |
07:56:45 | FromDiscord | <nnsee> well |
07:56:47 | FromDiscord | <nnsee> apart from the domain name |
07:57:15 | FromDiscord | <nnsee> but if you have no CC you probably can't make use of the oracle cloud free tier either iirc |
07:58:33 | FromDiscord | <Chronos [She/Her]> I have a bank card, Oracle just refuses to take it sadly |
07:58:38 | FromDiscord | <Elegantbeef> IIRC someone told me that oracle does not require a credit card for their free VPS', do not recall |
07:58:43 | FromDiscord | <Chronos [She/Her]> I use Monzo which people use for virtual cards too |
07:58:45 | FromDiscord | <Elegantbeef> Ah guess I'm wrong |
07:58:54 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "IIRC someone told me": Credit or debit card, must be one |
07:59:24 | FromDiscord | <pmunch> @taperfade, please be more respectful of the channel members. Death threats, wishing people harm, etc. is not tolerated. And neither is just not even attempting to take to heart the responses you get. |
07:59:57 | FromDiscord | <Elegantbeef> "I only wanted them to die... in minecraft" |
08:00:21 | FromDiscord | <nnsee> @Chronos [She/Her] if you really want runners, I can make you an account on my instance |
08:00:29 | FromDiscord | <nnsee> and let you use mine |
08:04:21 | FromDiscord | <Chronos [She/Her]> It's alright, I can just keep using GitHub Actions really |
08:04:35 | FromDiscord | <Chronos [She/Her]> Since I plan to keep the repos on GitHub anyway as a mirror |
08:04:49 | FromDiscord | <Elegantbeef> Could always mirror your repos to github/lab to get actions |
08:06:06 | FromDiscord | <Chronos [She/Her]> Yep that's what I'm gonna do aha |
08:07:28 | FromDiscord | <Elegantbeef> I'm now looking at VPSes and hmmmmm |
08:11:08 | FromDiscord | <nnsee> one thing that bothers me about aarch64 gitea, with runners specifically, is that the actions ecosystem is entirely fucked and actions flat out don't work since it uses the wrong arch |
08:11:36 | FromDiscord | <Chronos [She/Her]> Oh that's really irritating |
08:11:53 | FromDiscord | <nnsee> i have two runners - x86 and arm |
08:12:04 | FromDiscord | <Chronos [She/Her]> No way to force actions to use aarch64 images? |
08:12:05 | FromDiscord | <nnsee> most times, i have to manually specify the CI job to run on x86 |
08:12:16 | FromDiscord | <Chronos [She/Her]> Alternatively: Could use box86 and box64? :p |
08:12:55 | FromDiscord | <nnsee> well, i haven't looked too much into that, but even the simplest "check out the repository" action fails with `OCI runtime exec failed: exec failed: unable to start container process: exec: "node": executable file not found in $PATH: unknown` |
08:13:40 | FromDiscord | <Chronos [She/Her]> So it's trying to grab the x86 version of node then? That's hella annoying |
08:14:28 | NimEventer | New thread by bsljth: Slack API in Nim, see https://forum.nim-lang.org/t/10609 |
08:14:35 | FromDiscord | <nnsee> i think it's just because they haven't published arm images for the checkout action (which uses `node` - thus the error message) so it implicitly defaults to x86 |
08:14:58 | FromDiscord | <Chronos [She/Her]> Aah |
08:15:22 | FromDiscord | <nnsee> at least |
08:15:27 | FromDiscord | <Chronos [She/Her]> One solution could be to host it yourself maybe? |
08:15:28 | FromDiscord | <nnsee> that's what I _think_ is happening |
08:15:34 | FromDiscord | <nnsee> the error message isn't too descriptive |
08:15:35 | FromDiscord | <nnsee> i guess |
08:16:02 | FromDiscord | <nnsee> it just hasn't been worth the hassle tbh, the actions run fine on my amd64 runner so 🤷 |
08:16:13 | FromDiscord | <Chronos [She/Her]> Fair enough |
08:40:54 | * | gooba_ joined #nim |
08:43:07 | * | gooba quit (Ping timeout: 264 seconds) |
09:02:32 | * | kenran joined #nim |
09:25:05 | * | derpydoo quit (Read error: Connection reset by peer) |
09:46:32 | FromDiscord | <righthandofdoom> does anyone have any interop examples with cpp |
10:03:30 | arkanoid | at the moment, futhark is capable of auto-generating low-level C bindings automatically, tons of procs and types made easy and this is gold. To make proper idiomatic nim binding on top of this, I'd need to make procs calling auto-generated procs, making it a double call instead of one. My question is what is the best way to tackle this? Maybe {.inline.}, maybe template, maybe the compiler already does |
10:03:32 | arkanoid | what is needed and I should not care |
10:11:56 | * | CO2 quit (Quit: WeeChat 4.1.1) |
10:19:21 | FromDiscord | <Elegantbeef> I say use procs annotated `inline` |
10:19:45 | FromDiscord | <Elegantbeef> Though I generally do not worry about the overhead the body is generally more complicated than just a single call in my case |
10:21:59 | arkanoid | Elegantbeef, in my case, the wrapper proc is just calling the wrapped but sink/lent is added to the wrapper params/return |
10:22:21 | FromDiscord | <Elegantbeef> Right then use `inline` procs to properly respect semantics |
10:23:12 | FromDiscord | <Elegantbeef> A `lent T` does not make any sense on a template since it is a syntax substitute |
10:34:35 | arkanoid | thanks, I also prefer procs |
10:34:56 | arkanoid | I wonder if I could use funcs |
10:54:06 | FromDiscord | <demotomohiro> In reply to @righthandofdoom "does anyone have any": https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma |
11:43:58 | * | kenran quit (Remote host closed the connection) |
12:20:09 | * | CO2 joined #nim |
13:08:17 | FromDiscord | <righthandofdoom> sent a code paste, see https://play.nim-lang.org/#ix=4KPR |
13:08:20 | FromDiscord | <righthandofdoom> @demotomohiro |
13:12:29 | * | edr joined #nim |
13:13:40 | FromDiscord | <righthandofdoom> thanks |
13:17:11 | * | derpydoo joined #nim |
14:25:40 | * | CO2 quit (Quit: WeeChat 4.1.1) |
14:33:17 | FromDiscord | <.aingel.> In reply to @righthandofdoom "<@288750616510201856>": A good approach if you haven't considered it is write a C API for the cpp methods you want to use, if that's practical. It makes things a lot easier |
14:34:29 | PMunch | I should really get Futhark to parse C++ |
14:35:38 | PMunch | arkanoid, whether or not you should use func depends on whether it is an actual function or not |
14:36:07 | PMunch | And yeah inline should work, but in general your C compiler is smart enough to inline things if it would improve the situation |
14:37:05 | PMunch | If it's just as a ways of improving the signature and let the user avoid use addr for example I generally use a template |
14:41:12 | FromDiscord | <jmgomez> In reply to @.aingel. "A good approach if": strong disagree, it's much simpler to just wrap the C++ right away |
14:42:18 | * | CO2 joined #nim |
14:45:07 | FromDiscord | <.aingel.> In reply to @jmgomez "strong disagree, it's much": Oh okay |
14:47:29 | FromDiscord | <pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4KQe |
14:47:33 | FromDiscord | <pcarrier> nim can't divide uint64s!?! |
15:04:06 | Amun-Ra | / is for floats |
15:04:25 | Amun-Ra | use div for integer division |
15:05:07 | * | PMunch quit (Quit: Leaving) |
15:09:13 | FromDiscord | <demotomohiro> In Nim, cast means changing type without changing bits.↵You need to convert uint to float that change bits. |
15:17:06 | FromDiscord | <pcarrier> In reply to @Amun-Ra "use div for integer": I know, I literally said "float division"… |
15:17:52 | Amun-Ra | ah, sorry, I read "uint64s" as "uint64s" not as "floats" |
15:17:56 | * | def- quit (Quit: -) |
15:18:08 | * | def- joined #nim |
15:18:14 | FromDiscord | <pcarrier> yeah, float division is defined on int |
15:18:19 | FromDiscord | <pcarrier> why not uint64? |
15:18:23 | FromDiscord | <pcarrier> (edit) "int" => "ints" |
15:18:34 | Amun-Ra | that's the exception |
15:19:17 | Amun-Ra | if you want float division for uint64 you have to do it explicitelyu |
15:27:33 | FromDiscord | <demotomohiro> In Nim, uint types are not used for storing integer numbers. It is used for storing bit patterns (Hash, crypt, PRNG, etc).↵I think that is why there is no `\` for uint. |
15:28:43 | Amun-Ra | and there are no range checks for unsigned ints |
15:51:37 | * | def- quit (Quit: -) |
15:51:49 | * | def- joined #nim |
17:15:44 | arkanoid | I have a group of constants that are like Foo0 = 0, Foo1 = 1, Foo2 = 2, Foo3 = 4, Foo5 = 8, Foo6 = 16 .. and I want to make a set out of them, without declaring more names (for example by creating an enum) |
17:17:37 | * | rockcavera joined #nim |
17:42:30 | * | CO2 quit (Quit: WeeChat 4.1.1) |
17:43:09 | * | CO2 joined #nim |
17:48:24 | FromDiscord | <odexine> set entries must be the non-exponentiated form (0, 1, 2, 3, 4, 5...) otherwise you pretty much have to keep using C-style or-ing etc |
17:50:24 | arkanoid | odexine, thanks. I've been testing this out here https://play.nim-lang.org/#ix=4KRa |
17:50:59 | FromDiscord | <odexine> wouldnt work |
17:51:27 | FromDiscord | <odexine> sets use the value of the enum as the bit index |
17:52:01 | FromDiscord | <odexine> so you'd be setting 2^2^1, 2^2^2, 2^2^3 etc basically double exponentiating |
17:52:55 | arkanoid | makes sense, but I have exponentiated constants from C. Mmmm, I could calc the root square of them at compile time |
17:52:56 | FromDiscord | <odexine> In reply to @odexine "sets use the value": this isnt completely true, first value in enum is always bit index 0, then difference between value 1 and 2 is the bit index for the next value etc |
17:58:30 | arkanoid | thanks |
18:09:46 | * | CO2 quit (Quit: WeeChat 4.1.1) |
18:13:43 | * | CO2 joined #nim |
18:29:18 | * | neceve joined #nim |
18:32:35 | arkanoid | odexine, I think I should correct you: "set entries must be the non-exponentiated form (0, 1, 2, 3, 4, 5...)", actually must be "1, 2, 3, 4, ..." as 0 is would be empty set |
18:33:28 | FromDiscord | <odexine> well i mean 2^0 = 1 |
18:34:12 | FromDiscord | <odexine> empty set means none of the enum values are in the set so its not representable |
18:34:15 | FromDiscord | <odexine> (edit) "empty set means none of the enum values are in the set so its not representable ... " added "in the enum" |
18:49:35 | * | neceve quit (Ping timeout: 255 seconds) |
19:01:02 | * | disso-peach quit (Quit: Leaving) |
19:01:20 | arkanoid | does string to cstring conversion always copy? |
19:06:20 | FromDiscord | <Hourglass [She/Her]> Hey y'all |
19:06:20 | FromDiscord | <Hourglass [She/Her]> Discord is shitting itself lol |
19:06:24 | FromDiscord | <Hourglass [She/Her]> Hold on# |
19:09:13 | Amun-Ra | arkanoid: https://play.nim-lang.org/#ix=4KRt |
19:09:50 | Amun-Ra | arkanoid: seems that way |
19:12:34 | FromDiscord | <Chronos [She/Her]> ✨ |
19:14:04 | * | henrytill_ joined #nim |
19:14:09 | * | mronetwo_ joined #nim |
19:14:10 | * | oddish_ joined #nim |
19:14:32 | * | casaca_ joined #nim |
19:14:58 | * | termer joined #nim |
19:16:52 | * | lumidify_ joined #nim |
19:17:19 | FromDiscord | <Chronos [She/Her]> We're back folks |
19:18:21 | * | casaca quit (Ping timeout: 246 seconds) |
19:18:22 | * | mronetwo quit (Ping timeout: 246 seconds) |
19:18:22 | * | lumidify quit (Ping timeout: 246 seconds) |
19:18:22 | * | oddish quit (Ping timeout: 246 seconds) |
19:18:23 | * | henrytill quit (Ping timeout: 246 seconds) |
19:18:24 | * | termer_ quit (Ping timeout: 246 seconds) |
19:18:26 | * | casaca_ is now known as casaca |
19:18:27 | * | henrytill_ is now known as henrytill |
19:18:45 | * | oddish_ quit (Remote host closed the connection) |
19:18:46 | * | casaca quit (Read error: Connection reset by peer) |
19:18:46 | * | henrytill quit (Read error: Connection reset by peer) |
19:18:46 | * | adigitoleo quit (Read error: Connection reset by peer) |
19:18:47 | * | mronetwo_ quit (Read error: Connection reset by peer) |
19:18:47 | * | noeontheend quit (Write error: Connection reset by peer) |
19:18:59 | * | mronetwo joined #nim |
19:19:01 | * | oddish joined #nim |
19:19:03 | * | adigitoleo joined #nim |
19:19:21 | * | casaca joined #nim |
19:20:05 | * | henrytill joined #nim |
19:20:23 | * | noeontheend joined #nim |
19:20:52 | * | CO2 quit (Quit: WeeChat 4.1.1) |
19:53:11 | * | CO2 joined #nim |
20:30:58 | FromDiscord | <Phil> So many different new clown people |
20:40:49 | NimEventer | New thread by icedquinn: Concepts as type classes in generics, see https://forum.nim-lang.org/t/10611 |
20:45:38 | FromDiscord | <bostonboston> sent a code paste, see https://play.nim-lang.org/#ix=4KRN |
20:53:55 | FromDiscord | <bostonboston> sent a code paste, see https://play.nim-lang.org/#ix=4KRO |
20:54:30 | FromDiscord | <bostonboston> (edit) "https://play.nim-lang.org/#ix=4KRO" => "https://play.nim-lang.org/#ix=4KRP" |
20:54:59 | FromDiscord | <bostonboston> error is pointing to the paren after std:: |
21:07:00 | FromDiscord | <Chronos [She/Her]> Hm is it sane to host HTML, CSS and ~~Nim~~ JS on a seperate server than the API? |
21:08:49 | Amun-Ra | depends on the traffic you expect |
21:09:08 | FromDiscord | <Chronos [She/Her]> Honestly, probably very low |
21:10:07 | Amun-Ra | you can have static files on different vhost for starters |
21:10:38 | FromDiscord | <Chronos [She/Her]> Though I'm also wondering how I should handle auth with tokens, they need to expire but I feel like adding a loop to check if a token has been used for longer than X mins or something is kind of less than ideal |
21:11:23 | FromDiscord | <Chronos [She/Her]> I could do the calculation everytime the user uses the token but that could probably stack up quite a bit, unless I store something in memory for that hm... |
21:14:58 | Amun-Ra | you could store tokens in a database and clean them after X mins of use |
21:15:41 | FromDiscord | <adrian> is atlas shipped with nim 2.0.0? I installed it with choosenim but can't find atlas. |
21:16:08 | FromDiscord | <odexine> choosenim doesnt expose it because it is outdated |
21:17:29 | FromDiscord | <adrian> I heard that atlas was supposed to replace nimble, what happened? |
21:17:34 | FromDiscord | <Chronos [She/Her]> In reply to @Amun-Ra "you could store tokens": How would I know if it's been used for more than X mins tho? Ig encode a timestamp in the token |
21:18:12 | FromDiscord | <Chronos [She/Her]> And obviously make sure the token was encrypted |
21:18:48 | Amun-Ra | Chronos: timestamp in db |
21:29:04 | arkanoid | Amun-Ra: thanks. I'm quite puzzled then. How is that possible? |
21:34:17 | FromDiscord | <nnsee> In reply to @chronos.vitaqua "Hm is it sane": yes, and very common in practice |
21:34:43 | FromDiscord | <nnsee> is there's a separate `api.domain.name` that the front end talks with |
21:35:34 | FromDiscord | <nnsee> reasoning being that the front end machine is simply configured to serve static files (and fast) and nothing more |
21:36:14 | FromDiscord | <nnsee> it makes you explicitly handle CORS, though |
21:38:00 | FromDiscord | <odexine> In reply to @adrian "I heard that atlas": nothing happened, it is planned for it to replace nimble but not now |
21:39:49 | FromDiscord | <Chronos [She/Her]> In reply to @Amun-Ra "Chronos: timestamp in db": Still means I'd have to loop over it oof |
21:39:57 | FromDiscord | <Chronos [She/Her]> In reply to @nnsee "is there's a separate": Oh good to know! |
21:43:06 | FromDiscord | <Chronos [She/Her]> Maybe I'll assign a ULID for each token |
21:47:40 | FromDiscord | <odexine> In reply to @chronos.vitaqua "Still means I'd have": why? |
21:48:07 | FromDiscord | <odexine> depends on the database as well, KV stores often "automatically" expire keys |
21:48:10 | FromDiscord | <odexine> In reply to @chronos.vitaqua "Maybe I'll assign a": why? |
21:48:29 | FromDiscord | <Chronos [She/Her]> In reply to @odexine "why?": So users can expire tokens manually, that's important |
21:48:48 | FromDiscord | <Chronos [She/Her]> In reply to @odexine "why?": I realised a bit earlier I don't have to lol |
21:49:05 | FromDiscord | <odexine> In reply to @chronos.vitaqua "So users can expire": i dont see the relation |
21:49:30 | FromDiscord | <Chronos [She/Her]> In reply to @odexine "i dont see the": It'd be an ID users can revoke |
21:49:48 | * | end` joined #nim |
21:49:51 | FromDiscord | <Chronos [She/Her]> Though, the timestamp would be enough actually |
21:58:03 | FromDiscord | <Chronos [She/Her]> Discord tokens never expire unless you make them expire manually, how stupid of an idea is that? :p |
22:05:49 | FromDiscord | <Chronos [She/Her]> Hm wondering if it's better to use Bcrypt hm... |
22:06:55 | FromDiscord | <leorize> bcrypt is capped to 72 characters btw |
22:07:45 | FromDiscord | <Chronos [She/Her]> Is that a bad thing? |
22:09:32 | FromDiscord | <Chronos [She/Her]> Or is that informative info for DB stuff |
22:11:05 | FromDiscord | <leorize> depends on you |
22:11:14 | FromDiscord | <leorize> but you should use argon2 if you can |
22:13:10 | FromDiscord | <Chronos [She/Her]> I'm getting conflicting info :p↵Some people say Argon2 isn't cache resistant or something, sme say it's good for passwords (obviously won at PHC), but others say Bcrypt can provide the same security much faster and with less memory usage |
22:14:08 | FromDiscord | <Chronos [She/Her]> Only thing keeping me on the fence is Argon2 obviously using more memory, not a big issue but hm... |
22:14:08 | FromDiscord | <leorize> [argon2id is pretty damn good](https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html) |
22:14:18 | FromDiscord | <leorize> gah, why did that turn it into a link... |
22:14:33 | Amun-Ra | if you limit login attempts it almost does not matter |
22:14:48 | FromDiscord | <leorize> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1171210940331606097): https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html |
22:14:57 | FromDiscord | <Chronos [She/Her]> 19 mib of memory? Wow |
22:14:57 | FromDiscord | <leorize> owasp is a good source to play with |
22:15:52 | FromDiscord | <Chronos [She/Her]> Defo looks useful |
22:16:20 | FromDiscord | <leorize> that number is minimum fwiw |
22:16:56 | FromDiscord | <Chronos [She/Her]> Yeah I can see aha |
22:17:32 | FromDiscord | <Chronos [She/Her]> Assuming higher is better? But idk, what would a recommended amount be that's reasonable for a server that'd probably perform other tasks too? |
22:18:26 | FromDiscord | <odexine> higher is better yes |
22:18:56 | FromDiscord | <odexine> strike a balance between hashing performance and server utilisation |
22:19:52 | FromDiscord | <Chronos [She/Her]> I wouldn't know about either :p doing local dev on my PC so- Would it be better to make it configurable so that it can be changed by the server operator? |
22:20:14 | FromDiscord | <Chronos [She/Her]> So they could finetune it or whatever (with the default being what Sodium gives out of the box) |
22:21:50 | FromDiscord | <odexine> I believe it is commonly made tunable for the operator |
22:21:58 | FromDiscord | <Chronos [She/Her]> Makes sense |
22:23:53 | FromDiscord | <leorize> and they write there that all of the recommended configs are equivalent in security |
22:23:54 | FromDiscord | <leorize> they literally recommended an amount for you... |
22:25:17 | FromDiscord | <Chronos [She/Her]> Yeah but I would've thought giving more memory or parallelism is a good thing, if doable with decent performance? |
22:28:19 | Amun-Ra | remember limit login attempts not to dos yourself |
22:28:39 | FromDiscord | <Chronos [She/Her]> Yeah lol |
22:28:56 | FromDiscord | <Chronos [She/Her]> Ratelimits are probably the last thing I'll implement :p |
22:29:29 | Amun-Ra | the more expensive algorithm you pick the easier it may happen ;> |
22:29:59 | FromDiscord | <Chronos [She/Her]> Aha |
22:31:47 | FromDiscord | <leorize> there's a thing called diminishing returns↵(@Chronos [She/Her]) |
22:32:11 | FromDiscord | <Chronos [She/Her]> Fair |
22:32:40 | FromDiscord | <leorize> see RFC 9106 if you want the full meat\: https://datatracker.ietf.org/doc/html/rfc9106#name-parameter-choice |
22:34:46 | FromDiscord | <Chronos [She/Her]> > If much less memory is available, a uniformly safe option is Argon2id with t=3 iterations, p=4 lanes, m=2^(16) (64 MiB of RAM), 128-bit salt, and 256-bit tag size. This is the SECOND RECOMMENDED option.↵I think this should be good then |
22:37:23 | * | derpydoo quit (Read error: Connection reset by peer) |
22:42:28 | FromDiscord | <Chronos [She/Her]> I can't change the paralellism with nim-libsodium- But this is still higher than the recommended minimums by OWASP so... Hm |
22:43:29 | * | xet7 quit (Remote host closed the connection) |
22:46:37 | FromDiscord | <bostonboston> Recently installed nim on a Windows 11 machine and can successfully compile with the c backend but not cpp, anyone experience this? |
22:50:53 | * | derpydoo joined #nim |
22:51:33 | FromDiscord | <bostonboston> It's claiming it can't find g++.exe, but it's in my path |
22:58:58 | * | end` is now known as end |
22:59:13 | * | end is now known as end` |
23:06:10 | * | bcksl joined #nim |
23:11:00 | * | bcksl quit (Changing host) |
23:11:00 | * | bcksl joined #nim |
23:14:47 | * | end` is now known as end |
23:58:44 | * | bcksl quit (Quit: \) |