This action will delete this post on this instance and on all federated instances, and it cannot be undone. Are you certain you want to delete this post?
This action will delete this post on this instance and on all federated instances, and it cannot be undone. Are you certain you want to delete this post?
This action will block this actor and hide all of their past and future posts. Are you certain you want to block this actor?
This action will block this object. Are you certain you want to block this object?
Are you sure you want to delete the OAuth client [Client Name]? This action cannot be undone and will revoke all access tokens for this client.
Are you sure you want to revoke the OAuth token [Token ID]? This action cannot be undone and will immediately revoke access for this token.

| Introduction | https://epiktistes.com/introduction |
|---|---|
| GitHub | https://github.com/toddsundsted/ktistec |
| Pronouns | he/him |
| 🌎 | Sector 001 |

I've been on the Fediverse since January 2017. I initially ran a single-user instance of Mastodon. In March 2020 I started to write Ktistec, my own implementation of an ActivityPub server in Crystal (a language with the ergonomics of Ruby but the speed of Go) because I wanted something more supportive of writing. This #introduction was written and published on Epiktistes, my Ktistec instance.
I'm an Engineer by training but now I run teams for companies in climate-tech.
I love #music, #sciencefiction and #fantasy literature (yes, I'm an R. A. Lafferty fan), attend fan conventions like #worldcon and #dragoncon, and do regular #weightlifting. I am also learning to play the #bagpipes, and I'm (re)learning #japanese.

The Ktistec executable is now ~24.7% smaller and build times are 28% faster.
I've been blogging about optimizations here, here, and here. This is the summary of the final outcome, with links to commits for the curious. I have one more post planned with a summary of my thoughts.
Here's my approach. Use nm to dump the symbols in a release build executable and then look for things that seem redundant. The first change and associated post below is a great example of what I mean—my original implementation led to the specialization of the #== method for every pairwise combination of model classes even though the result of the comparison was just false.
This might seem like a strange approach if you come from a compiled language where you mostly write all of the code yourself or invoke generics explicitly, but Crystal takes your code and does that for you. And it's not always obvious up front (to me, at least) what the final cost will be.
I've include counts of the lines added/removed because the point of this whole post is to say if you measure first and then optimize, a small change can have a big impact.
Here are the changes:
#==. (+7 -5)Hash. (+2 -2)__for_internal_use_only that get passed both named tuples and hashes by going all in with named tuples. It also eliminates instantiations of the Hash generic type itself for these cases. Reduces executable size by ~2.2%.__for_internal_use_only entirely.InstanceMethods instance methods. (+1 -5)map from base ActivityPub model classes. (+10 -2)map is a class method defined on each ActivityPub base model class. Each definition maps JSON-LD to a hash that is used to instantiate the class. Class methods defined on a base class are available on subclasses, as well. Calling the method on the subclass results in a copy of the method. This change reduces the executable size by ~5.8%.map into helper. (+104 -88) map method does not depend on class/instance state. This change ensures that the mapping code is not duplicated even if a subclass's map method is accidentally again called. It looks like a lot of changes but this commit is mostly reorganization. It reduces executable size by ~0.4%.I'm off to optimize some queries now...

