<< 25-10-2023 >>

00:22:18FromDiscord<ElegantBeouf> Well bridge clearly died @Chronos [She/Her] https://github.com/nim-lang/atlas/blob/master/doc/atlas.md
00:22:18FromDiscord<kcvinker5420> sent a code paste, see https://play.nim-lang.org/#ix=4JSd
00:22:27FromDiscord<ElegantBeouf> you cannot define adestructor for ref
00:22:37FromDiscord<ElegantBeouf> use `new(T, finalizer)` here
00:22:58FromDiscord<kcvinker5420> Oh i see
00:23:09FromDiscord<ElegantBeouf> sent a code paste, see https://play.nim-lang.org/#ix=4JSe
00:23:46FromDiscord<kcvinker5420> Thanks
00:23:54FromDiscord<michaelb.eth> does Nimster with `inv2004` on GitHub chat here?
00:24:03FromDiscord<ElegantBeouf> Inv has chatted here iirc
00:24:07FromDiscord<michaelb.eth> (edit) "does Nimster with `inv2004` ... on" added "profile"
00:37:13Amun-Rahmm, testament --targets=js works fine, testament with """targets: "js" """ always adds c to targets
00:50:52FromDiscord<kcvinker5420> What does this mean in Nim ? https://media.discordapp.net/attachments/371759389889003532/1166539336595013642/image.png?ex=654adb6b&is=6538666b&hm=2583fc2db239e2cc20c6067eb85c88a3aba606b25fc08582370c2274c4e7126d&
00:51:14FromDiscord<leorize> nothing right now
00:51:48FromDiscord<kcvinker5420> Is that an alternative to `defer` ?
00:51:56FromDiscord<leorize> nope
00:57:29*def- quit (Quit: -)
00:57:42*def- joined #nim
01:39:24FromDiscord<xtrayambak> treeform's trolling era, I suppose
02:04:48*Guest8518 quit (Quit: Leaving)
03:18:25FromDiscord<Phil> sent a long message, see http://ix.io/4JSZ
03:23:07FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4JT2
03:23:30FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4JT2" => "https://play.nim-lang.org/#ix=4JT3"
03:32:51*azimut joined #nim
03:37:54FromDiscord<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:03FromDiscord<Phil> That macro basically just turns X.getField("field") into the expression X.field at compile-time
03:41:34FromDiscord<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:46FromDiscord<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:25FromDiscord<Elegantbeef> Assuming the types are all the same you can just use a `Table[string, T]` instead of an object
03:45:27FromDiscord<Elegantbeef> If the types are not the same there is no good way to do it
03:45:40FromDiscord<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:20FromDiscord<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:17arkanoidhello! 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:52FromDiscord<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:40FromDiscord<Elegantbeef> Make a module with `import` and `export`
08:01:37FromDiscord<Chronos [She/Her]> Having a weird issue hm
08:02:51FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4JTF
08:04:51FromDiscord<Elegantbeef> `proc (ctx: Context): Future[system.void] | UMeta` is not `HandlerAsync`?
08:05:27FromDiscord<Chronos [She/Her]> Idk why it's saying UMeta is getting returned is the thing
08:06:00FromDiscord<odexine> Well what’s the definition
08:06:08FromDiscord<odexine> Wait I forgot you sent a link
08:06:33FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4JTG
08:07:04FromDiscord<Chronos [She/Her]> Ah wait
08:07:11FromDiscord<Chronos [She/Her]> Maybe because it isn't gcsafe
08:07:38FromDiscord<Chronos [She/Her]> That was the issue
08:07:43FromDiscord<Chronos [She/Her]> That was not clear at all
08:15:44arkanoidElegantbeef, 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:55arkanoid(I understand that this is the easiest way to solve half of the problem, I'm already using it)
08:19:40FromDiscord<Elegantbeef> I don't really see a way of separating this anotherway
08:21:57arkanoidElegantbeef, this is another partial solution, but yeah it's not complete and more complicated, import/export still wins
08:22:00arkanoidhttps://dev.to/ringabout/zero-overhead-interface-exploration-in-nim-language-2b3d
08:22:57FromDiscord<Elegantbeef> Why do you want to do this?
08:32:34arkanoidI'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:03FromDiscord<Elegantbeef> There is no decoupling to be had though
08:33:26arkanoidwhat do you mean?
08:33:29FromDiscord<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:03FromDiscord<Elegantbeef> Consider `import x, y` and `import x, z` if you use generics you can have different behaviour with those
08:34:25FromDiscord<Elegantbeef> Without having to write anything else, aslong as both modules expose the same procedure signatures it's fine
08:36:04arkanoidtrue
08:38:50FromDiscord<Elegantbeef> Though it'd be nice if there was a more extensive module system, but alas
08:38:56FromDiscord<Elegantbeef> Throw a penny in the well
08:39:06arkanoidbut decoupling this way produces compilation errors that aren't as specific as a "missing implementation of interfaced spec"
08:39:29arkanoidbut yeah, it's a simple solution that works
08:39:31FromDiscord<Elegantbeef> I mean you can write macros to specify a module needs specific procedures
08:39:48FromDiscord<Elegantbeef> so you could do `import x as bleh` inside a when statement
08:40:19FromDiscord<Elegantbeef> https://github.com/beef331/nimtrest/wiki/Code-snippets#check-if-a-module-has-a-proc using something like this
08:41:15arkanoidtyp?
08:42:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JTK
08:42:26FromDiscord<Elegantbeef> It's a parameter of the template
08:42:45arkanoidoh sorry for that, my fault
08:44:50arkanoidsure, this would enable writing an "interface module", with all exported procs = discard
08:45:11FromDiscord<Elegantbeef> No you wouldn't need it
08:45:11arkanoidor maybe with more sure, quite sure the are multiple interface packages out there
08:45:15FromDiscord<Elegantbeef> You'd just `export bleh`
08:45:48FromDiscord<Elegantbeef> If you know your module matches your interface you just export it there is no issue
08:45:50arkanoidyes 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:17arkanoidit's just a form of documentation that is checked a compile time
08:47:18FromDiscord<Elegantbeef> If you want docgen you can do your dummy proc method
08:47:19FromDiscord<Elegantbeef> But aside from docgen there is very little reason imo to decouple anything
08:47:19FromDiscord<Elegantbeef> Needlessly aliasing procedures introduces an extra step to the proc
08:47:51FromDiscord<Elegantbeef> Anyway I'm going to take tired ramblings elsewhere
08:49:57arkanoidsure, 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:00advesperacitMy impression is that your idea is "reducing complexity" by adding different complexity
09:00:38arkanoidadvesperacit: same thing I've just been saying
09:01:19arkanoidthe point is: how to add this feature introducing the minimum amount of complexity
09:01:35arkanoidand the answer may possibly be: you don't
09:02:05advesperacitthe feature seems to be complexity so not doing it seems the correct course of action yes
09:02:29arkanoidno, feature is decoupling via interfaces
09:03:29arkanoidif you ever worked with a language supporting these, mocking interfaces is a perfect way to decouple
09:04:42arkanoidthere'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:33naruto69Read 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:36naruto69it works?" https://justpaste.it/Naruto_Makes_Love_Samuel_Garcia
12:40:37FromDiscord<Phil> sent a code paste, see https://paste.rs/0WDFy
12:40:52FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4JUn" => "https://play.nim-lang.org/#ix=4JUo"
12:49:37FromDiscord<mratsim> In reply to @isofruit "Before I go with": no. specialization works between a concrete and a generic type
12:49:52FromDiscord<mratsim> when there are 2 generics that match, they are ambiguous
12:50:15FromDiscord<Phil> Isn't just `enum` also a generic?
12:50:16arkanoidwow, this seems something that also nim can do nicely with some compile time machinery https://flawless.dev/
12:50:41FromDiscord<mratsim> In reply to @isofruit "Isn't just `enum` also": `auto` and `T: enum` are generics yes
12:51:11FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4JUp
12:51:24FromDiscord<Phil> And I'd considered using `enum` as parameter type also a kind of generic, like `SomeNumber`
12:52:17FromDiscord<mratsim> In reply to @arkanoid "wow, this seems something": Are they reinventing continuations?
12:52:22naruto69Read 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:22naruto69it works?" https://justpaste.it/Naruto_Makes_Love_Samuel_Garcia
12:53:03arkanoidmratsim, continuations with wasm trampoline?
12:54:31FromDiscord<mratsim> In reply to @arkanoid "<@570268431522201601>, continuations with wasm": if you lose connection or anything, you can restart from the continuation
12:54:59FromDiscord<mratsim> without needing to do side-effects done previously, and compare to them, without recomputing anything either
12:55:14arkanoidmratsim, but you aren't in a sandbox
12:55:48FromDiscord<nnsee> but you are
12:55:54FromDiscord<nnsee> you can't use anything from the stdlib
12:56:08FromDiscord<nnsee> which is why they're using the flawless namespace when calling procs
12:56:12FromDiscord<nnsee> that's their sandbox
12:57:26FromDiscord<nnsee> didn't nimskull do continuations?
12:57:30FromDiscord<nnsee> https://github.com/nim-works/cps
12:58:46arkanoidnnsee, I'm not following you
12:58:47FromDiscord<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:18FromDiscord<nnsee> what do you mean by sandbox?
12:59:24FromDiscord<mratsim> Ras is saying that flawless code have a sandbox because they need to replace http::get with flawless::htttp::get
13:00:22arkanoidmaybe 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:54naruto69Read 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:55naruto69it works?" https://justpaste.it/Naruto_Makes_Love_Samuel_Garcia
13:00:56arkanoidyet I see similarities, and how continuation can solve kinda same problem
13:01:21naruto69Here 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:21naruto69
13:01:21naruto69"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:59FromDiscord<nnsee> i'm sorry what
13:02:05FromDiscord<leorize> you can use cps to build something that works the same
13:02:07FromDiscord<leorize> what wasm gives you is the lack of requirement for performing any transform at the code level
13:02:12FromDiscord<ieltan> lol
13:02:20FromDiscord<leorize> just preempt the execution and you can do whatever
13:02:25naruto69leorize 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:25naruto69me how it works?" https://justpaste.it/Naruto_Makes_Love_Samuel_Garcia
13:03:08FromDiscord<nnsee> <@&371760044473319454> uhhhh
13:03:10arkanoidalso with wasm you can handle the unsafe code as a plugin?
13:04:07FromDiscord<leorize> what does that even mean?
13:05:32naruto69ieltan 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:32naruto69me how it works?" https://justpaste.it/Naruto_Makes_Love_Samuel_Garcia
13:07:00arkanoidthanks PMunch
13:07:09PMunchOf course
13:07:21PMunchJust had to find the guide on how to ban people on IRC :P
13:07:28FromDiscord<leorize> their origin is irc, is it that time of the year again
13:08:12FromDiscord<nnsee> PMunch: you didn't get all of the messages in Discord btw
13:08:52PMunchBetter?
13:08:57FromDiscord<nnsee> yup, thanks
13:13:33FromDiscord<Phil> I go away to delete some code for 10 minutes
13:13:44FromDiscord<Phil> And you people catch an IRC spammer in my absence
13:13:45FromDiscord<Phil> tsk tsk
13:21:52arkanoidleorize, could you please explain how continuations compare to running functions in wasm?
13:22:13*naruto69 left #nim (#nim)
13:23:47FromDiscord<leorize> what is there to compare?
13:24:08FromDiscord<leorize> functions in wasm is the same as functions anywhere else
13:24:52*xet7 quit (Remote host closed the connection)
13:25:19FromDiscord<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:35PMunchI wonder what that Naruto spammer hoped to get out of their thing.. Just to share their strange fan-fiction?
13:26:13FromDiscord<leorize> cps on the other hand is purely a code transform with no runtime requirement
13:26:36arkanoidleorize, and encapsulation, isolation, etc. Otherwise there would be a {.wasmcall.}
13:26:45FromDiscord<leorize> for the purposes of this flawless engine, you can do the same thing with both
13:27:32FromDiscord<leorize> isn't all that just runtime-powered things?↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>)
13:27:44FromDiscord<leorize> and wasmcall exists \:p
13:28:17arkanoiddoes it? lol, I just made it up
13:28:56arkanoidok, then, how can I ensure encapsulation and isolation with continuations?
13:29:18FromDiscord<leorize> what are you aiming for with your invariant?
13:29:28FromDiscord<Chronos [She/Her]> Wasm is cool, I wish I had a use for it rn
13:29:39FromDiscord<leorize> what does encapsulation and isolation mean in this context?
13:30:01adigitoleo_PMunch: got the link to that guide? The same spammer is still active on #python
13:30:20adigitoleo_I
13:30:40adigitoleo_I'm not an admin there but maybe sharing it there would get the ball moving
13:30:59FromDiscord<leorize> yea it's that time of the year again
13:31:44FromDiscord<leorize> report it to #libera and see if they're seeing a wave of spammers
13:32:11FromDiscord<leorize> they will probably turn their anti spam tools on when it becomes a big issue
13:34:54PMunchadigitoleo_, it's this thing: https://github.com/nim-lang/Nim/wiki/IRC-guidelines
13:55:37FromDiscord<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:32PMunchYeah, 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:48FromDiscord<nnsee> localhost:2375↵Error↵Request failed with status code 404
14:15:57FromDiscord<nnsee> whoops, sorry about that
14:16:25FromDiscord<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:59FromDiscord<Chronos [She/Her]> Can Debby only do ref objects? If so, that's a pain
15:34:49FromDiscord<Chronos [She/Her]> Well not a pain
15:34:53FromDiscord<Chronos [She/Her]> Just, meh
15:51:35*beholders_eye quit (Ping timeout: 240 seconds)
16:25:05FromDiscord<Phil> In reply to @chronos.vitaqua "Well not a pain": Why so geared towards value types?
16:28:13FromDiscord<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:06FromDiscord<Chronos [She/Her]> sent a long message, see http://ix.io/4JVX
17:11:08FromDiscord<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:00FromDiscord<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:25FromDiscord<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:35FromDiscord<Chronos [She/Her]> Discord doesn't use Postgres or Redis but yeah
17:15:10FromDiscord<odexine> you increase the practical limit by making more instances, getting more servers, etc
17:17:39FromDiscord<odexine> do you really need to worry about the limits right now? are you actually hitting 10000+ concurrent connections?
17:17:51FromDiscord<odexine> redis can be configured to handle even more than that given enough ram
17:18:02FromDiscord<odexine> iirc the ballpark is 3 or something connections per megabyte
17:18:41FromDiscord<odexine> so if you have 8 whole gigabytes of memory you could prolly do 25ish thousand concurrent
17:18:56FromDiscord<odexine> personally i'd just not worry until i actually hit the problem
17:19:02FromDiscord<odexine> or am close to it
17:27:49FromDiscord<Chronos [She/Her]> This is actually just out of pure curiosity, I'd never hit those limits ever
17:40:38FromDiscord<odexine> okay then yeah
17:40:42FromDiscord<odexine> (edit) "okay" => "okay,"
17:47:42FromDiscord<Chronos [She/Her]> The random module shoooould be enough for generating random strings for OAuth states :p
17:47:51FromDiscord<odexine> uh oh
17:47:55FromDiscord<odexine> someones gonna get mad at you for that
17:48:00FromDiscord<odexine> @ mra
17:48:44FromDiscord<Chronos [She/Her]> Lmao
17:49:11FromDiscord<Chronos [She/Her]> Fineeeee I'll use sysrand
17:50:08FromDiscord<Chronos [She/Her]> I'll even cast the bytes from it into a uint64 😛
17:50:21FromDiscord<Chronos [She/Her]> Joking about that one lol
17:51:19FromDiscord<odexine> i feel like someone's gonna pop a vein from thatsooner or later
17:51:22FromDiscord<odexine> (edit) "thatsooner" => "that sooner"
17:51:55*rockcavera joined #nim
17:52:00FromDiscord<Chronos [She/Her]> What's wrong with sysrand? Urandom has been shown to be secure
17:52:08FromDiscord<odexine> no, i mean from the cast xd
17:52:18FromDiscord<Chronos [She/Her]> Ah lmao
17:52:26FromDiscord<Chronos [She/Her]> I do that in my NULID library lmao
17:52:42FromDiscord<Chronos [She/Her]> I should probably remove all uses of casting in it, tbh
17:52:50FromDiscord<Chronos [She/Her]> Since it doesn't work on the Nim VM :p
17:54:19FromDiscord<Phil> at enterprise levels my experience has been that Redis is just a cache to check
17:55:09FromDiscord<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:42FromDiscord<Chronos [She/Her]> Fair
17:59:12FromDiscord<Chronos [She/Her]> Hm... Currently trying to figure out how my server (the API) would validate the state
17:59:35FromDiscord<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:06FromDiscord<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:35FromDiscord<Chronos [She/Her]> I mean, Prologue does have sessions
18:02:22FromDiscord<Chronos [She/Her]> Redis would definitely be suited for this
18:02:37FromDiscord<Chronos [She/Her]> Don't wanna do Redis stuff yet though, will keep it to memory for now
18:03:16FromDiscord<Phil> I mean, Redis is something you pull out when you are already in the medium big leagues
18:03:57FromDiscord<Phil> It's a caching solution for when your postgresql is no longer fast enough for the traffick you're receiving
18:04:15FromDiscord<Phil> Though I guess you can also use it as your primary Db if you really wanna play around with it
18:04:23FromDiscord<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:19FromDiscord<Chronos [She/Her]> Ah fair
18:05:29FromDiscord<Chronos [She/Her]> Was just using it for session middleware :p
18:05:35FromDiscord<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:51FromDiscord<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:50FromDiscord<leorize> nim does not have continuous testing for anything but amd64 and x86
18:10:43FromDiscord<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:14FromDiscord<leorize> no one contributed any such thing is the answer
18:13:07FromDiscord<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:31FromDiscord<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:39FromDiscord<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:28FromDiscord<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:34FromDiscord<Chronos [She/Her]> `assert state == "A"` raises an AssertionDefect
18:27:47FromDiscord<fabric.input_output> sent a code paste, see https://play.nim-lang.org/#ix=4JWC
18:28:01FromDiscord<Chronos [She/Her]> `writeFile` also doesn't write which is odd
18:30:38FromDiscord<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:58FromDiscord<Chronos [She/Her]> God this is so annoying and painful
18:37:36FromDiscord<leorize> you're lucky that it isn't due to concepts \:P↵(@fabric.input_output)
18:41:45FromDiscord<Chronos [She/Her]> So annoyed oh my god why won't this work
18:43:37FromDiscord<michaelb.eth> when would it be preferable to have a `seq[var T]` instead of `var seq[T]`?
18:47:54FromDiscord<odexine> mutating only the elements but not the size of the sequence? dunno
18:49:24FromDiscord<Chronos [She/Her]> I am going to tear my hair out
18:51:25FromDiscord<Chronos [She/Her]> This makes no sense
18:52:52FromDiscord<guttural666> how do easily find out what exceptions a function in the stdlib can throw without sifting through the source code?
18:53:08FromDiscord<leorize> never because the former doesn't work \:P↵(@michaelb.eth)
18:53:22FromDiscord<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:30FromDiscord<Chronos [She/Her]> Not all stdlib modules use it though
18:54:55FromDiscord<guttural666> can I generically catch all exceptions?
18:55:17FromDiscord<leorize> `try: code except CatchableException: handler`
18:55:58FromDiscord<guttural666> CatchableException just catches everything? don't really care in my case
18:56:08FromDiscord<Chronos [She/Her]> You can also catch defects with `except Exception` (p.s, CatchableError, not CatchableException :p)
18:56:32FromDiscord<guttural666> CatchableError it seems
18:56:39FromDiscord<guttural666> yes
18:56:44FromDiscord<Chronos [She/Her]> Though if the program is compiled with `panics:on`, defects will panic and program won't catch the defects
18:58:03FromDiscord<guttural666> what is considered a "defect"? just any exception?
18:58:45FromDiscord<odexine> any exception inheriting from Defect
18:58:53FromDiscord<guttural666> or what is the diff between CatchableException and Exception
18:58:57FromDiscord<odexine> aka if it has Defect in the name
18:58:58FromDiscord<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:04FromDiscord<guttural666> ok
18:59:12FromDiscord<guttural666> thanks!
18:59:13FromDiscord<michaelb.eth> (edit) "thing like that" => "use of it"
18:59:24FromDiscord<odexine> In reply to @guttural666 "or what is the": Catchable inherits from Exception
18:59:40FromDiscord<Chronos [She/Her]> In reply to @guttural666 "or what is the": `CatchableError` inherits from `Exception`, `Defect` inherits from `Exception`
18:59:42FromDiscord<odexine> Exception is the "root" type that's the parent of Catchable and Defect
19:00:03FromDiscord<guttural666> gonna take Exception then
19:00:25FromDiscord<odexine> In reply to @guttural666 "gonna take Exception then": as stated, your program will crash if someone uses --panics:on
19:00:51FromDiscord<leorize> `var T` is a view/borrow, similar to C++ `&type`, so they're like mini pointers↵(@michaelb.eth)
19:00:55FromDiscord<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:02FromDiscord<leorize> you should never put them in a seq tbh
19:01:14FromDiscord<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:33FromDiscord<leorize> if you're doing `except Exception`, might as well just `except:`
19:01:54FromDiscord<guttural666> In reply to @leorize "if you're doing `except": if that works, I'll take it 😛
19:01:55FromDiscord<leorize> bare except is the same as `except Exception`, even if nim can't stop being an ass about it
19:02:01FromDiscord<michaelb.eth> (edit) "crash" => "crash, likewise never try to catch a Defect or Exception, only CatchableError"
19:03:07FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4JWO
19:03:58FromDiscord<michaelb.eth> In reply to @user2m "how do I write": how are constructing the instance?
19:04:22FromDiscord<michaelb.eth> should be e.g. `thing[int]()`
19:06:11FromDiscord<leorize> but how are you using it?
19:06:11FromDiscord<leorize> you're writing it correctly
19:06:15FromDiscord<user2m> ahhh you are correct!
19:12:15FromDiscord<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:52FromDiscord<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:32FromDiscord<Chronos [She/Her]> My redirect URL is not being set correctly for some reason... Ugh
19:22:39FromDiscord<Chronos [She/Her]> Where is "A" coming from, I don't get it
19:23:59FromDiscord<leorize> `strutils.format` is what you want↵(@guttural666)
19:24:02FromDiscord<leorize> there's also the `strutils.%` operator
19:24:41FromDiscord<guttural666> gonna check that out thank you very much
19:26:37om3gaguys, can nim compiler generate c99?
19:27:15ehmryom3ga: nim doesn't generate strict C, it uses de facto standard extensions
19:28:10om3gaehmry: which extensions, sorry I don't understand
19:28:19ehmryom3ga: alignof
19:28:52om3gaaah so it will be c11
19:29:21om3gaehmry: thanks
19:29:40ehmryom3ga: could be, alignof gave me grief with older compilers
19:30:21ehmryit would be nice to have a commitment to c11, if there isn't one already
19:30:47om3gaI having fun with old compilers. undfortunately I will be not able to test nim with pcc
19:32:29ehmryyea, not the plan9 compilers either
19:32:42*jmdaemon joined #nim
19:43:58FromDiscord<Chronos [She/Her]> Anyone know how I'd do breakpoints and such with Nim?
19:44:29FromDiscord<leorize> load up your favorite debugger and add breakpoints?
19:44:44FromDiscord<Chronos [She/Her]> Not sure how it even works tbh
19:45:11FromDiscord<leorize> you're a vscode user, right?
19:46:19FromDiscord<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:44FromDiscord<Chronos [She/Her]> Yep
19:46:55FromDiscord<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:22FromDiscord<fabric.input_output> bruh why is the nim type system so broke 😭
20:58:12FromDiscord<Elegantbeef> What now?
21:02:01NimEventerNew thread by Hobbyman: How do i look into this runtime-failure?, see https://forum.nim-lang.org/t/10567
21:03:33FromDiscord<Chronos [She/Her]> Is `ctx` per-user or per-route?
21:10:45FromDiscord<Chronos [She/Her]> Not sure how I'm supposed to store a state about a user without some identifiable info
21:10:51FromDiscord<Chronos [She/Her]> Sessions aren't working so...
21:11:02FromDiscord<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:33FromDiscord<Chronos [She/Her]> Would storing it in a global list be bad for safety? :p
21:19:39FromDiscord<leorize> what are you trying to achieve?
21:25:15FromDiscord<Chronos [She/Her]> GitHub OAuth state checking
21:26:13FromDiscord<Chronos [She/Her]> I'm actually a bit confused... OAuth login has to be done in a browser, right?
21:26:23FromDiscord<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:48FromDiscord<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:41Amun-Rabut line before that you get something else
21:38:20Amun-Rathere's no mitems iterator for non-var data
21:38:39Amun-Rathat's why you get udeclared field 'mitems'
21:40:04FromDiscord<guttural666> that's just the follow up error
21:40:39FromDiscord<guttural666> the root cause was that abap_words was not modifiable
21:40:42Amun-Raright, so it really doesn't matter
21:41:38FromDiscord<guttural666> maybe I'm overestimating the power of compilers
21:42:28Amun-Rathe problem is with the way you use the mpair (and you're using is the way I am)
21:43:15Amun-Rawhen 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:27FromDiscord<guttural666> I was stupid an I apologize for being mad at the compiler gods 😄
21:43:30FromDiscord<guttural666> I know
21:43:35Amun-Rathat's why data.mitems prduce Error: undeclared field: 'mitems'
21:43:41Amun-Rabut, change it to mitems data
21:43:42FromDiscord<guttural666> yeah
21:44:12Amun-Ra…and you'll have much clearer message
21:44:27Amun-Rathese are the pros and cons of uniform function call :>
21:44:57FromDiscord<guttural666> can you elaborate?
21:45:11FromDiscord<guttural666> don't quite get it
21:45:25Amun-Rahttps://play.nim-lang.org/#ix=4JXx
21:46:09Amun-Ramitems data or mitems(data) can't be an attribute of an object so it must be a function
21:46:37Amun-Rathat's why nim lists all the mitems functions it has in this example
21:46:55Amun-Ragranted, it should display it in the former example, you can file a PR :)
21:47:10Amun-RaI mean feature request
21:51:06FromDiscord<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:23Amun-Rawell, I love it
21:52:40FromDiscord<Elegantbeef> Meh this isnt UFCS, this is iterators
21:52:55Amun-RaUICS ;>
21:52:57FromDiscord<leorize> wait until you see command call
21:53:08FromDiscord<Elegantbeef> If iterators were not special classed this wouldnt be an issue
21:53:11FromDiscord<guttural666> I love it too, I am a pervert. echo "pls" is awesome, but otherwise I try to use pls.func() only
21:53:19Amun-RaI see
21:53:49FromDiscord<guttural666> sometimes pls.func
21:54:18Amun-RaI try to write code in a way to avoid using as few () as possible
21:54:37FromDiscord<Elegantbeef> Spoken like someone that used Lisp
21:54:46Amun-Ra:P
21:55:17FromDiscord<guttural666> I dunno, I would welcome order imposed on me by smarter programmers
22:04:56FromDiscord<Chronos [She/Her]> Cookies don't even work here sigh
22:05:14FromDiscord<Elegantbeef> Cookies never work, try biscuits
22:05:36FromDiscord<Chronos [She/Her]> Any ideas on how I'd store the state for GitHub auth, Beef? :p
22:06:00FromDiscord<Elegantbeef> Using a github token that you can request from github
22:06:04FromDiscord<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:13FromDiscord<Elegantbeef> Unless you mean on the server
22:06:22FromDiscord<Chronos [She/Her]> On the server temporarily
22:06:27FromDiscord<Chronos [She/Her]> This is for OAuth
22:06:53FromDiscord<Elegantbeef> Yea this is practical dev, which means it's beyond me
22:08:38FromDiscord<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:44FromDiscord<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:40FromDiscord<Chronos [She/Her]> I don't have any solution for this... Ugh
22:44:02FromDiscord<pcarrier> what's the type of seq indices?
22:45:47FromDiscord<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:10FromDiscord<Chronos [She/Her]> In reply to @pcarrier "what's the type of": `int` if I understood your question right
22:46:51FromDiscord<pcarrier> @Chronos [She/Her] I think you did. is int guaranteed to be the size of pointers?
22:46:58FromDiscord<pcarrier> (edit) "pointers?" => "pointers on every platform?"
22:47:44FromDiscord<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:41FromDiscord<typistx> hard to believe nim does not officially support arm and riscv and there are no plans for that either
23:55:08FromDiscord<typistx> thinking about using nim on arm/riscv embedded boards
23:57:51FromDiscord<pcarrier> how do I copy the contents of a ref?