TL;DR
A Common Lisp implementation of the Datastar SDK is available, implementing core SDK features while adapting the Datastar ADR for Lisp. The package supports SSE via Hunchentoot and Clack backends, uses JZON for JSON parsing, and adds zstd compression support.
What happened
A Common Lisp SDK for the Datastar Hypermedia Framework has been published as an open source repository. The implementation follows the Datastar Architecture Decision Record with adjustments for Common Lisp, using CLOS as the object system. The SDK centers on an sse-generator class with two concrete subclasses: one targeting the Hunchentoot web server and another for the Clack environment. Clack-level integration is implemented at the Lack layer and has been exercised with both Hunchentoot and the Woo backend. JZON is used as the JSON parser in the read-signals and patch-signals code paths, although the choice is not described as permanent. Recent changes added compression support across backends using zstd. The repo includes a tests directory with example apps and server setup code; example projects named in the repository include a 2D simulation (Data SPICE) and a Horizons JPL API explorer. The code is distributed under the MIT license.
Why it matters
- Provides a Datastar SDK implementation for Common Lisp developers, enabling integration with Lisp web stacks.
- Includes SSE support with backend-specific guidance, which matters for real-time streaming use cases.
- Adds zstd compression across backends, potentially reducing bandwidth for streaming and payloads.
- Published under the MIT license, simplifying reuse in open source and proprietary projects.
Key facts
- SDK is implemented in Common Lisp and built on CLOS (Common Lisp Object System).
- Core design revolves around an sse-generator class with hunchentoot-sse-generator and clack-sse-generator subclasses.
- Clack integration is implemented at the Lack level and tested with Hunchentoot and Woo backends.
- JSON parsing for read-signals and patch-signals currently uses JZON (not a hard requirement).
- When running Clack with Woo, each SSE connection occupies one Woo worker thread for its duration, limiting concurrent SSE connections.
- Hunchentoot is recommended for applications expecting many SSE connections; Clack+Woo defaults to polling while Hunchentoot uses push by default.
- Compression support was added and currently uses zstd across the supported backends.
- Repository includes tests and example applications (test/ directory), including SSE tests and cases for interrupted connections.
- Installation: clone to an ASDF2-accessible path and load via Quicklisp: (ql:quickload "datastar-cl").
- Code is licensed under the MIT license.
What to watch next
- Planned additional utilities to extend the core SDK functionality (mentioned in the repo).
- Expansion of supported Clack backends beyond Woo and Hunchentoot — the tests note that other backends can be added.
- Whether JZON will be replaced or changed in future updates: not confirmed in the source.
- Release publications or packaged distributions for Quicklisp: not confirmed in the source.
Quick glossary
- CLOS: The Common Lisp Object System, Lisp's standard object-oriented programming facility with classes, methods and multiple dispatch.
- SSE (Server-Sent Events): A web technology that allows servers to push real-time updates to clients over a single unidirectional HTTP connection.
- ASDF2: A build facility for Common Lisp that locates and loads systems and their dependencies; commonly used to organize Lisp source trees.
- Quicklisp: A package manager for Common Lisp that simplifies downloading and loading libraries.
- zstd: A fast compression algorithm and codec (Zstandard) used to reduce the size of transmitted or stored data.
Reader FAQ
How do I load the SDK into my Common Lisp environment?
Clone the repository into a directory ASDF2 can find and then load with Quicklisp: (ql:quickload "datastar-cl").
Which web servers and backends are supported?
The repository provides generators for Hunchentoot and Clack; Clack has been tested with Woo and Hunchentoot backends.
What JSON parser does the SDK use?
The code currently uses JZON for read-signals and patch-signals, but the choice is not described as mandatory.
Is compression supported?
Yes — compression support was added and currently covers the backends using zstd.
What is the license?
The project is released under the MIT license.
Datastar Common Lisp SDK ================================================================ | / DATASTAR HYPERMEDIA FRAMEWORK /___ | D | | C*L | '(DATASTAR-CL) | | /| | | | |_ |__| | COMMON LISP…
Sources
- Common Lisp SDK for the Datastar Hypermedia Framework
- Datastar and Common Lisp for web development – interlaye.red
- Datastar
- Datastar Resources
Related posts
- Implementing Hierarchical Navigable Small World (HNSW) Vector Search in PHP
- OpenWorkers: Rust-based self-hosted runtime for Cloudflare Workers
- Rust–: Modified Rust compiler that disables the borrow checker