Epiktistes

Epiktistes is my home in the Fediverse. It is an instance of Ktistec, a single-user ActivityPub server like Mastodon, but with fewer users and fewer commits. Here's my introduction (last updated early-2025).

I wrote a series of posts about optimizing the performance of the Ktistec server, its build time, and its executable size: part 1, part 2, part 3, part 4, and part 5.

Some things I regularly write about, organized by hashtag:

I also wrote some #pointfreeverse.

Todd Sundsted

great main gig day at the world petrochemical conference in houston. i know that doesn’t sound cool, and maybe even sounds a little alarming but the content today was on things like alternative (net zero) fuels, regulatory drivers needed for net zero in maritime by 2050, and (my topic) the systemic factors that inhibit decarbonization in ocean shipping. there’s a lot of work to do!

#decarbonization

Todd Sundsted

commits 984e28b7 through a367c215 include changes that support following threads, hashtags and mentions:

  • index pages for threads, hashtags and mentions include a follow/unfollow button
  • following a thread, hashtag or mention results in notifications when new posts arrive that are part of the thread or include the hashtag or mention
  • to support navigation and discovery, the details pages for posts include labels with links to the index pages for hashtags and mentions

next up is support for actively finding and fetching followed content from elsewhere in the fediverse.

also included are a bunch of bug fixes, some internal enhancements, and greatly reduced build times and executable sizes.

#ktistec

Todd Sundsted

the crystal programming language always inlines blocks, which is great for performance but trades off space for speed. using blocks effectively means keeping this in mind.

somewhere along the line, i learned the habit of passing a block to a function as a means of customizing the behavior of the function. if the function that takes the block is large, it's important to remember that the body of the function is inlined where the function is called, which may not be what you are expecting. if you call the function multiple times, you even get multiple copies.

i just committed code that fixes an egregious example of this problem. in this case these ~30 lines of code replace the blocks with procs (which aren't inlined) and cut ~24mb (that's megabytes) off the executable (over a third of its size).

i regularly shoot myself in the foot trying to be clever, so i don' t know how prevalent this problem is in practice, but it's definitely something to keep in mind, especially if you see compile times and executable sizes growing!

#crystallang #ktistec

Todd Sundsted

"You have attributed conditions to villainy that simply result from stupidity."
Robert A. Heinlein, Logic of Empire

Todd Sundsted

...well, for future reference, Invalid memory access (signal 11) at address 0x7ff7b19429f8 likely means the application has overrun its stack, especially if the stack trace shows even moderate recursion.

about the recursion though, this error happened after only 5 recursive calls (not 50,000) and that caught me off guard. i've been recently conditioned to think the stack only holds primitive values and references (pointers) but crystal, like c and similar languages, lets you pass around structures (instances of struct) by value and those values can be arbitrarily large.

now i need to figure out how to debug the contents of the stack...

#crystallang

Todd Sundsted

i'm not convinced some people are smarter than other people in any interesting objective sense. i think some people are just more confident.

Todd Sundsted

sometimes i feel like my fingers are running off a large language model and stochastically autocompleting (incorrectly) the words i think i want to type...

Todd Sundsted

as complicated as emacs keybindings are, it always amazes me that i still accidentally hit C-x C-c and unintentionally kill the editor...

Todd Sundsted

it looks like non-browser network access to fosstodon is being blocked by cloudflare which is breaking federation with my instance. wondering if anyone else is being affected or if this is somehow being limited to non-mastodon instances (or just mine)...

Todd Sundsted

deployed some new code this morning... took the shortcut and just built a static binary locally and copied it over to the server but forgot to deploy the associated configuration files. now i need to manually repair the database... 😠