Home / Blog / Sula: A Gemini protocol server written in Scryer Prolog
Tech News

Sula: A Gemini protocol server written in Scryer Prolog

Sula is a Gemini protocol server written in Scryer Prolog, surfaced on Hacker News and named for the Spanish suffix of capsule, Cápsula, via su.la. It is not…

By Dillip Chowdary • Aug 05, 2026 • Source: Hacker News Front Page

Sula: A Gemini protocol server written in Scryer Prolog

Sula is a Gemini protocol server written in Scryer Prolog, surfaced on Hacker News and named for the Spanish suffix of capsule, Cápsula, via su.la. It is not a thin wrapper around an off-the-shelf HTTP stack. It is a full Gemini server implemented in a logic-programming runtime that, as shipped, is not enough on its own: Sula depends on a patched Scryer Prolog on the js/fixes branch rather than stock Scryer.

The patches map directly onto how a TLS Gemini server has to behave under real I/O. A native $copy_stream/2 streams binary file bodies to TLS clients without materialising the whole payload on the Prolog heap. A fix in library(pio)’s buffer_prepare_for_n/5 stops lazy reads from process pipes and similar streams from spinning when at_end_of_stream/1 never reports true, so EOF actually ends the read. socket_server_accept/4 gains a non-blocking poll loop that checks Scryer’s INTERRUPT flag so SIGINT surfaces as a catchable $interrupt_thrown exception instead of sitting behind a blocking syscall. TLS is moved to rustls, and tls_server_negotiate is changed so the optional client certificate is part of negotiation—matching Gemini’s common use of client certs for identity.

Advertisement

Tech Pulse Daily

Get tomorrow's pulse first

Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.

For engineers, the interesting part is the gap between a language runtime’s default I/O model and what a long-lived network server needs. Heap-safe streaming, EOF on non-file streams, interruptible accept, and first-class client certificates are not luxury features; they are the difference between a demo that serves a few capsules and a process you can run, stop, and reason about under load. Building Sula in Scryer forces those requirements into the open as concrete builtins and library fixes rather than leaving them buried in C glue.

In market and competitive terms, Gemini remains a small, deliberately constrained alternative to the modern web stack—TLS by default, no cookies or scripts in the usual sense, and often client-certificate identity. Most public Gemini servers sit on more conventional systems languages. Sula’s bet is different: use a pure Prolog implementation (Scryer) and pay the cost of runtime work so the server logic stays in Prolog. That puts it next to other “unusual language does network protocol” projects more than next to high-throughput reverse proxies; the differentiator is not QPS claims, which are not provided here, but the proof that Scryer can host a real Gemini path once streaming, pipes, accept, and TLS are fixed.

If you want to run it, the path is explicit: clone the patched Scryer from https://git.sagredo.dev/scryer-prolog on branch js/fixes and install with cargo, then use that build for Sula. What to watch next is whether those five changes—$copy_stream/2, the pio EOF fix, interruptible accept, the rustls port, and client-cert negotiation—land upstream or stay on js/fixes, because that decides whether Sula stays a fork-dependent experiment or becomes something others can build without carrying a private Scryer tree.

Advertisement

🔎 More interesting news

5-min tech signal

Weekday briefing for engineers who skip the noise.

No spam · Unsubscribe anytime

Advertisement

✈️ CareerPilot

Your AI job-search copilot

Match your resume against live Ashby, Greenhouse & Lever openings — fit scores, job-specific resume optimization and email alerts.

Find matching jobs →

Free Tools

Browse all tools →