Skip to content

melsman/sml-server-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sml-server-demo CI

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).

Assumptions

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.

Testing

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.

Previos and Future work

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.

Authors

Copyright (c) 2022-2026 Martin Elsman, University of Copenhagen.

License

See LICENSE (MIT License).

References

[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.

About

SMLserver demo

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors