On the subject of re-writing the same thing over and over again.
For #doauth I need to capture detached signatures[1] in #API.
I made a `:> Capture ` query on #hackagesearch website[2] and after very very brief exploration, an API capturing something called `SessionToken`[3] caught my eye.
Upon inspection it turned out that they have B64 encoding as well, except significantly less deranged than mine.
[1]: https://hackage-search.serokell.io/?q=%3A%3E+Capture+
[2]: https://hackage-search.serokell.io/viewfile/battleplace-0.1.0.10/BattlePlace/WebApi.hs#line-44
Going live with #haskell development in 6 minutes:
Implementing #doauth, an #aaa system that just works (for the people).
https://watch.doma.dev/videos/watch/ea6a5813-3803-4bd3-945b-5150edde8004
#mastodon is very stable in terms of memory consumption!
But I'm thinking about what we're really doing here in #fediverse and I'm comparing it with, let's say, resource footprint of #circumlunar community (Zaibatsu / ... / Soviet) and realise that their footprint is kind of zero.
Everyone is on one of the three manually federated servers, using UNIX / pre-UNIX tools to communicate with each other, with the only non-UNIX tool being IRC.
Somehow it doesn't take 2GiB of memory and somewhat constant CPU load for #sundogs to exchange bytes.
I get that to host huge instances like mastodon.social, it makes sense to have #pgsql, but it feels like individual instances should be able to be cohosted on the same machine.
I'm committed to explore using file system and files for #doauth persistent storage backend.
But that also brings me to a dilemma of whether or not to use #elixir for the rewrite or to use #rust, to decrease footprint.
Obviously, #elixir will yield more stable, fault tolerant code with easier replication. #Rust, however will reduce excess footprints to 0 at a cost of longer development time (I'll need to benchmark current #tokio-based HTTP servers and see if I need to write my own dead simple server that doesn't use generics / isn't bloated), and it can easily eat up a month of my time.
Maybe it's all non-issue, especially if there's just one BEAM machine launched per host and we plug our applications into it (as intended)...
I think that the fact that I'm heavily leaning towards #elixir as the main production technology even though "close-to-metal" argument is important to me is a clear sign I should use it for production in #doma.
Ended up with a pretty gross and not total From/To-JSON instance for Signature:
https://git.sr.ht/~jonn/do-auth/commit/c5ec5c21709066bc9d788eefde6419b597c95225
I'm embracing partial functions on purpose (I wish #haskell had #purescript's Partial typeclass).
I'd like my mission-critical software to crash when something unexpected happens and rather enter a recovery mode, a la #erlang
But that's also the reason why I'll most likely do a rewrite of #doauth in #elixir for v1 -- fault tolerance facilities are virtually limitless in the #BEAM world.
That https://doma.dev guy
#lean #rust #typescript #react #nix
In my non-existent free time I design and run #TTRPG
If you use tools made by genocide-apologists, you are a genocide-apologist.
#lemmy users aren't welcome here.