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.
#crystallang 102 hashtags

I just released v2.4.0 of Ktistec. This release encompasses a few things that I've been working on for a while: improved support for operating without JavaScript available/enabled and support for running scripted automations.
Except for a few items, Ktistec now works without JavaScript. Obviously, things like WYSIWYG editing of HTML don't work—I plan to add support for Markdown to compensate. Running in Lynx is a stretch, but...

Since the early days, most controller actions supported both text/html and application/json. I cleaned up support for the latter and have officially documented the Ktistec API in the README.
In addition, I've added support for running bots/automations (prior announcement). The Ktistec server will periodically run any executable script in the etc/scripts directory. These scripts have access to the Ktistec API and can post, follow, share, like, etc. This is experimental and obviously introduces an attack surface, though that shouldn't be a problem on correctly configured hosts.
Here's the full changelog:
Added
Fixed
Changed
formaction. (fixes #101)Other

And we have a new release: Crystal 1.14.0 🚀
Read about the highlights in https://crystal-lang.org/2024/10/09/1.14.0-released/
Happy Crystalling!

have i told you all i love spectator? i love spectator!

I just released v2.3.0 of Ktistec. It fixes a few bugs introduced in the previous release. In particular, it handles a case I've observed a few times in production where the fetching of followed content hangs. The fix adds a monitor that periodically checks for "running" tasks without a backing fiber and sets socket timeouts to ensure requests eventually terminate (I believe the latter actually fixes the problem, but belts and suspenders...)
#ktistec #crystallanguage #crystallang #activitypub #fediverse

Today we celebrate the 12th anniversary of Crystal!
The initial commit was on September 4, 2012 🎉
https://github.com/crystal-lang/crystal/commit/220bb8c736381d5beda5e7bc36c8d7f0d59badf6

I just released v2.2.0 of Ktistec. A lot of code was written but the main user-visible change is streaming timeline updates to the web client using server-sent events. The back-end pub/sub framework will also make it easier to decouple some components down the road.
I want a visual indicator that new posts are in my timeline. I appreciate that not everyone feels the same way—if there's interest I may make it switchable.
And now, off to #worldcon!

for reasons i don't understand, some restarts of epiktistes result in huge memory usage spikes—reported both by the garbage collector and the operating system. what's interesting is heap size and free memory move roughly in tandem (though the difference isn't constant), which implies that there is free memory, but perhaps it's too fragmented to be useful?

a restart typically fixes the problem...

#crystallang developers… what can you count on being safe to access during a call to #finalize?
i have some class-level state that i’d like to modify via a class variable but even reading values via that variable seems to cause problems that eventually lead to crashes later in the program. (typically index out of bounds during some later garbage collection run.)

Do you know why LavinMQ can handle so many connections and process that many messages?
There are several reasons, but one of them is because developers can understand the library code the application runs.
https://crystal-lang.org/2024/05/22/lavinmq-understanding-code/

When you optimize a Crystal program, pay attention to language features that inline code. For example, pay attention to how you use blocks (consequences here and here).
Also pay attention to how you use macros. Macros, like ECR.embed and Slang.embed, inline code at the point where they are invoked. This can be powerful, because macros actually generate code—but, ten invocations later, you have ten copies of the code.
Here's a case of too many copies, but with a very happy ending...
Ktistec uses both ECR.embed and Slang.embed to generate web pages from views and partials. I wrote code to count the number of places Ktistec used embed for each view and partial it renders. There's a long tail, but here are the big ones:
| src/views/layouts/default.html.ecr | 204 | | src/views/partials/modals.html.slang | 204 | | src/views/partials/header.html.slang | 204 | | src/views/partials/footer.html.slang | 204 | | src/views/pages/generic.html.slang | 155 | | src/views/partials/object/label.html.slang | 36 | | src/views/partials/object/content.html.slang | 36 | | src/views/partials/collection.json.ecr | 28 | | src/views/partials/thread.html.slang | 12 | | src/views/partials/detail.html.slang | 12 | | src/views/partials/object.html.slang | 12 | | src/views/partials/actor-panel.html.slang | 11 | | src/views/partials/object.json.ecr | 11 | | src/views/partials/paginator.html.slang | 11 | | src/views/objects/thread.json.ecr | 8 | | src/views/partials/activity/label.html.slang | 6 | | src/views/mentions/index.json.ecr | 6 | | src/views/remote_follows/index.json.ecr | 6 | | src/views/settings/settings.json.ecr | 6 | | src/views/tags/index.json.ecr | 6 | | src/views/activities/activity.json.ecr | 5 | | src/views/partials/editor.html.slang | 5 | | src/views/objects/object.json.ecr | 5 | | src/views/actors/remote.json.ecr | 4 | ...
The layout is part of every page and is rendered with every view, so lots of copies. Every page has a header and a footer (and some default modal dialogs) so you get those, too. The generic view is a little less obvious. It's used to render pages for which there is no more specific view—typically pages served for 400 Bad Request or 401 Unauthorized. Objects (posts) are rendered in a variety of contexts, so it's no surprise label.html.slang and content.html.slang are popular.
ECR.embed and Slang.embed inline templates at the point where they are invoked, but beyond that they don't really customize the generated code—they just duplicate it. What we want is one function for each view or partial, which wraps embed and returns JSON or HTML.
Those changes mostly occur in commits from 399287cf to 4b025f50. To say that they made a huge difference is a gross understatement. Executable size decreased by ~13%. Build time decreased by ~50%, and the memory required to build decreased by ~30%.