00:00:35 | FromDiscord | <arathanis> sent a code paste, see https://paste.rs/qqXpk |
00:10:30 | FromDiscord | <ElegantBeef> Nah these are compiler generated values they should be constants |
00:16:21 | FromDiscord | <arathanis> Might be worth sanity checking just the same |
00:17:21 | FromDiscord | <ElegantBeef> Plus it should not matter as it's all the same all the way down |
00:17:34 | FromDiscord | <ElegantBeef> I did change it to the cstring hash, but yea same issue |
00:19:36 | * | xet7 quit (Remote host closed the connection) |
00:23:16 | FromDiscord | <Elegantbeef> Ah the issue was actually the `counted` set |
00:23:32 | FromDiscord | <Elegantbeef> Multiple procs might call into an entry |
00:23:41 | FromDiscord | <Elegantbeef> As such culling them results in fewer samples |
00:24:25 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1183564910983118909/image.png?ex=6588cbb8&is=657656b8&hm=eff74cda144249d70505da1a145de77fc583b6a4cb7df45af8e42636246153a1& |
00:24:26 | FromDiscord | <Elegantbeef> It looks like something |
00:27:21 | FromDiscord | <zectbumo> I was close |
00:29:03 | FromDiscord | <zectbumo> (edit) "close" => "close, or at least on to `counted`" |
00:30:48 | * | Jjp137 joined #nim |
00:32:20 | FromDiscord | <zectbumo> In reply to @omentic "i've been keeping https://gist.github.com/omentic/0": I'd like this one to be included about the single call when assigning multiple vars.↵https://forum.nim-lang.org/t/9132#60046 |
00:33:49 | FromDiscord | <zectbumo> (I thought you guys cared about speed 😉) |
00:37:43 | FromDiscord | <Elegantbeef> We do care about speed but if `var a, b = proc()` is your bottle neck you're in good hands |
00:42:51 | FromDiscord | <zectbumo> `var a, b, c, d, e = fetch('http...')` 😬 |
00:43:13 | FromDiscord | <Elegantbeef> Though an optional hint would benice |
00:43:14 | FromDiscord | <Elegantbeef> be nice\ |
00:43:18 | FromDiscord | <Elegantbeef> PR's welcome |
00:43:31 | FromDiscord | <Elegantbeef> In what world is that common code? |
00:47:28 | FromDiscord | <zectbumo> the 5 variables is a bit excessive so you're welcome to call it an exaggeration. but it could be for some other reason like `var a,b = parseJson(rpc('getStuff'))`. |
00:48:34 | FromDiscord | <zectbumo> maybe you can think of a better example. (use the darkside) |
00:48:51 | FromDiscord | <Elegantbeef> I mean like I said an optional hint should exist |
00:49:01 | FromDiscord | <Elegantbeef> But it's not a common source of performance loss |
01:02:47 | FromDiscord | <JJ> In reply to @zectbumo "`var a, b, c,": hmm wouldn't this break expectations? procs don't have to be pure |
01:03:01 | FromDiscord | <JJ> how would you expect `var a, b = random()` to behave? |
01:03:03 | * | Mister_Magister quit (Quit: bye) |
01:04:57 | * | Mister_Magister joined #nim |
01:11:09 | FromDiscord | <Elegantbeef> @JJ does your emulator run any roms yet? |
01:11:11 | FromDiscord | <Elegantbeef> I want to see how bad my profiler does 😄 |
01:18:14 | FromDiscord | <zectbumo> sent a code paste, see https://paste.rs/v7oR5 |
01:18:44 | FromDiscord | <Elegantbeef> See I read it ias `var a: typeof(random()); var b = random()` ;D |
01:18:47 | FromDiscord | <Elegantbeef> There are 3 ways of doing it and none are right |
01:19:35 | FromDiscord | <zectbumo> (edit) "https://paste.rs/se8WF" => "https://paste.rs/RNVsi" |
01:19:56 | FromDiscord | <Elegantbeef> Either the compiler should error or it should be left as there is no beneficial change it's completely unexpected anyway you look at it |
01:20:29 | FromDiscord | <zectbumo> In reply to @Elegantbeef "See I read it": that's the old javascript way |
01:21:58 | FromDiscord | <Elegantbeef> The point was more there is no single correct interpretation |
01:22:27 | FromDiscord | <zectbumo> and my point is that's "old" thinking 😄 |
01:22:46 | FromDiscord | <Elegantbeef> How does age have anything to do with it? |
01:22:57 | FromDiscord | <Elegantbeef> There are three interpretations from `var a, b = ...` |
01:23:21 | FromDiscord | <zectbumo> I like where this is going |
01:24:22 | FromDiscord | <Elegantbeef> why is `var (a, b) = (let x = ...; (x, x))` more valid than `var (a, b) = (..., ...)` or `var a: typeof(...); var b = ...` 😄 |
01:24:28 | FromDiscord | <Elegantbeef> The fact it's ambiguous means it should be an error |
01:24:38 | FromDiscord | <Elegantbeef> `tupleOf(..., 3)` is so simple to write |
01:25:21 | FromDiscord | <Elegantbeef> `var a, b = ...` probably should only be valid if `... is static` |
01:26:09 | FromDiscord | <arathanis> what library has tupleOf defined? |
01:26:16 | FromDiscord | <arathanis> (edit) "tupleOf" => "`tupleOf`" |
01:26:33 | FromDiscord | <Elegantbeef> None it's 2 lines of macro code |
01:27:13 | FromDiscord | <arathanis> ahh |
01:27:31 | FromDiscord | <Elegantbeef> Change this so it caches for zect's desired api |
01:27:33 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/G4Cao |
01:27:46 | FromDiscord | <zectbumo> sent a long message, see https://paste.rs/5qXSf |
01:28:37 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/B9V5o |
01:29:15 | FromDiscord | <Elegantbeef> Anywho this is silly |
01:29:52 | FromDiscord | <Elegantbeef> \that should be `result[^1].add` of course |
01:30:14 | FromDiscord | <JJ> In reply to @Elegantbeef "<@572634810917322773> does your emulator": currently dying with finals :-/ |
01:30:30 | * | krux02 quit (Remote host closed the connection) |
01:30:32 | FromDiscord | <JJ> won't have time to work on it until, like, february probably |
01:30:38 | FromDiscord | <Elegantbeef> Ah no worries 😄 |
01:30:41 | FromDiscord | <Elegantbeef> Just seen the license you have on it... jeez comrade |
01:30:56 | FromDiscord | <JJ> lmfao is that the fafol |
01:31:09 | FromDiscord | <JJ> or is that the anti-capitalist one |
01:31:23 | FromDiscord | <Elegantbeef> ancap |
01:31:29 | FromDiscord | <Elegantbeef> 😛 |
01:31:37 | FromDiscord | <JJ> lol |
01:31:45 | FromDiscord | <zectbumo> what's the license? |
01:31:52 | FromDiscord | <JJ> ah yeah i thought that one was very in the spirit of 100 rabbits projects |
01:32:01 | FromDiscord | <JJ> In reply to @zectbumo "what's the license?": individuals may use it, corporations may not |
01:32:15 | FromDiscord | <JJ> + non profits and educational institutions |
01:32:20 | FromDiscord | <JJ> (edit) "+ non profits and educational institutions ... " added "and co-ops" |
01:32:42 | FromDiscord | <JJ> of course, this is on a piece of software that is literally a toy 😛 |
01:32:50 | FromDiscord | <Elegantbeef> Trigger as hard as I can |
01:33:14 | FromDiscord | <zectbumo> sent a code paste, see https://paste.rs/kv8uG |
01:33:56 | FromDiscord | <zectbumo> In reply to @omentic "individuals may use it,": isn't that called GPLv3 Alegro? |
01:56:17 | FromDiscord | <Elegantbeef> What?↵(@zectbumo) |
01:56:37 | FromDiscord | <Elegantbeef> `var (a, b, c) = tupleOf(someExpr, 3)` |
02:00:15 | FromDiscord | <zectbumo> oh that's the actual macro for what I want. I didn't catch that |
02:01:34 | FromDiscord | <zectbumo> (edit) "what" => "the change that" | "want." => "wanted." | "that" => "that. thx" |
04:18:29 | * | droidrage joined #nim |
05:21:35 | * | rockcavera quit (Remote host closed the connection) |
05:22:34 | FromDiscord | <gogolxdong666> Is there any way to create bitstream from hex string? |
05:28:56 | FromDiscord | <Elegantbeef> What is a bitstream in Nim's context |
05:30:49 | FromDiscord | <gogolxdong666> https://nim-lang.org/docs/bitops.html but from hex string ? |
05:31:41 | FromDiscord | <Elegantbeef> https://github.com/sealmove/bitstreams/blob/main/bitstreams.nim with `parseHexStr`? |
05:32:56 | FromDiscord | <gogolxdong666> yes |
05:34:23 | FromDiscord | <gogolxdong666> sent a code paste, see https://play.nim-lang.org/#ix=html> |
05:34:42 | FromDiscord | <gogolxdong666> should output 1 |
05:39:41 | FromDiscord | <gogolxdong666> sent a code paste, see https://play.nim-lang.org/#ix=html> |
05:42:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
05:42:10 | FromDiscord | <Elegantbeef> Like i said `parseHexStr` |
05:45:16 | FromDiscord | <gogolxdong666> love you😄 |
05:45:52 | FromDiscord | <Elegantbeef> The feeling is not mutual |
05:46:35 | FromDiscord | <odexine> Beef how would you judge the stability of new concepts compared to old concepts |
05:46:45 | FromDiscord | <Elegantbeef> Worse |
05:47:02 | FromDiscord | <odexine> Legitimately? I thought it was meant to be better because of the restrictions |
05:47:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
05:47:55 | FromDiscord | <Elegantbeef> Sorry it's `Option[int]` there does not compile |
05:49:14 | FromDiscord | <odexine> I guess it’s best to stick to old concepts somehow |
05:50:42 | FromDiscord | <Elegantbeef> Seems like it might've been fixed |
05:52:08 | FromDiscord | <Elegantbeef> I take it back |
05:52:16 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
05:52:24 | FromDiscord | <Elegantbeef> This errors with a generic argument message |
05:53:14 | FromDiscord | <Elegantbeef> Unless you're using a macro to make interface like things there is not much benefit to new concepts |
05:53:24 | FromDiscord | <Elegantbeef> Until new features get added like the planned generic checking |
05:54:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
05:54:23 | FromDiscord | <odexine> Okay, I was just thinking about moving a lot of the monad functions from Haskell into Nim x d |
05:54:47 | FromDiscord | <odexine> Type classes fit pretty closely to concepts |
05:56:36 | FromDiscord | <Elegantbeef> Yea though they're checked |
05:57:13 | FromDiscord | <odexine> ? “Though they’re checked” which is |
05:57:45 | FromDiscord | <Elegantbeef> Like Rust traits where the use of a typeclass as a parameter prevents any procedures calls that do not match it |
05:57:47 | FromDiscord | <Elegantbeef> Atleast iirc |
05:57:54 | FromDiscord | <Elegantbeef> I'm not one for haskell as you very well know |
05:58:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
05:58:30 | FromDiscord | <Elegantbeef> It's honestly not that cryptic, but I also know how the hot dog is made |
07:24:35 | * | advesperacit joined #nim |
07:56:11 | FromDiscord | <.bobbbob> is anyone familiar with prologue here? Im trying to do app.use(staticFileMiddleware("public")) but that makes the "public" a part of the url also, so I have to go to localhost:8080/public/wtvr/wtvr.png to access the files, how can I make it just be localhost:8080/wtvr/wtvr.png while still having the wtvr folder be in public? |
08:02:39 | FromDiscord | <nnsee> In reply to @.bobbbob "is anyone familiar with": I don't have the answer to your question, but as a rule of thumb you should avoid using prologue to serve static files and instead do it via a reverse proxy such as Caddy or nginx (which your prologue app will likely be sitting behind anyways, for TLS etc) |
08:03:37 | FromDiscord | <nnsee> IIRC the last time someone asked that question, the answer was "you can't" without running the app from the same dir as your public files |
08:05:35 | FromDiscord | <.bobbbob> In reply to @nnsee "IIRC the last time": hm weird, that should be a simple thing and jester does it automatically. And yeah Im planning to have the files served by nginx once it's done but i'd like to be able to do this while testing the code. |
08:06:51 | FromDiscord | <nnsee> you can run nginx on your local machine (and I argue you _should_, to catch possible deployment issues early) |
08:07:42 | FromDiscord | <.bobbbob> fair enough, thanks for the advice |
08:10:25 | FromDiscord | <nnsee> maybe people would disagree with this sentiment, but I feel like the dev environment _should_ mirror the production environment as closely as possible (barring dev workflow enhancements such as debugging, hot code reloading etc) so you don't have to do double work once you start deploying to prod and realize that the set up is so wildly different there |
08:12:17 | FromDiscord | <nnsee> sort of unrelated, but my rule of thumb is to avoid serving files from the filesystem programmatically and always let the reverse proxy do it, because it's so much harder to accidentally shoot yourself in the foot (through performance issues, not serving files using gz when possible, accidentally opening yourself up to a path traversal attack, etc) |
08:12:27 | FromDiscord | <nnsee> not impossible mind you, just harder |
08:25:18 | FromDiscord | <9ih> I appreciate that you can just see the source for the standard library on your pc |
08:25:26 | FromDiscord | <9ih> like I know you can do that with C/C++ but this is actually readable |
08:47:42 | * | PMunch joined #nim |
09:40:29 | * | dtomato quit (Quit: Ping timeout (120 seconds)) |
09:40:37 | FromDiscord | <Phil> In reply to @.bobbbob "is anyone familiar with": I am familiar with prologue and use it in a medium sized application - I've never used it to serve static files since you should always delegate that to the reverse proxy. |
09:40:48 | * | dtomato joined #nim |
09:41:53 | FromDiscord | <Phil> That's why I have nimble tasks to set spin up containers of said server locally via docker containers in a docker compose setup |
09:42:19 | * | FromDiscord quit (Remote host closed the connection) |
09:42:32 | * | FromDiscord joined #nim |
09:45:53 | FromDiscord | <nnsee> I generally set up a kubernetes pod definition `.yaml` and do `podman play kube my-dev-stack.yaml` |
09:46:39 | FromDiscord | <nnsee> and later i can just do `podman pod start my-dev-stack` |
09:53:34 | FromDiscord | <tauruuuuuus> Are there any restrictions on using pragmas (custom ones and not) on `const` stuff? |
09:54:16 | PMunch | Well many of them simply wouldn't do much, restrictions or otherwise |
09:54:30 | PMunch | consts are inlined in Nim |
09:55:00 | FromDiscord | <Elegantbeef> The restriction is that aside from macros there is no use of them |
09:55:22 | FromDiscord | <Elegantbeef> Constants expand when used so you cannot look up custom pragmas on them |
09:55:48 | FromDiscord | <tauruuuuuus> I was experimenting with macro pragmas on const blocks, I guess I'll try with regural "lets" |
09:56:11 | FromDiscord | <Elegantbeef> Macros will work on const blocks |
09:57:43 | FromDiscord | <tauruuuuuus> Sorry I'll give more details, I'm using a macro to modify the AST of a const definition, so that it decorates that def with 1+ non-custom pragmas (mainly codegenDecl stuff) |
09:58:08 | FromDiscord | <Elegantbeef> Right consts do not stay alive so you need `let` |
09:58:41 | FromDiscord | <tauruuuuuus> thanks a lot for the info! |
09:59:29 | PMunch | You could detect that in your macro though :) |
09:59:50 | PMunch | But yeah, consts don't like long enough to see the codegen step |
10:00:20 | FromDiscord | <Elegantbeef> Hell const's do not even live long enough in Nim to detect pragmas |
10:00:26 | FromDiscord | <Elegantbeef> They're folded into the call site |
10:46:10 | FromDiscord | <tauruuuuuus> I did not know that, lately I've been focusing on some pretty in depth parts of nim, I guess "thanks" to dipping my toes in macro magic |
10:46:16 | FromDiscord | <saint.___.> If I want to write a simple parser for a small lang, do I do it with macros, or can I use npeg |
10:46:43 | FromDiscord | <saint.___.> I guess I should learn how to use macros since I have no idea how they work atm but I am more familiar with npeg |
11:12:57 | FromDiscord | <Phil> the nlvm repl may just be the thing that kills me using my playground project |
11:13:36 | FromDiscord | <Phil> I can explore code way better on the fly and even reassign variables which - while not valid for nim itself, when I'm just syntax checking and pushing code for a small PoC around, is really nice |
11:19:11 | FromDiscord | <nnsee> In reply to @isofruit "the nlvm repl may": just tried it out, is it supposed to crash the repl entirely when you do something like `let x = a` without `a` being defined? or is that a bug? |
11:20:00 | FromDiscord | <Phil> That one I never ran into, I mean expected behaviour would be an error message in the repl instead of a crash |
11:20:17 | FromDiscord | <nnsee> oh, the error is there |
11:20:26 | FromDiscord | <nnsee> it also crashes after printing it, though |
11:20:29 | FromDiscord | <nnsee> https://media.discordapp.net/attachments/371759389889003532/1183730017184788510/image.png?ex=6589657c&is=6576f07c&hm=71dd1628dfc70eea001df9afa8ce2b128e385bfa0d48ef606a73d4d3ce81cc0e& |
11:21:20 | FromDiscord | <Phil> nlvm bugreport? |
11:21:58 | FromDiscord | <nnsee> should do that, i just don't know how "raw" it is at this point, since it doesn't even seem to be documented when doing `nlvm --help` |
11:21:59 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
12:12:46 | FromDiscord | <9ih> just found out how much faster release is compared to debug |
12:12:56 | FromDiscord | <9ih> had a ~15 second aoc solution on debug |
12:13:01 | FromDiscord | <9ih> 20ms in release |
12:16:06 | FromDiscord | <odexine> lol |
12:17:06 | PMunch | Yeah, the release/debug time diff seems especially egregious on AoC tasks for some reason |
12:19:19 | FromDiscord | <Phil> ok 15000ms to 20ms is nuts, that's more than 500x, "normal" speed differences are more along the lines of 10x |
12:19:53 | FromDiscord | <9ih> yeah I was surprised |
12:21:11 | FromDiscord | <ambient3332> try -d:lto |
12:21:17 | FromDiscord | <ambient3332> and -d:danger |
12:21:46 | PMunch | I had -d:danger break one of my aoc solutions |
12:22:02 | FromDiscord | <ambient3332> floating point math? |
12:22:09 | PMunch | Don't remember |
12:26:50 | FromDiscord | <9ih> sent a long message, see <!doctype html> |
12:27:44 | FromDiscord | <9ih> I know Measure-Command isn't the best benchmarking tool |
12:27:47 | FromDiscord | <9ih> (edit) "Measure-Command" => "`Measure-Command`" |
12:28:03 | FromDiscord | <9ih> In reply to @ambient3332 "try -d:lto": what's lto? |
12:28:09 | FromDiscord | <ambient3332> link time optimization |
12:30:53 | FromDiscord | <odexine> In reply to @9ih "I know `Measure-Command` isn't": its close enough |
12:30:54 | FromDiscord | <9ih> can't find any docs on that |
12:30:54 | FromDiscord | <ambient3332> I adapted AoC template that automatically runs benchmarks https://github.com/amb/aoc-nim/blob/master/aoc.nim#L52 |
12:30:59 | FromDiscord | <odexine> when the magnitudes are that big it works |
12:31:13 | FromDiscord | <9ih> ya |
14:13:10 | * | PMunch quit (Quit: Leaving) |
14:17:39 | * | edr joined #nim |
14:21:51 | * | rockcavera joined #nim |
15:37:58 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
15:40:11 | FromDiscord | <odexine> In reply to @isofruit "Man, being 4 layers": try doing as the first example does without the explicit generic in the call to handleRequest? |
15:47:11 | FromDiscord | <Phil> sent a long message, see <!doctype html> |
15:48:29 | FromDiscord | <9ih> not that important but does Nim have a way to embed assets in the final executable? similar to how C# has it although I guess not that similar since it's a completely different compiled solution, worth asking anyway |
15:48:58 | FromDiscord | <Phil> In reply to @9ih "not that important but": read in a file in a static block, or just use static read procs such as slurp |
15:49:33 | FromDiscord | <Phil> or was it gorge? Might both be aliases for staticRead |
15:49:37 | FromDiscord | <9ih> and could that support multiple megabyte files? |
15:49:52 | FromDiscord | <Phil> Never tried but I don't see why it wouldn't |
15:50:01 | FromDiscord | <9ih> sick |
15:50:15 | FromDiscord | <odexine> prolly yeah but your binary size would be + the size of that file |
15:50:27 | FromDiscord | <Phil> Yeah there's no compression going on there |
15:50:51 | FromDiscord | <9ih> ya of course, just looking into distributing a single executable for something that uses bundled assets |
15:51:42 | FromDiscord | <odexine> In reply to @isofruit "I mean, that works,": i dont really know the context |
15:52:06 | FromDiscord | <odexine> i dont see why what i mentioned limits as you mention |
15:59:25 | FromDiscord | <Phil> It's just limiting which way you can write the generic.↵You have one way, but there are like at least 2 more ways that seem like they should be valid that I can't all get to work at the same time... maybe I just give up on that |
16:08:59 | FromDiscord | <nnsee> In reply to @9ih "and could that support": i've staticRead files with sizes of multiple hundred megabytes |
16:09:04 | FromDiscord | <nnsee> you'll be fine |
16:11:08 | NimEventer | New post on r/nim by mcj1m: The nim website and the downloads are insecure, see https://reddit.com/r/nim/comments/18fy1bc/the_nim_website_and_the_downloads_are_insecure/ |
16:13:25 | FromDiscord | <9ih> In reply to @nnsee "i've staticRead files with": lol nice |
16:13:31 | FromDiscord | <9ih> good to know |
16:29:13 | FromDiscord | <nnsee> In reply to @NimEventer "New post on r/nim": huh? |
16:34:51 | FromDiscord | <leetnewb> In reply to @nnsee "huh?": mitm? |
16:35:02 | FromDiscord | <nnsee> seems like it |
16:35:13 | FromDiscord | <nnsee> because I honestly can't reproduce |
16:35:54 | FromDiscord | <nnsee> someone should ask them for the exact error message |
16:36:16 | FromDiscord | <nnsee> In reply to @leetnewb "mitm?": oh, you already did |
16:36:42 | FromDiscord | <nnsee> follow up question would be what authority chain the cert they're being served has |
16:36:58 | FromDiscord | <nnsee> have to click on the little shield/padlock/whatever and inspect the details |
16:37:09 | FromDiscord | <leetnewb> super weird that github is being mitm-ed |
16:38:49 | FromDiscord | <nnsee> if they're in a corporate network it might be for NDR purposes, lots of malware is served from github or it's used as a C2 |
16:39:19 | * | azimut quit (Ping timeout: 240 seconds) |
16:43:18 | FromDiscord | <patitotective> I've thinking about this for a while but should I do `requires "karax >= 1.0.0 & < 2.0.0"` for my nimble package dependencies? |
17:12:55 | FromDiscord | <parabola> hi y'all, is there any type in nim like size\_t in c or usize in rust? |
17:14:14 | FromDiscord | <JJ> uint? |
17:15:13 | FromDiscord | <parabola> isn't uint basically the same as unsigned int? i mean it's not as idiomatic as saying size\_t or usize |
17:20:10 | FromDiscord | <bostonboston> https://nim-lang.org/docs/ctypes.html#csize_t |
17:20:19 | * | PMunch joined #nim |
17:22:02 | PMunch | AoC day 11 stream up early today! https://www.twitch.tv/pmunche https://www.youtube.com/watch?v=DQly0b4TjWQ |
17:24:26 | FromDiscord | <parabola> should this be used everytime we need to represent any type of size in bytes?↵(@bostonboston) |
17:24:59 | FromDiscord | <parabola> seems like a c-compatibility thingy |
17:25:19 | FromDiscord | <bostonboston> I have personally never used it, unit/uint32/int always works fine for me |
17:25:35 | FromDiscord | <bostonboston> But I'm also not dealing with very large things |
17:28:40 | FromDiscord | <parabola> in that regard, we should always use uint for dealing with sizes because its maximum value depends on the platform, instead of for example uint64? |
17:30:09 | FromDiscord | <bostonboston> Don't quote me but I remember reading somewhere that the Nim compiler takes care of the size of `int` for you based on architecture so I would assume `uint` is the same |
17:32:15 | FromDiscord | <parabola> yeah i know |
17:32:17 | FromDiscord | <parabola> thanks |
18:14:22 | FromDiscord | <Chronos [She/Her]> In reply to @parabola "isn't uint basically the": Unfortunately Nim doesn't have anything like usize |
18:14:33 | FromDiscord | <Chronos [She/Her]> It does have csize_t but, that's mostly for C interop |
18:15:46 | FromDiscord | <Chronos [She/Her]> You can always do `type usize = uint` to make `usize` and alias to `uint`, perhaps? Or you could do `type usize = distinct uint` to make it a special type (then you could probably have a converter for making uints work as usizes implicitly) |
18:16:10 | Amun-Ra | usize shouldn't be distinct |
18:16:27 | Amun-Ra | I'd go with type usize = BiggestUInt |
18:17:40 | FromDiscord | <Chronos [She/Her]> In reply to @Amun-Ra "usize shouldn't be distinct": Why shouldn't it? You'd have to implement the arithmetic operations but, it'd be better I'd imagine for being idiomatic? |
18:18:43 | Amun-Ra | it's just a type capable of storing any size |
18:19:11 | FromDiscord | <Chronos [She/Her]> It's dependent on the platform's natively supported uint in Rust |
18:19:15 | FromDiscord | <Chronos [She/Her]> Maybe I'm tainted :p |
18:20:21 | Amun-Ra | I'm not a fan of rust, I read usize as size_t ;) |
18:31:17 | * | PMunch quit (Quit: leaving) |
18:51:56 | FromDiscord | <Chronos [She/Her]> Fair |
19:34:28 | * | krux02_ joined #nim |
20:14:38 | FromDiscord | <parabola> aahh finally someone who doesn't "love" rust↵(<@709044657232936960_=41mun-=52a=5b=49=52=43=5d>) |
20:16:10 | FromDiscord | <Chronos [She/Her]> I don't love Rust, just learning the lang and like some things about it- |
20:22:01 | FromDiscord | <bostonboston> I could never like rust, syntax is too similar to cpp and rust developers are horrible at naming things |
20:22:21 | FromDiscord | <Phil> I mean, there's a fair amount of those here, mostly because of syntax preferences |
20:38:54 | FromDiscord | <nnsee> i like rust's iterator and the chaining ops it lets you do |
20:39:04 | FromDiscord | <nnsee> (edit) "iterator" => "iteratosr" |
21:12:27 | FromDiscord | <Chronos [She/Her]> I do like how it lets you do results and options for error handling tbf |
21:15:07 | FromDiscord | <Phil> ... is there a way to get nim doc to not absolutely slaughter my beautiful doc comment formatting? |
21:15:53 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
21:16:08 | FromDiscord | <Phil> This is what nim doc turns that into https://media.discordapp.net/attachments/371759389889003532/1183879917524488283/image.png?ex=6589f117&is=65777c17&hm=c34758952a6a87ec866f7fff440fb68a9a5bde71c2b40f0f94958de05b374c8a& |
21:27:30 | FromDiscord | <ElegantBeef> @Phil look at matrix 😄 |
21:28:39 | FromDiscord | <Phil> Check. And I do in fact need that to work because while it isn't necessarily user-facing, it is visible and also a useful for understanding |
21:28:47 | FromDiscord | <Phil> (edit) removed "a" |
21:34:48 | FromDiscord | <ElegantBeef> Wait why is this 'internal' macro visible? |
21:35:10 | FromDiscord | <ElegantBeef> Someone is leaking implementation details |
21:35:56 | FromDiscord | <Phil> In reply to @elegantbeef "Wait why is this": Because I also need it in "integration" modules, e.g. those providing better integration with specific libraries, in this case only owlkettle |
21:36:08 | FromDiscord | <ElegantBeef> Why? |
21:36:41 | FromDiscord | <ElegantBeef> Are you actively using that procedure inside the module? |
21:36:58 | FromDiscord | <ElegantBeef> Or is this just a template/macro expansion that you do not know how to get around another way |
21:37:05 | FromDiscord | <Phil> Because I'm first solving the general usecase, agnostic of whatever I want to integrate with, and then do more specific stuff for special usecases that need it.↵Owlkettle in this case requires it because I need to split up the code-generation for owlkettle |
21:37:40 | FromDiscord | <Phil> Because I need to first generate all my types, then define the App widget, then generate my routing procs |
21:38:00 | FromDiscord | <Phil> So I can't do it all in one go unlike how I'd do without said module |
21:38:33 | FromDiscord | <ElegantBeef> Right, but are you calling `asEnum` inside your owlkettle module or from your macro module? |
21:38:46 | FromDiscord | <Phil> inside the owlkettle module |
21:38:55 | FromDiscord | <ElegantBeef> Ok then carry on |
21:40:12 | FromDiscord | <ElegantBeef> I wrongly assumed that this was called inside a template and you were hitting a `UnknownIdentifier(asEnum)` |
21:40:17 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
21:41:24 | FromDiscord | <Phil> Ah, no, this is more that given the complexity that integrating with owlkettle brought with it, I'm half regarding threadButler as more of a useful base implementation and for decent integration with any kind of framework that has its own event-loop you'll have to write some code to make integration easier. |
21:41:59 | FromDiscord | <Phil> Like how with owlkettle I had to set up a global timeout for listening for messages from another thread which can then trigger a redraw etc. |
21:42:30 | FromDiscord | <Phil> And how the "handler"-procs specifically on the owlkettle thread need to have access to AppState in order to do anything useful |
21:43:58 | FromDiscord | <Phil> So all this stuff is "public" to make it easy to write your own integration module, in the end you'll always either only import the `threadButler` module or `threadButler + threadButler/integrations/<framework>Utils`↵(naming suggestions for the module names or a better name for "integrations" dir are welcome) |
21:50:59 | * | azimut joined #nim |
22:07:44 | * | xaltsc joined #nim |
22:34:21 | * | advesperacit quit () |
23:19:09 | * | Jjp137 quit (Remote host closed the connection) |
23:19:38 | * | Jjp137 joined #nim |
23:26:43 | * | oddish_ joined #nim |
23:30:53 | * | oddish quit (Remote host closed the connection) |
23:30:53 | * | oddish_ is now known as oddish |
23:46:22 | FromDiscord | <Phil> Thinking it through, the entire "You can have N threads and just pin a name to them and I generate an object variant you can send through a channel to that thread" setup may require me to also generate the "ChannelHub"-type that I was thinking of, including like half a dozen procs to manage said type |
23:48:10 | FromDiscord | <Phil> So I can have an object-type that I add one field with a Channel to per thread that you register.↵Or maybe I can get away with storing the channels as pointers in a map, somehow figuring out the object variant that should work with a given channel, typecasting it back and using it to send a message through, that should avoid even more codegeneration as I'm already imo doing too much of that |