scribble source → tokens → tree → WebAssembly

Write a program. Watch it become bytes.

scribble is a small typed language whose programs draw. Its compiler runs in this page: it reads what you type, checks the types, and writes a WebAssembly module byte by byte, with no toolchain behind it. Your browser then runs those bytes. Every stage in between is below.

Edit it. It recompiles as you type.
    The language in one screen
    let n = 5                 // int      let x = 2.5   // num
    fn area(w: num, h: num) -> num { return w * h }
    if n > 3 and x < 9 { ... } else { ... }
    while n > 0 { n = n - 1 }
    repeat 4 { forward(50)  left(90) }
    
    forward(d) back(d) left(deg) right(deg)   move and turn
    up() down() goto(x, y) face(deg)          lift, lower, jump, aim
    color(r, g, b) width(w)                   0 to 255, pixels
    sin(deg) cos(deg) sqrt(x) abs(x) floor(x) random()
    int(x) num(x) print(x)

    Download .wasm