Source code from http://www.jamesmolloy.co.uk/tutorial_html/index.html with improved build system and some simplifications. Behaviour is very close to the tutorial so ...
JS runtimes are GenServers. They live in supervision trees, send and receive messages, and call into Erlang/OTP libraries — all without leaving the BEAM.