A few years ago, while picking up basic OCaml, I found this site by Andrew Ray: https://andrewray.github.io/iocamljs/full402.html . This page has in-browser OCaml notebook. I was trying to modernise it and compile with OCaml 4.06.1. The vital part of the page is an ability to evaluate OCaml at run time in Javascript inside your browser. This is done by Js_of_ocaml. Learn basics of Js_of_ocaml in this post.
Let’s do tradition “hello world” exercise, create a new file hello.ml
:
let () =