Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 464 Bytes

README.md

File metadata and controls

29 lines (22 loc) · 464 Bytes

compile-to-wasm-from-scratch

A simple example of compiling a minimal language to WebAssembly from scratch.

Example

def sum_to(n) =
    if n then
        n + sum_to(n - 1)
    else
        0

Usage

Prerequisites:

Install the dependencies:

opam install core

Run a .ctwfs file:

sh run.sh examples/sum_to.ctwfs