Gleam Web Servers
TL;DR
mist server
wisp framework
lustre html rendering and frontend interaction
probably with nginx out front for static-files and https
html template engines are broken or very basic.
As usual, the documentation on those package pages is weak - though it seems Lustre has a lot of outside write-ups. I’m going to start at the bottom and work up. Next up - learning mist.
The web server landscape
There are a few of them. I’m taking quick look at them all to save you some time.
Pure Gleam
mist - the standard. probably should have a good reason to use something else. HTTP1.1, WebSockets
ewe - friendly competition for mist, seems pretty full-featured
smol - js-runtime only.
dew - inactive, very basic server
Adapters to Erlang servers
gleam_cowboy - wrapper for Erlang’s standard server : Cowboy. HTTP/2. slower than mist, not as well-typed?
gleam_elli - wraps the simple and fast Erlang Elli. looks very simple!
espresso - inactive, built on top of cowboy
Frameworks: routing, middleware, cookies, parsing.
External Servers - often running in front of the above to handle HTTPS and static files
Nginx
Caddy
HTML building
Templates - traditional text templating engines. none seem full-featured. I mostly have used jinja2 in python and it has extensive features. never needed anything more. BUT BUT BUT - embedding logic in the templating language seems unpopular in gleam-land
chaplin - at least this one works and is documented! Mustache text templates using Erlang’s bbmustache
very hard to find what subset of mustache is supported, but this might be very limited. oh Mustache has no if statements, else clauses, or for loops.
handles_foxed - pure gleam moustache and Handlebars (updated fork of handles) - only has variables, if/unless, each, and some notion of partial tags. handlebars has some funny ideas of adding your own functionality which can be used to do loops and things. weird.
ginger- not working, and underdocumented. jinja2 - style - vars, loops, if - not sure how much further it goesgtemplate- not working. a simple text-file and dict template system - looks like a small subset of jinja2 - just substitutions, loop, if, and some beginnings of a block…macha - can’t find this on hex since it’s a Rust utility that builds gleam modules from templates - then you use those modules. WEIRD. It has some more advanced templating features though.
Erlang
ErlyDTL - djanjo templates, not under active dev, but seems stable.
Mustache.erl - alpha. and logic-less
Erlte ?
stge - minimal
code-structured
lustre’s declarative api
nakai - works with gliew
html_dsl
html_components
htmz

