A simple example of compiling a minimal language to WebAssembly from scratch.
def sum_to(n) =
if n then
n + sum_to(n - 1)
else
0
Prerequisites:
Install the dependencies:
opam install core
Run a .ctwfs
file:
sh run.sh examples/sum_to.ctwfs