08 December 2021

sml-server provides a small foundation for writing HTTP servers whose requests are handled by Standard ML code. It builds on the sml-http library and the Standard ML Basis Library’s sockets, and works with both MLKit and MLton. Dependencies are managed with smlpkg, so the server can be included as a library in an ordinary Standard ML project.

Together with the SMLserver demonstration, it replaces the earlier, no-longer-supported SMLserver implementation. The original system ran compiled Standard ML bytecode inside AOLserver; the new approach compiles the application into an executable that runs its own HTTP server. It carries forward the idea of using Standard ML’s types, functions, and modules to build web applications, with a simpler deployment model. The current server is single-threaded.

The demonstration brings together HTML and SQL quotations, PostgreSQL connectivity, and HTTPS fetching through OpenSSL. It provides a practical starting point for building database-backed web applications with MLKit.

The earlier work provides the background: