00:22:18 | FromDiscord | <ElegantBeouf> Well bridge clearly died @Chronos [She/Her] https://github.com/nim-lang/atlas/blob/master/doc/atlas.md |
00:22:18 | FromDiscord | <kcvinker5420> sent a code paste, see https://play.nim-lang.org/#ix=4JSd |
00:22:27 | FromDiscord | <ElegantBeouf> you cannot define adestructor for ref |
00:22:37 | FromDiscord | <ElegantBeouf> use `new(T, finalizer)` here |
00:22:58 | FromDiscord | <kcvinker5420> Oh i see |
00:23:09 | FromDiscord | <ElegantBeouf> sent a code paste, see https://play.nim-lang.org/#ix=4JSe |
00:23:46 | FromDiscord | <kcvinker5420> Thanks |
00:23:54 | FromDiscord | <michaelb.eth> does Nimster with `inv2004` on GitHub chat here? |
00:24:03 | FromDiscord | <ElegantBeouf> Inv has chatted here iirc |
00:24:07 | FromDiscord | <michaelb.eth> (edit) "does Nimster with `inv2004` ... on" added "profile" |
00:37:13 | Amun-Ra | hmm, testament --targets=js works fine, testament with """targets: "js" """ always adds c to targets |
00:50:52 | FromDiscord | <kcvinker5420> What does this mean in Nim ? https://media.discordapp.net/attachments/371759389889003532/1166539336595013642/image.png?ex=654adb6b&is=6538666b&hm=2583fc2db239e2cc20c6067eb85c88a3aba606b25fc08582370c2274c4e7126d& |
00:51:14 | FromDiscord | <leorize> nothing right now |
00:51:48 | FromDiscord | <kcvinker5420> Is that an alternative to `defer` ? |
00:51:56 | FromDiscord | <leorize> nope |
00:57:29 | * | def- quit (Quit: -) |
00:57:42 | * | def- joined #nim |
01:39:24 | FromDiscord | <xtrayambak> treeform's trolling era, I suppose |
02:04:48 | * | Guest8518 quit (Quit: Leaving) |
03:18:25 | FromDiscord | <Phil> sent a long message, see http://ix.io/4JSZ |
03:23:07 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4JT2 |
03:23:30 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4JT2" => "https://play.nim-lang.org/#ix=4JT3" |
03:32:51 | * | azimut joined #nim |
03:37:54 | FromDiscord | <Phil> The alternative to that is you knowing the string at compile-time, then you could make yourself a getattr macro (I call it getField) like this:↵https://github.com/PhilippMDoerner/Snorlogue/blob/e068b59929668f97cceb0a82ca37d3ffca2e3545/src/snorlogue/utils/macroUtils.nim#L3 |
03:39:03 | FromDiscord | <Phil> That macro basically just turns X.getField("field") into the expression X.field at compile-time |
03:41:34 | FromDiscord | <Phil> The last alternative is doing this with object variants.↵Which will enable you to do it with syntax like in python but will have weird syntax limitations and be definitely more verbose |
03:42:46 | FromDiscord | <Phil> (edit) "variants.↵Which" => "variants (e.g. JsonNode).↵Which" | "variants (e.g. JsonNode).↵Whichwill enable you to do it with syntax ... likeverbose." added "kinda" | "verbose" => "verbose. Generally not what I would recommend" |
03:44:35 | * | m5zs7k quit (Quit: m5zs7k) |
03:45:25 | FromDiscord | <Elegantbeef> Assuming the types are all the same you can just use a `Table[string, T]` instead of an object |
03:45:27 | FromDiscord | <Elegantbeef> If the types are not the same there is no good way to do it |
03:45:40 | FromDiscord | <Elegantbeef> So object variants are the goto indeed 😄 |
03:47:00 | * | m5zs7k joined #nim |
03:51:20 | * | azimut quit (Ping timeout: 256 seconds) |
05:29:19 | * | azimut joined #nim |
05:46:46 | * | advesperacit joined #nim |
05:57:20 | FromDiscord | <Chronos [She/Her]> In reply to @elegantbeef "Well bridge clearly died": Epic, thanks |
06:03:26 | * | PMunch joined #nim |
06:41:04 | * | rockcavera quit (Remote host closed the connection) |
06:45:07 | * | CO2 joined #nim |
07:29:17 | arkanoid | hello! I have question. What's the Nim way to decompose modules in a way that developers of other modules only know the interface of the modules they depend on, without even seeing the inner complexity? The only way I know is proxy module with function aliases, or importc |
07:45:02 | * | lumidify quit (Quit: leaving) |
07:46:52 | FromDiscord | <nnsee> i've been doing it by only exporting stuff that i want the developers use and using `include` instead of `import` for my own things, but it's not very good... |
07:47:00 | * | lumidify joined #nim |
07:59:40 | FromDiscord | <Elegantbeef> Make a module with `import` and `export` |
08:01:37 | FromDiscord | <Chronos [She/Her]> Having a weird issue hm |
08:02:51 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4JTF |
08:04:51 | FromDiscord | <Elegantbeef> `proc (ctx: Context): Future[system.void] | UMeta` is not `HandlerAsync`? |
08:05:27 | FromDiscord | <Chronos [She/Her]> Idk why it's saying UMeta is getting returned is the thing |
08:06:00 | FromDiscord | <odexine> Well what’s the definition |
08:06:08 | FromDiscord | <odexine> Wait I forgot you sent a link |
08:06:33 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4JTG |
08:07:04 | FromDiscord | <Chronos [She/Her]> Ah wait |
08:07:11 | FromDiscord | <Chronos [She/Her]> Maybe because it isn't gcsafe |
08:07:38 | FromDiscord | <Chronos [She/Her]> That was the issue |
08:07:43 | FromDiscord | <Chronos [She/Her]> That was not clear at all |
08:15:44 | arkanoid | Elegantbeef, ok, but that puts a thin layer "here's your public functions and types and fields, but you don't see the code here, that's in another file". Not really decoupling |
08:16:55 | arkanoid | (I understand that this is the easiest way to solve half of the problem, I'm already using it) |
08:19:40 | FromDiscord | <Elegantbeef> I don't really see a way of separating this anotherway |
08:21:57 | arkanoid | Elegantbeef, this is another partial solution, but yeah it's not complete and more complicated, import/export still wins |
08:22:00 | arkanoid | https://dev.to/ringabout/zero-overhead-interface-exploration-in-nim-language-2b3d |
08:22:57 | FromDiscord | <Elegantbeef> Why do you want to do this? |
08:32:34 | arkanoid | I'm reading a book about software design (I like to step back into theory and phylosophy from time to time) and as all developer know one tool to reduce complexity is split into modules and decouple, I was just curious to know if I was missing something on this |
08:33:03 | FromDiscord | <Elegantbeef> There is no decoupling to be had though |
08:33:26 | arkanoid | what do you mean? |
08:33:29 | FromDiscord | <Elegantbeef> If you design your code and modules well enough `import x` and `import y` are features you can use to make code "decoupled" |
08:34:03 | FromDiscord | <Elegantbeef> Consider `import x, y` and `import x, z` if you use generics you can have different behaviour with those |
08:34:25 | FromDiscord | <Elegantbeef> Without having to write anything else, aslong as both modules expose the same procedure signatures it's fine |
08:36:04 | arkanoid | true |
08:38:50 | FromDiscord | <Elegantbeef> Though it'd be nice if there was a more extensive module system, but alas |
08:38:56 | FromDiscord | <Elegantbeef> Throw a penny in the well |
08:39:06 | arkanoid | but decoupling this way produces compilation errors that aren't as specific as a "missing implementation of interfaced spec" |
08:39:29 | arkanoid | but yeah, it's a simple solution that works |
08:39:31 | FromDiscord | <Elegantbeef> I mean you can write macros to specify a module needs specific procedures |
08:39:48 | FromDiscord | <Elegantbeef> so you could do `import x as bleh` inside a when statement |
08:40:19 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimtrest/wiki/Code-snippets#check-if-a-module-has-a-proc using something like this |
08:41:15 | arkanoid | typ? |
08:42:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JTK |
08:42:26 | FromDiscord | <Elegantbeef> It's a parameter of the template |
08:42:45 | arkanoid | oh sorry for that, my fault |
08:44:50 | arkanoid | sure, this would enable writing an "interface module", with all exported procs = discard |
08:45:11 | FromDiscord | <Elegantbeef> No you wouldn't need it |
08:45:11 | arkanoid | or maybe with more sure, quite sure the are multiple interface packages out there |
08:45:15 | FromDiscord | <Elegantbeef> You'd just `export bleh` |
08:45:48 | FromDiscord | <Elegantbeef> If you know your module matches your interface you just export it there is no issue |
08:45:50 | arkanoid | yes you always need it, as that's what you give to another developer that has to interface with your code, without seeing it |
08:46:17 | arkanoid | it's just a form of documentation that is checked a compile time |
08:47:18 | FromDiscord | <Elegantbeef> If you want docgen you can do your dummy proc method |
08:47:19 | FromDiscord | <Elegantbeef> But aside from docgen there is very little reason imo to decouple anything |
08:47:19 | FromDiscord | <Elegantbeef> Needlessly aliasing procedures introduces an extra step to the proc |
08:47:51 | FromDiscord | <Elegantbeef> Anyway I'm going to take tired ramblings elsewhere |
08:49:57 | arkanoid | sure, I understand that this is adding complexity, when Nim by design seems to suggest that you don't really need that feature, and I partly agree |
08:50:00 | advesperacit | My impression is that your idea is "reducing complexity" by adding different complexity |
09:00:38 | arkanoid | advesperacit: same thing I've just been saying |
09:01:19 | arkanoid | the point is: how to add this feature introducing the minimum amount of complexity |
09:01:35 | arkanoid | and the answer may possibly be: you don't |
09:02:05 | advesperacit | the feature seems to be complexity so not doing it seems the correct course of action yes |
09:02:29 | arkanoid | no, feature is decoupling via interfaces |
09:03:29 | arkanoid | if you ever worked with a language supporting these, mocking interfaces is a perfect way to decouple |
09:04:42 | arkanoid | there's the "real thing", the "thing to simulate the real thing to be used internally for testing", both implements the same interface, you share the interface, and the mocking thing |
09:31:37 | * | LittleRedBox joined #nim |
10:15:11 | * | LittleRedBox quit (Quit: Client closed) |
11:06:34 | * | beholders_eye joined #nim |
12:13:01 | * | adigitoleo_ joined #nim |
12:29:23 | * | naruto69 joined #nim |
12:36:33 | naruto69 | Read about it! Naruto Has Ninja Sex with Nuevo Leon Governor Samuel Garcia ------ Naruto grinned and formed the seals for a new jutsu he had been working on. "It's called the Ketsuryugan," he explained, "It's like a rasengan, but instead of spinning chakra, it's a concentrated blast of pleasure that stimulates the rectum and prostate." Samuel Garcia's eyebrows shot up in surprise, but he was clearly intrigued. "Sounds interesting. Can you show me how |
12:36:36 | naruto69 | it works?" https://justpaste.it/Naruto_Makes_Love_Samuel_Garcia |
12:40:37 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/0WDFy |
12:40:52 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4JUn" => "https://play.nim-lang.org/#ix=4JUo" |
12:49:37 | FromDiscord | <mratsim> In reply to @isofruit "Before I go with": no. specialization works between a concrete and a generic type |
12:49:52 | FromDiscord | <mratsim> when there are 2 generics that match, they are ambiguous |
12:50:15 | FromDiscord | <Phil> Isn't just `enum` also a generic? |
12:50:16 | arkanoid | wow, this seems something that also nim can do nicely with some compile time machinery https://flawless.dev/ |
12:50:41 | FromDiscord | <mratsim> In reply to @isofruit "Isn't just `enum` also": `auto` and `T: enum` are generics yes |
12:51:11 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4JUp |
12:51:24 | FromDiscord | <Phil> And I'd considered using `enum` as parameter type also a kind of generic, like `SomeNumber` |
12:52:17 | FromDiscord | <mratsim> In reply to @arkanoid "wow, this seems something": Are they reinventing continuations? |
12:52:22 | naruto69 | Read about it! Naruto Has Ninja Sex with Nuevo Leon Governor Samuel Garcia ------ Naruto grinned and formed the seals for a new jutsu he had been working on. "It's called the Ketsuryugan," he explained, "It's like a rasengan, but instead of spinning chakra, it's a concentrated blast of pleasure that stimulates the rectum and prostate." Samuel Garcia's eyebrows shot up in surprise, but he was clearly intrigued. "Sounds interesting. Can you show me how |
12:52:22 | naruto69 | it works?" https://justpaste.it/Naruto_Makes_Love_Samuel_Garcia |
12:53:03 | arkanoid | mratsim, continuations with wasm trampoline? |
12:54:31 | FromDiscord | <mratsim> In reply to @arkanoid "<@570268431522201601>, continuations with wasm": if you lose connection or anything, you can restart from the continuation |
12:54:59 | FromDiscord | <mratsim> without needing to do side-effects done previously, and compare to them, without recomputing anything either |
12:55:14 | arkanoid | mratsim, but you aren't in a sandbox |
12:55:48 | FromDiscord | <nnsee> but you are |
12:55:54 | FromDiscord | <nnsee> you can't use anything from the stdlib |
12:56:08 | FromDiscord | <nnsee> which is why they're using the flawless namespace when calling procs |
12:56:12 | FromDiscord | <nnsee> that's their sandbox |
12:57:26 | FromDiscord | <nnsee> didn't nimskull do continuations? |
12:57:30 | FromDiscord | <nnsee> https://github.com/nim-works/cps |
12:58:46 | arkanoid | nnsee, I'm not following you |
12:58:47 | FromDiscord | <mratsim> In reply to @arkanoid "<@570268431522201601>, but you aren't": continuations are generic programming. The main issue is calling convention, same as Go, or Cilk. |
12:59:18 | FromDiscord | <nnsee> what do you mean by sandbox? |
12:59:24 | FromDiscord | <mratsim> Ras is saying that flawless code have a sandbox because they need to replace http::get with flawless::htttp::get |
13:00:22 | arkanoid | maybe I don't know enough about continuations or wasm, but being wasm a completely different ABI, I think it would give much stronger isolation and encapsulation compared to continuations |
13:00:54 | naruto69 | Read about it! Naruto Has Ninja Sex with Nuevo Leon Governor Samuel Garcia ------ Naruto grinned and formed the seals for a new jutsu he had been working on. "It's called the Ketsuryugan," he explained, "It's like a rasengan, but instead of spinning chakra, it's a concentrated blast of pleasure that stimulates the rectum and prostate." Samuel Garcia's eyebrows shot up in surprise, but he was clearly intrigued. "Sounds interesting. Can you show me how |
13:00:55 | naruto69 | it works?" https://justpaste.it/Naruto_Makes_Love_Samuel_Garcia |
13:00:56 | arkanoid | yet I see similarities, and how continuation can solve kinda same problem |
13:01:21 | naruto69 | Here is a sample nnsee: Naruto's heart sank as Samuel Garcia explained that he had promised to impregnate his wife Mariana with Naruto's semen to ensure their child would have green or blue eyes. Naruto was taken aback by this revelation, but Samuel Garcia quickly continued. |
13:01:21 | naruto69 | |
13:01:21 | naruto69 | "Actually, I have some good news," Samuel Garcia said, a smile creeping across his face. "Your semen did indeed impregnate Mariana, and the ultrasound showed triplets!" |
13:01:59 | FromDiscord | <nnsee> i'm sorry what |
13:02:05 | FromDiscord | <leorize> you can use cps to build something that works the same |
13:02:07 | FromDiscord | <leorize> what wasm gives you is the lack of requirement for performing any transform at the code level |
13:02:12 | FromDiscord | <ieltan> lol |
13:02:20 | FromDiscord | <leorize> just preempt the execution and you can do whatever |
13:02:25 | naruto69 | leorize Read about it! Naruto Has Ninja Sex with Nuevo Leon Governor Samuel Garcia ------ Naruto grinned and formed the seals for a new jutsu he had been working on. "It's called the Ketsuryugan," he explained, "It's like a rasengan, but instead of spinning chakra, it's a concentrated blast of pleasure that stimulates the rectum and prostate." Samuel Garcia's eyebrows shot up in surprise, but he was clearly intrigued. "Sounds interesting. Can you show |
13:02:25 | naruto69 | me how it works?" https://justpaste.it/Naruto_Makes_Love_Samuel_Garcia |
13:03:08 | FromDiscord | <nnsee> <@&371760044473319454> uhhhh |
13:03:10 | arkanoid | also with wasm you can handle the unsafe code as a plugin? |
13:04:07 | FromDiscord | <leorize> what does that even mean? |
13:05:32 | naruto69 | ieltan Read about it! Naruto Has Ninja Sex with Nuevo Leon Governor Samuel Garcia ------ Naruto grinned and formed the seals for a new jutsu he had been working on. "It's called the Ketsuryugan," he explained, "It's like a rasengan, but instead of spinning chakra, it's a concentrated blast of pleasure that stimulates the rectum and prostate." Samuel Garcia's eyebrows shot up in surprise, but he was clearly intrigued. "Sounds interesting. Can you show |
13:05:32 | naruto69 | me how it works?" https://justpaste.it/Naruto_Makes_Love_Samuel_Garcia |
13:07:00 | arkanoid | thanks PMunch |
13:07:09 | PMunch | Of course |
13:07:21 | PMunch | Just had to find the guide on how to ban people on IRC :P |
13:07:28 | FromDiscord | <leorize> their origin is irc, is it that time of the year again |
13:08:12 | FromDiscord | <nnsee> PMunch: you didn't get all of the messages in Discord btw |
13:08:52 | PMunch | Better? |
13:08:57 | FromDiscord | <nnsee> yup, thanks |
13:13:33 | FromDiscord | <Phil> I go away to delete some code for 10 minutes |
13:13:44 | FromDiscord | <Phil> And you people catch an IRC spammer in my absence |
13:13:45 | FromDiscord | <Phil> tsk tsk |
13:21:52 | arkanoid | leorize, could you please explain how continuations compare to running functions in wasm? |
13:22:13 | * | naruto69 left #nim (#nim) |
13:23:47 | FromDiscord | <leorize> what is there to compare? |
13:24:08 | FromDiscord | <leorize> functions in wasm is the same as functions anywhere else |
13:24:52 | * | xet7 quit (Remote host closed the connection) |
13:25:19 | FromDiscord | <leorize> the only thing you get is the same perk enjoyed by all VM-based languages\: you got a runtime that can manage how the execution proceed |
13:25:35 | PMunch | I wonder what that Naruto spammer hoped to get out of their thing.. Just to share their strange fan-fiction? |
13:26:13 | FromDiscord | <leorize> cps on the other hand is purely a code transform with no runtime requirement |
13:26:36 | arkanoid | leorize, and encapsulation, isolation, etc. Otherwise there would be a {.wasmcall.} |
13:26:45 | FromDiscord | <leorize> for the purposes of this flawless engine, you can do the same thing with both |
13:27:32 | FromDiscord | <leorize> isn't all that just runtime-powered things?↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>) |
13:27:44 | FromDiscord | <leorize> and wasmcall exists \:p |
13:28:17 | arkanoid | does it? lol, I just made it up |
13:28:56 | arkanoid | ok, then, how can I ensure encapsulation and isolation with continuations? |
13:29:18 | FromDiscord | <leorize> what are you aiming for with your invariant? |
13:29:28 | FromDiscord | <Chronos [She/Her]> Wasm is cool, I wish I had a use for it rn |
13:29:39 | FromDiscord | <leorize> what does encapsulation and isolation mean in this context? |
13:30:01 | adigitoleo_ | PMunch: got the link to that guide? The same spammer is still active on #python |
13:30:20 | adigitoleo_ | I |
13:30:40 | adigitoleo_ | I'm not an admin there but maybe sharing it there would get the ball moving |
13:30:59 | FromDiscord | <leorize> yea it's that time of the year again |
13:31:44 | FromDiscord | <leorize> report it to #libera and see if they're seeing a wave of spammers |
13:32:11 | FromDiscord | <leorize> they will probably turn their anti spam tools on when it becomes a big issue |
13:34:54 | PMunch | adigitoleo_, it's this thing: https://github.com/nim-lang/Nim/wiki/IRC-guidelines |
13:55:37 | FromDiscord | <nnsee> In reply to @PMunch "I wonder what that": maybe people reading their smut is their kink? it's just strange all around, to set up a spam campaign for... this |
13:56:32 | PMunch | Yeah, I mean wouldn't it suffice to just manually post it around? |
13:59:09 | * | rockcavera joined #nim |
14:00:14 | * | CO2 quit (Quit: WeeChat 4.1.0) |
14:00:33 | * | PMunch quit (Quit: Leaving) |
14:15:48 | FromDiscord | <nnsee> localhost:2375↵Error↵Request failed with status code 404 |
14:15:57 | FromDiscord | <nnsee> whoops, sorry about that |
14:16:25 | FromDiscord | <nnsee> pet peeve I have with VMs: text fields don't know they're not actually focused and blink as if they are :p |
14:19:35 | * | Onionhammer quit (Quit: Ping timeout (120 seconds)) |
14:19:50 | * | Onionhammer joined #nim |
14:25:22 | * | CO2 joined #nim |
15:33:59 | FromDiscord | <Chronos [She/Her]> Can Debby only do ref objects? If so, that's a pain |
15:34:49 | FromDiscord | <Chronos [She/Her]> Well not a pain |
15:34:53 | FromDiscord | <Chronos [She/Her]> Just, meh |
15:51:35 | * | beholders_eye quit (Ping timeout: 240 seconds) |
16:25:05 | FromDiscord | <Phil> In reply to @chronos.vitaqua "Well not a pain": Why so geared towards value types? |
16:28:13 | FromDiscord | <Chronos [She/Her]> No reason besides it looking nice (and being immutable in `let` defs) |
17:02:29 | * | rockcavera quit (Remote host closed the connection) |
17:09:06 | FromDiscord | <Chronos [She/Her]> sent a long message, see http://ix.io/4JVX |
17:11:08 | FromDiscord | <odexine> 1. latency does become an issue that you have to manage, yes↵2. yes, if you spin up multiple instances each pinned to different cores↵3. theoretically i think so? practically of course↵4. what do you mean? |
17:12:00 | FromDiscord | <odexine> 1. addendum: latency might be better if you're hitting the limits of horizontal scaling sure |
17:12:41 | * | beholders_eye joined #nim |
17:14:25 | FromDiscord | <Chronos [She/Her]> By 4 I mean that, PostgreSQL has a maximum amount of connections it can have at a time, and if you have a big product (think something on Discord's level) that has to be massively scaled upwards, how do you avoid the issue of running out of connections? |
17:14:35 | FromDiscord | <Chronos [She/Her]> Discord doesn't use Postgres or Redis but yeah |
17:15:10 | FromDiscord | <odexine> you increase the practical limit by making more instances, getting more servers, etc |
17:17:39 | FromDiscord | <odexine> do you really need to worry about the limits right now? are you actually hitting 10000+ concurrent connections? |
17:17:51 | FromDiscord | <odexine> redis can be configured to handle even more than that given enough ram |
17:18:02 | FromDiscord | <odexine> iirc the ballpark is 3 or something connections per megabyte |
17:18:41 | FromDiscord | <odexine> so if you have 8 whole gigabytes of memory you could prolly do 25ish thousand concurrent |
17:18:56 | FromDiscord | <odexine> personally i'd just not worry until i actually hit the problem |
17:19:02 | FromDiscord | <odexine> or am close to it |
17:27:49 | FromDiscord | <Chronos [She/Her]> This is actually just out of pure curiosity, I'd never hit those limits ever |
17:40:38 | FromDiscord | <odexine> okay then yeah |
17:40:42 | FromDiscord | <odexine> (edit) "okay" => "okay," |
17:47:42 | FromDiscord | <Chronos [She/Her]> The random module shoooould be enough for generating random strings for OAuth states :p |
17:47:51 | FromDiscord | <odexine> uh oh |
17:47:55 | FromDiscord | <odexine> someones gonna get mad at you for that |
17:48:00 | FromDiscord | <odexine> @ mra |
17:48:44 | FromDiscord | <Chronos [She/Her]> Lmao |
17:49:11 | FromDiscord | <Chronos [She/Her]> Fineeeee I'll use sysrand |
17:50:08 | FromDiscord | <Chronos [She/Her]> I'll even cast the bytes from it into a uint64 😛 |
17:50:21 | FromDiscord | <Chronos [She/Her]> Joking about that one lol |
17:51:19 | FromDiscord | <odexine> i feel like someone's gonna pop a vein from thatsooner or later |
17:51:22 | FromDiscord | <odexine> (edit) "thatsooner" => "that sooner" |
17:51:55 | * | rockcavera joined #nim |
17:52:00 | FromDiscord | <Chronos [She/Her]> What's wrong with sysrand? Urandom has been shown to be secure |
17:52:08 | FromDiscord | <odexine> no, i mean from the cast xd |
17:52:18 | FromDiscord | <Chronos [She/Her]> Ah lmao |
17:52:26 | FromDiscord | <Chronos [She/Her]> I do that in my NULID library lmao |
17:52:42 | FromDiscord | <Chronos [She/Her]> I should probably remove all uses of casting in it, tbh |
17:52:50 | FromDiscord | <Chronos [She/Her]> Since it doesn't work on the Nim VM :p |
17:54:19 | FromDiscord | <Phil> at enterprise levels my experience has been that Redis is just a cache to check |
17:55:09 | FromDiscord | <Phil> I haven't used it for that purpose yet because we only had a usecase for redis for message-brokering between multiple pods of the same kind of server instance though |
17:56:11 | * | junaid_ joined #nim |
17:57:42 | FromDiscord | <Chronos [She/Her]> Fair |
17:59:12 | FromDiscord | <Chronos [She/Her]> Hm... Currently trying to figure out how my server (the API) would validate the state |
17:59:35 | FromDiscord | <Chronos [She/Her]> I can't use cookies because with APIs that's kinda painful, and even then, they aren't exactly secure |
18:00:06 | FromDiscord | <Chronos [She/Her]> And I'm not sure how I'd store it on the server and ensure that the same client that originally accessed it, is still the same client |
18:01:35 | FromDiscord | <Chronos [She/Her]> I mean, Prologue does have sessions |
18:02:22 | FromDiscord | <Chronos [She/Her]> Redis would definitely be suited for this |
18:02:37 | FromDiscord | <Chronos [She/Her]> Don't wanna do Redis stuff yet though, will keep it to memory for now |
18:03:16 | FromDiscord | <Phil> I mean, Redis is something you pull out when you are already in the medium big leagues |
18:03:57 | FromDiscord | <Phil> It's a caching solution for when your postgresql is no longer fast enough for the traffick you're receiving |
18:04:15 | FromDiscord | <Phil> Though I guess you can also use it as your primary Db if you really wanna play around with it |
18:04:23 | FromDiscord | <Phil> (edit) "Though I guess you can also use it as your primary Db if you really wanna play around with it ... " added "rather than having a postgres" |
18:05:19 | FromDiscord | <Chronos [She/Her]> Ah fair |
18:05:29 | FromDiscord | <Chronos [She/Her]> Was just using it for session middleware :p |
18:05:35 | FromDiscord | <Chronos [She/Her]> Memory session should be fine for now |
18:06:26 | * | azimut quit (Ping timeout: 256 seconds) |
18:06:37 | * | advesperacit quit (Ping timeout: 255 seconds) |
18:06:51 | FromDiscord | <typistx> new to nim, website says it's only regularly tested for amd64 and x86 https://nim-lang.org/docs/packaging.html , I got quite some issues on Mac M2(nimble failed to install pixels etc), is it production ready for arm, aarch64, risc-v32 and risc-v64 |
18:07:15 | * | advesperacit joined #nim |
18:07:50 | FromDiscord | <leorize> nim does not have continuous testing for anything but amd64 and x86 |
18:10:43 | FromDiscord | <typistx> why not use github-action for more architectures? qemu can be used for backend if not enough hardware, better than no test at all |
18:11:14 | FromDiscord | <leorize> no one contributed any such thing is the answer |
18:13:07 | FromDiscord | <leorize> well no one is not really correct, but rather it ended up being stale\: https://github.com/nim-lang/Nim/pull/16396 |
18:13:32 | * | junaid_ quit (Remote host closed the connection) |
18:13:40 | * | krux02 joined #nim |
18:15:31 | FromDiscord | <Chronos [She/Her]> I'm so confused why the state I'm passing to the client won't be set correctly |
18:15:35 | * | beholders_eye quit (Ping timeout: 240 seconds) |
18:23:39 | FromDiscord | <Chronos [She/Her]> I'm getting so frustrated rn, this code https://play.nim-lang.org/#ix=4JWA is keep redirecting me to GitHub for the auth flow, which is what should happen, but for some bizarre reason, the state from GitHub is kept getting set to `A` (I used that originally for debugging) and the new state doesn't work with the 'flash' messages |
18:25:28 | FromDiscord | <Chronos [She/Her]> I've made sure to check my code, `state` isn't hardcoded to "A" anywhere, and no matter what, the code just isn't logging what the `redirectUrl` is or if `state` is set to "A" |
18:26:34 | FromDiscord | <Chronos [She/Her]> `assert state == "A"` raises an AssertionDefect |
18:27:47 | FromDiscord | <fabric.input_output> sent a code paste, see https://play.nim-lang.org/#ix=4JWC |
18:28:01 | FromDiscord | <Chronos [She/Her]> `writeFile` also doesn't write which is odd |
18:30:38 | FromDiscord | <fabric.input_output> In reply to @fabric.input_output "why is this error": I think I know why this error might be occuring, the error message is very undescriptive though |
18:35:58 | FromDiscord | <Chronos [She/Her]> God this is so annoying and painful |
18:37:36 | FromDiscord | <leorize> you're lucky that it isn't due to concepts \:P↵(@fabric.input_output) |
18:41:45 | FromDiscord | <Chronos [She/Her]> So annoyed oh my god why won't this work |
18:43:37 | FromDiscord | <michaelb.eth> when would it be preferable to have a `seq[var T]` instead of `var seq[T]`? |
18:47:54 | FromDiscord | <odexine> mutating only the elements but not the size of the sequence? dunno |
18:49:24 | FromDiscord | <Chronos [She/Her]> I am going to tear my hair out |
18:51:25 | FromDiscord | <Chronos [She/Her]> This makes no sense |
18:52:52 | FromDiscord | <guttural666> how do easily find out what exceptions a function in the stdlib can throw without sifting through the source code? |
18:53:08 | FromDiscord | <leorize> never because the former doesn't work \:P↵(@michaelb.eth) |
18:53:22 | FromDiscord | <Chronos [She/Her]> In reply to @guttural666 "how do easily find": Normally in the pragmas, when expanding them you can see the `raises` pragma |
18:53:30 | FromDiscord | <Chronos [She/Her]> Not all stdlib modules use it though |
18:54:55 | FromDiscord | <guttural666> can I generically catch all exceptions? |
18:55:17 | FromDiscord | <leorize> `try: code except CatchableException: handler` |
18:55:58 | FromDiscord | <guttural666> CatchableException just catches everything? don't really care in my case |
18:56:08 | FromDiscord | <Chronos [She/Her]> You can also catch defects with `except Exception` (p.s, CatchableError, not CatchableException :p) |
18:56:32 | FromDiscord | <guttural666> CatchableError it seems |
18:56:39 | FromDiscord | <guttural666> yes |
18:56:44 | FromDiscord | <Chronos [She/Her]> Though if the program is compiled with `panics:on`, defects will panic and program won't catch the defects |
18:58:03 | FromDiscord | <guttural666> what is considered a "defect"? just any exception? |
18:58:45 | FromDiscord | <odexine> any exception inheriting from Defect |
18:58:53 | FromDiscord | <guttural666> or what is the diff between CatchableException and Exception |
18:58:57 | FromDiscord | <odexine> aka if it has Defect in the name |
18:58:58 | FromDiscord | <michaelb.eth> In reply to @leorize "never because the former": I saw it somewhere and tried a simple thing like that in the playground, does compile/run |
18:59:04 | FromDiscord | <guttural666> ok |
18:59:12 | FromDiscord | <guttural666> thanks! |
18:59:13 | FromDiscord | <michaelb.eth> (edit) "thing like that" => "use of it" |
18:59:24 | FromDiscord | <odexine> In reply to @guttural666 "or what is the": Catchable inherits from Exception |
18:59:40 | FromDiscord | <Chronos [She/Her]> In reply to @guttural666 "or what is the": `CatchableError` inherits from `Exception`, `Defect` inherits from `Exception` |
18:59:42 | FromDiscord | <odexine> Exception is the "root" type that's the parent of Catchable and Defect |
19:00:03 | FromDiscord | <guttural666> gonna take Exception then |
19:00:25 | FromDiscord | <odexine> In reply to @guttural666 "gonna take Exception then": as stated, your program will crash if someone uses --panics:on |
19:00:51 | FromDiscord | <leorize> `var T` is a view/borrow, similar to C++ `&type`, so they're like mini pointers↵(@michaelb.eth) |
19:00:55 | FromDiscord | <michaelb.eth> In reply to @guttural666 "ok": depending on your pov/religion/politics, you think of `Defect` as uncatchable and raise one when the error should cause a crash |
19:01:02 | FromDiscord | <leorize> you should never put them in a seq tbh |
19:01:14 | FromDiscord | <guttural666> it's a small webscraper so no worries, this should be suitable then: https://media.discordapp.net/attachments/371759389889003532/1166813735680225370/image.png?ex=654bdaf8&is=653965f8&hm=acc457d060a2009d3bc46c1a43279972fdd61e3e6328bd29d6b55ba92f6cb05a& |
19:01:33 | FromDiscord | <leorize> if you're doing `except Exception`, might as well just `except:` |
19:01:54 | FromDiscord | <guttural666> In reply to @leorize "if you're doing `except": if that works, I'll take it 😛 |
19:01:55 | FromDiscord | <leorize> bare except is the same as `except Exception`, even if nim can't stop being an ass about it |
19:02:01 | FromDiscord | <michaelb.eth> (edit) "crash" => "crash, likewise never try to catch a Defect or Exception, only CatchableError" |
19:03:07 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=4JWO |
19:03:58 | FromDiscord | <michaelb.eth> In reply to @user2m "how do I write": how are constructing the instance? |
19:04:22 | FromDiscord | <michaelb.eth> should be e.g. `thing[int]()` |
19:06:11 | FromDiscord | <leorize> but how are you using it? |
19:06:11 | FromDiscord | <leorize> you're writing it correctly |
19:06:15 | FromDiscord | <user2m> ahhh you are correct! |
19:12:15 | FromDiscord | <user2m> I was just doing `thing(stuff:@[person(age:1,name:"hello")])` I should have been doing `thing[person](stuff:@[person(age:1,name:"hello")])` |
19:19:52 | FromDiscord | <guttural666> QT has something like this in its QString class, is there anything like it built in into Nim? otherwise I'm going to write my own version: https://media.discordapp.net/attachments/371759389889003532/1166818426505932950/image.png?ex=654bdf57&is=65396a57&hm=d82fe9b95c1378693b2be6e697378bc9b9780b614c17b862598d0c44f78d43f5& |
19:20:32 | FromDiscord | <Chronos [She/Her]> My redirect URL is not being set correctly for some reason... Ugh |
19:22:39 | FromDiscord | <Chronos [She/Her]> Where is "A" coming from, I don't get it |
19:23:59 | FromDiscord | <leorize> `strutils.format` is what you want↵(@guttural666) |
19:24:02 | FromDiscord | <leorize> there's also the `strutils.%` operator |
19:24:41 | FromDiscord | <guttural666> gonna check that out thank you very much |
19:26:37 | om3ga | guys, can nim compiler generate c99? |
19:27:15 | ehmry | om3ga: nim doesn't generate strict C, it uses de facto standard extensions |
19:28:10 | om3ga | ehmry: which extensions, sorry I don't understand |
19:28:19 | ehmry | om3ga: alignof |
19:28:52 | om3ga | aah so it will be c11 |
19:29:21 | om3ga | ehmry: thanks |
19:29:40 | ehmry | om3ga: could be, alignof gave me grief with older compilers |
19:30:21 | ehmry | it would be nice to have a commitment to c11, if there isn't one already |
19:30:47 | om3ga | I having fun with old compilers. undfortunately I will be not able to test nim with pcc |
19:32:29 | ehmry | yea, not the plan9 compilers either |
19:32:42 | * | jmdaemon joined #nim |
19:43:58 | FromDiscord | <Chronos [She/Her]> Anyone know how I'd do breakpoints and such with Nim? |
19:44:29 | FromDiscord | <leorize> load up your favorite debugger and add breakpoints? |
19:44:44 | FromDiscord | <Chronos [She/Her]> Not sure how it even works tbh |
19:45:11 | FromDiscord | <leorize> you're a vscode user, right? |
19:46:19 | FromDiscord | <leorize> remember to build your executable with `--debugger:native` and you can use https://code.visualstudio.com/docs/cpp/cpp-debug for debugging |
19:46:44 | FromDiscord | <Chronos [She/Her]> Yep |
19:46:55 | FromDiscord | <Chronos [She/Her]> Alright, thanks! |
19:56:43 | * | beholders_eye joined #nim |
20:16:05 | * | jmdaemon quit (Ping timeout: 255 seconds) |
20:48:09 | * | xet7 joined #nim |
20:51:20 | * | jmdaemon joined #nim |
20:57:22 | FromDiscord | <fabric.input_output> bruh why is the nim type system so broke 😭 |
20:58:12 | FromDiscord | <Elegantbeef> What now? |
21:02:01 | NimEventer | New thread by Hobbyman: How do i look into this runtime-failure?, see https://forum.nim-lang.org/t/10567 |
21:03:33 | FromDiscord | <Chronos [She/Her]> Is `ctx` per-user or per-route? |
21:10:45 | FromDiscord | <Chronos [She/Her]> Not sure how I'm supposed to store a state about a user without some identifiable info |
21:10:51 | FromDiscord | <Chronos [She/Her]> Sessions aren't working so... |
21:11:02 | FromDiscord | <Chronos [She/Her]> (edit) "Not sure how I'm supposed to store a state about a user without some identifiable info ... " added "and idk what info that'd be" |
21:18:33 | FromDiscord | <Chronos [She/Her]> Would storing it in a global list be bad for safety? :p |
21:19:39 | FromDiscord | <leorize> what are you trying to achieve? |
21:25:15 | FromDiscord | <Chronos [She/Her]> GitHub OAuth state checking |
21:26:13 | FromDiscord | <Chronos [She/Her]> I'm actually a bit confused... OAuth login has to be done in a browser, right? |
21:26:23 | FromDiscord | <Chronos [She/Her]> Why am I being complicated here |
21:26:43 | * | jmdaemon quit (Ping timeout: 264 seconds) |
21:31:08 | * | jmdaemon joined #nim |
21:33:48 | FromDiscord | <guttural666> Nim compiler being an unhelpful cunt, abap_words is not modifiable / var should be the output, instead I get the has no type shite https://media.discordapp.net/attachments/371759389889003532/1166852132104831006/image.png?ex=654bfebb&is=653989bb&hm=4099e708d0f3e1d7e005423cd41b04e944d6965821cb6310c690a56db228bef1& |
21:36:41 | Amun-Ra | but line before that you get something else |
21:38:20 | Amun-Ra | there's no mitems iterator for non-var data |
21:38:39 | Amun-Ra | that's why you get udeclared field 'mitems' |
21:40:04 | FromDiscord | <guttural666> that's just the follow up error |
21:40:39 | FromDiscord | <guttural666> the root cause was that abap_words was not modifiable |
21:40:42 | Amun-Ra | right, so it really doesn't matter |
21:41:38 | FromDiscord | <guttural666> maybe I'm overestimating the power of compilers |
21:42:28 | Amun-Ra | the problem is with the way you use the mpair (and you're using is the way I am) |
21:43:15 | Amun-Ra | when it's written as data.mitems and the compiler can't find matching signature it really doesn't know whether it's a function or attribute |
21:43:27 | FromDiscord | <guttural666> I was stupid an I apologize for being mad at the compiler gods 😄 |
21:43:30 | FromDiscord | <guttural666> I know |
21:43:35 | Amun-Ra | that's why data.mitems prduce Error: undeclared field: 'mitems' |
21:43:41 | Amun-Ra | but, change it to mitems data |
21:43:42 | FromDiscord | <guttural666> yeah |
21:44:12 | Amun-Ra | …and you'll have much clearer message |
21:44:27 | Amun-Ra | these are the pros and cons of uniform function call :> |
21:44:57 | FromDiscord | <guttural666> can you elaborate? |
21:45:11 | FromDiscord | <guttural666> don't quite get it |
21:45:25 | Amun-Ra | https://play.nim-lang.org/#ix=4JXx |
21:46:09 | Amun-Ra | mitems data or mitems(data) can't be an attribute of an object so it must be a function |
21:46:37 | Amun-Ra | that's why nim lists all the mitems functions it has in this example |
21:46:55 | Amun-Ra | granted, it should display it in the former example, you can file a PR :) |
21:47:10 | Amun-Ra | I mean feature request |
21:51:06 | FromDiscord | <guttural666> yeah, I'm beginning to hate UFCS, I'm becoming a fan of "there is one way to do x", ambiguity is just useless noise |
21:52:23 | Amun-Ra | well, I love it |
21:52:40 | FromDiscord | <Elegantbeef> Meh this isnt UFCS, this is iterators |
21:52:55 | Amun-Ra | UICS ;> |
21:52:57 | FromDiscord | <leorize> wait until you see command call |
21:53:08 | FromDiscord | <Elegantbeef> If iterators were not special classed this wouldnt be an issue |
21:53:11 | FromDiscord | <guttural666> I love it too, I am a pervert. echo "pls" is awesome, but otherwise I try to use pls.func() only |
21:53:19 | Amun-Ra | I see |
21:53:49 | FromDiscord | <guttural666> sometimes pls.func |
21:54:18 | Amun-Ra | I try to write code in a way to avoid using as few () as possible |
21:54:37 | FromDiscord | <Elegantbeef> Spoken like someone that used Lisp |
21:54:46 | Amun-Ra | :P |
21:55:17 | FromDiscord | <guttural666> I dunno, I would welcome order imposed on me by smarter programmers |
22:04:56 | FromDiscord | <Chronos [She/Her]> Cookies don't even work here sigh |
22:05:14 | FromDiscord | <Elegantbeef> Cookies never work, try biscuits |
22:05:36 | FromDiscord | <Chronos [She/Her]> Any ideas on how I'd store the state for GitHub auth, Beef? :p |
22:06:00 | FromDiscord | <Elegantbeef> Using a github token that you can request from github |
22:06:04 | FromDiscord | <Chronos [She/Her]> State is a value you have to check for verifying that the request is legitimate, buuuut idk how to do that |
22:06:13 | FromDiscord | <Elegantbeef> Unless you mean on the server |
22:06:22 | FromDiscord | <Chronos [She/Her]> On the server temporarily |
22:06:27 | FromDiscord | <Chronos [She/Her]> This is for OAuth |
22:06:53 | FromDiscord | <Elegantbeef> Yea this is practical dev, which means it's beyond me |
22:08:38 | FromDiscord | <Chronos [She/Her]> Right now it's `Me{State} -> GitHub{Code, State=Me{State}} -> Me{Github{Code, State}}` but it needs to be `Me{State} -> GitHub{Code, State=Me{State}} -> Me{State, Github{Code, State}}` just can't figure out how I'd ensure the state from GitHub is the same as mine bc I don't have any other identifying info |
22:08:44 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Yea this is practical": Rip |
22:10:42 | * | def- quit (Quit: -) |
22:11:00 | * | def- joined #nim |
22:12:30 | * | advesperacit quit () |
22:41:13 | * | adigitoleo_ quit (Remote host closed the connection) |
22:41:40 | FromDiscord | <Chronos [She/Her]> I don't have any solution for this... Ugh |
22:44:02 | FromDiscord | <pcarrier> what's the type of seq indices? |
22:45:47 | FromDiscord | <Chronos [She/Her]> In reply to @chronos.vitaqua "I don't have any": Besides storing it in a list but that's a bit... Gross ig? |
22:46:10 | FromDiscord | <Chronos [She/Her]> In reply to @pcarrier "what's the type of": `int` if I understood your question right |
22:46:51 | FromDiscord | <pcarrier> @Chronos [She/Her] I think you did. is int guaranteed to be the size of pointers? |
22:46:58 | FromDiscord | <pcarrier> (edit) "pointers?" => "pointers on every platform?" |
22:47:44 | FromDiscord | <Chronos [She/Her]> I'd imagine so |
22:56:25 | * | jmdaemon quit (Ping timeout: 255 seconds) |
23:41:38 | * | beholders_eye quit (Ping timeout: 258 seconds) |
23:45:25 | * | krux02 quit (Remote host closed the connection) |
23:54:41 | FromDiscord | <typistx> hard to believe nim does not officially support arm and riscv and there are no plans for that either |
23:55:08 | FromDiscord | <typistx> thinking about using nim on arm/riscv embedded boards |
23:57:51 | FromDiscord | <pcarrier> how do I copy the contents of a ref? |