← All stories
● Covered by 1 source · 1 reportLow impact1 neutral

Sula: A Gemini Protocol Server Implemented in Scryer Prolog

🔄 Updated 1d ago
New to BrevFeed? We gather this story from every outlet covering it into one summary — ranked by real-world impact, not just the latest headline — so you never miss what matters. What is BrevFeed? →

Key points

  • Sula is a Gemini protocol server written in Scryer Prolog.
  • It requires a patched Scryer Prolog for features like native stream copying and non-blocking sockets.
  • Features include TLS via rustls, hostname verification, and content negotiation.
  • The server supports graceful shutdown on SIGINT.

Introduction to Sula

Sula is a newly released server for the Gemini protocol, developed using Scryer Prolog. The name 'Sula' is derived from the Spanish word for 'capsule' suffix, 'Cápsula'. This implementation offers a unique approach to serving Gemini content by leveraging the capabilities of Prolog.

Technical Requirements and Dependencies

Sula depends on a specifically patched version of Scryer Prolog. These patches include a native '$copy_stream'/2 builtin for streaming binary data without materializing it on the Prolog heap, a fix for 'library(pio)' to ensure lazy reads from process pipes terminate on EOF, and a non-blocking poll loop in 'socket_server_accept'/4 to allow SIGINT to be caught as an exception. Additionally, 'rustls' is used for TLS, and 'openssl' must be available on the system PATH for certificate validation.

Key Features

Sula incorporates several features for robust Gemini serving. It uses 'rustls' for TLS and supports PKCS#12 identity files. Hostname verification is performed at startup by checking the certificate's Common Name (CN) against the configured hostname using 'openssl'. Content negotiation is handled by file extension, parsing '/etc/mime.types' and adding 'text/gemini' for '.gmi' files. Text responses are sent via 'format/3', while binary responses are streamed directly using 'copy_stream/2' to avoid Prolog heap traffic. The server also includes per-connection error handling and graceful shutdown on SIGINT.

Running the Server

The 'sula.pl' script is a polyglot launcher that detects 'scryer-prolog' on the PATH and executes it with 'sula:run, halt' as the entry goal. Users can specify the address, hostname, content directory, and certificate directory via command-line arguments. The server is designed for clean shutdown, closing the listening socket and exiting with a 0 status upon receiving Ctrl+C.

✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →

The daily brief

One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.

One email a day. Unsubscribe in one click, any time.

Today's brief

Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.

~7 min · 6 stories · Aug 15

▶ Play today's brief Listen on Spotify

New every morning, and the back catalogue is archived by date.

Reporting from

Sula is a new server implementation for the Gemini protocol, written in Scryer Prolog, requiring a patched version of Scryer Prolog for specific functionalities like non-blocking I/O and efficient binary streaming. This development provides an alternative server option for the Gemini protocol, potentially appealing to developers interested in Prolog-based network services.