After I release a new version of ktistec, I build the server commit-by-commit to see which commits increase the server executable size and build time the most. I do this because I’ve learned that small implementation details (inlined code, small methods, using blocks) can have large impacts on these numbers.
Here's the output:
Commit Size Time ======== ========== ======= ===== ======= 248850b1 36426264 10.3 47268073 36425688 -0.00% 10.5 +1.60% 344de272 36425688 +0.00% 10.8 +3.24% ef561f52 36425944 +0.00% 10.8 -0.08% 8ae2cbd4 36429128 +0.01% 10.8 -0.01% 3e425f3b 36429128 +0.00% 10.8 +0.22% 1487d903 36427704 -0.00% 11.0 +1.42% 935c9ceb 36427016 -0.00% 11.0 +0.14% de37dc6a 36427016 +0.00% 10.9 -0.97% a660a326 36427016 +0.00% 10.8 -1.12% ff3d990e 36427016 +0.00% 10.8 +0.54% 5724a58d 36523192 +0.26% 11.0 +1.78% 7b5057d4 36523640 +0.00% 11.0 -0.44% 30ca6a3f 36541352 +0.05% 11.6 +5.73% e2327eea 36671592 +0.36% 11.0 -5.36% ad0d76eb 36671592 +0.00% 10.9 -0.48% d388e74f 36671592 +0.00% 11.4 +4.59% dacea7ad 36671592 +0.00% 11.0 -3.76% 03d5dfd8 36671592 +0.00% 10.8 -1.63% 79d9d89f 36671576 -0.00% 11.0 +1.82% b65d292f 36792376 +0.33% 11.1 +0.95% 0ef53365 36808904 +0.04% 11.6 +4.88% b3766e7b 36808904 +0.00% 11.1 -4.50% 56ba79ce 36825416 +0.04% 11.1 -0.50% 4824df58 36825736 +0.00% 11.1 +0.31% c4705143 36837544 +0.03% 11.1 -0.03% e3d37ef7 36837768 +0.00% 11.5 +3.52% 4509fa0d 36837768 +0.00% 11.0 -3.83% 0ff9237b 36837768 +0.00% 11.0 -0.55%
Overall, the server executable size increased by about 1.1% and the build time increased by about 6.8%. Maybe that's not too bad for a major feature, but let's dig in.
It's nice to see that three commits account for almost all of the increase in server executable size:
But, compare 5724a58d to 8ae2cbd4 (Add `language` to `Account`). It added +22 loc but didn't increase the server executable size as much.
In any case, I'll look at e2327eea first. I'd like to understand why this relatively small change adds 130,240 bytes to the server executable size!

The big feature in release v3.2.2 of Ktistec is pinned posts with support for the Mastodon Featured Posts collection. Federation works both ways—pin a post on Ktistec and it will show up as a pinned post on Mastodon and vice versa. When you refresh an actor profile, Ktistec also fetches and updates the actor's pinned posts. This is another small step in the direction of supporting all features that Mastodon-compatible client applications expect to access via the API. It's also useful in its own right.
The other major feature, which I posted a short video demonstrating here, is X-Ray Mode. X-Ray Mode is a developer and power-user tool for inspecting ActivityPub JSON-LD representations of actors, objects, and other content. Pressing Ctrl+Shift+X on any page displays the data behind the page—like an x-ray. You can:
Alt+Left and Alt+Right to navigate through your viewing historyThis feature is useful for debugging federation issues, understanding ActivityPub structures, and verifying how content is stored and represented.
Here's the full changelog for the release:
Added
Changed
The next release will focus on smaller features and bug fixes.
Enjoy!





The recording of Davide Eynard’s (@mala) “Build Your Own Timeline Algorithm” talk from SFSCON is now live.
In the session, Davide walks through how to build a local, customizable timeline algorithm using https://Mastodon.py, llamafile, and marimo.
Watch the full video: https://www.sfscon.it/talks/build-your-own-timeline-algorithm/


would a "more from this actor" button be helpful on #ktistec? the use case is 1) navigate to an actor you're thinking of following, 2) click on "more from this actor" to fetch ~10 additional, recent posts. is there another feature that would be more useful?

I've streamlined theme development in Ktistec. The theming system uses a hierarchy of CSS custom properties and fallbacks. Theme authors can customize a theme at multiple levels:
Base Colors Only
Define only base colors like --text-primary, --bg-primary, --bg-input, --semantic-primary, etc. Derived colors will auto-generate using color-mix formulas. For example:
:root { --semantic-primary: #ffa500; }From this one line, theme-appropriate colors like --bg-accent-code, --anchor-color, etc. auto-generate.
Base Colors Plus Derived Colors
Define base colors and derived colors. Derived colors use custom values when defined. Undefined derived colors auto-generate. For example:
:root {
--text-primary: #333;
--text-primary-2: #ff0000; /* red for this specific shade */
}Given this theme, derived shades like --text-primary-1, --text-primary-3, and --text-primary-4 auto-generate. --text-primary-2 is red.
The simplest possible interesting theme redefines the primary semantic color. The single line above (in Base Colors Only) would result in the following, with button color, link color, disabled, selected, and hover states all derived automatically:

These changes will be in the upcoming release. Existing themes will continue to work, as is.

Experimenting with x-ray mode for ktistec.

Release v3.2.1 of Ktistec adds support for bookmarking posts. This was so immediately useful I don't know why it took me so long to get around to it!
Pinned/featured posts are in the works for the next release.
The full changelog:
Added
Fixed
Changed
In other thoughts... I'd like to make followed hashtags more consumable. I follow ~10 hashtags and: 1) it's hard to tell what's new, 2) it feels like they arrive in large batches that are difficult to digest, and 3) the reading experience is meh.