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

what a difference one line of code makes!

commit fe18dc5 moved the line @saved_record : self | Nil = nil from the module Ktistec::Model::InstanceMethods into the macro Ktistec::Model.included.

that single change cut the build time in half and reduced the memory required to build by about a third. you can be sure the improvement came as a surprise!

but really, it wasn't just this change itself—although it introduced the biggest improvement—because after all of the subsequent refactoring, simply moving the line back didn't increase the build time again.

the build time also improved slightly after other subsequent commits. and several of those commits introduced changes that reduced the amount of macro generated code. and that's the key insight: macros reduce visible boilderplate but don't reduce actual code that needs to be compiled.

i'm still investigating, but clearly the original placement of the line resulted in the generation of a lot of redundant/unnecessary code!

TL;DR if you're planning on using macros in crystal, check your build times before and after your changes—i'm sure there's a corresponding commit somewhere in the past that introduced this problem and i didn't catch it!

#ktistec #crystal

Todd Sundsted

i logged in to my twitter account yesterday... my last two tweets were in 2018, then only one in 2017—so i haven't exactly been active. but i have to hand it to all of my old tweeps who are still active and keeping it together over there!

:birdsite:

Todd Sundsted𒀭𒂗𒆠 ENKI ][e

OpenAI Shuts Down GPT-3 Bot Used To Emulate Dead Fiancée futurism.com/openai-dead-fianc

Todd Sundsted

it seems like people talk about activitypub everywhere except on the fediverse.

Todd Sundsted

日本語を勉強している

Todd Sundsted
Todd Sundsted

the first thing i wrote on my sinclair zx81 was a space shooter in basic that used print at to move ships around the screen. it was so laggy it was impossible to play. i didn't know z80 machine language. the last thing i wrote on my zx81 was a z80 disassembler—by then i'd learned machine language and had rewritten the space shooter, as well as written a text-based adventure game (in basic). i learned a lot about programming for $99.

rip clive sinclair

#zx81 #sinclair

Todd Sundsted

building ktistec is still an endeavor—both in time and in space. i have work ahead of me to reduce the build footprint—since starting this project, i've learned that some combinations of the crystal language features i used to recreate rails magic (macros, named arguments and inheritance) are hard on the compiler.

in any case, having exceeded the capacity of the tiny linux vps that hosts epiktistes, i set out to build a statically linked executable on my laptop (macos mojave) that i could deploy to my vps (linux centos).

the official instructions, using docker and alpine linux, are here. to get it to build, i had to install the static libraries for sqlite, and to get it to run on my vps i had to specify the location of the openssl cert file, which is loaded at runtime and doesn't match the location in alpine linux.

tl;dr the steps

  • build (i haven't automated any of this yet)
    1. docker run --rm -it -v $(pwd):/workspace -w /workspace crystallang/crystal:latest-alpine sh
    2. apk update && apk upgrade
    3. apk add sqlite-static
    4. crystal build src/ktistec/server.cr --static
    5. exit
  • run (after copying the executable to the vps)
    • SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt ./server

#ktistec #crystal

Todd Sundsted

i'm on a serious they might be giants bender...

#tmbg #joinus

Todd Sundsted

commits 99a0fd6 to 70bcf3f implement metrics and charting.

inbox and outbox activity

an instance of the Point model records an occurrence of an event—for example, the arrival of an activity in my inbox. points have a timestamp and a value and can be aggregated by day, week, etc. aggregation takes into account the timezone of the account that's viewing the chart so you'll need to specify a timezone during setup or in your account settings. i use chart.js for the charts.

i'm only collecting inbox and outbox metrics right now, but this will expand to include other types of metrics—social events, errors, etc.

looking at the chart above... i clearly need to post more...

#ktistec