Demonstration of sml-server in concert with a few MLKit extensions and libraries:
-
Quotations for writing HTML and SQL queries.
-
Database connectivity using a Postgresql client API (mlkit-postgresql).
-
Fetching of HTTPS pages using OpenSSL (mlkit-ssl-socket).
A working MLKit installation. You may download a binary release from the MLKit Github site.
The package manager smlpkg. Use
brew install smlpkg on macOS or download a binary release from the
smlpkg site.
A Postgresql database installation.
For details, see the Github Action file.
To test the web server, first do as follows:
$ cd src
$ make prepare
$ make
...
$ ./demo.exe
HTTP/1.1 server started on port 8000
Use C-c to exit the server loop...
Now, request the location http://localhost:8000 using your favorite browser.
Help is available by passing the --help command-line option.
This code base (together with sml-server) replaces the no-longer supported old SMLserver code [1,2], which used a bytecode interpretation approach to serve web pages [3].
The server is currently single-threaded and future work will investigate the possibilities for crafting a multi-threaded server.
Copyright (c) 2022-2026 Martin Elsman, University of Copenhagen.
See LICENSE (MIT License).
[1] Martin Elsman and Niels Hallenberg. Web Programming with SMLserver. In Fifth International Symposium on Practical Aspects of Declarative Languages (PADL ‘03). New Orleans, Louisiana, USA. January 2003. pdf.
[2] Martin Elsman, Niels Hallenberg, and Carsten Varming. SMLserver — A Functional Approach to Web Publishing (Second Edition). IT University of Copenhagen, Denmark. April, 2007. pdf.
[3] Martin Elsman and Niels Hallenberg. A Region-Based Abstract Machine for the ML Kit. Royal Veterinary and Agricultural University of Denmark and IT University of Copenhagen. IT University Technical Report Series. TR-2002-18. August, 2002. pdf.