The workbench
Think by making.
Small experiments that run in your browser. Pick one. It opens here, on the bench.
Bench 01 / Beneath the interface
How software runs.
Scheduling, compiled code, and search, one small view at a time.
A little WebAssembly
Call a compiled C function from JavaScript. Then read the 65 bytes of its WebAssembly module.
Run add(a, b) to call the compiled C function.
Preparing the module…
Bytes
Text
(module (type (;0;) (func (param i32 i32) (result i32))) (func (;0;) (type 0) (param i32 i32) (result i32) local.get 1 local.get 0 i32.add) (memory (;0;) 2) (global (;0;) (mut i32) (i32.const 66560)) (export "memory" (memory 0)) (export "add" (func 0)))Select a part to read what its bytes do.
Step through add(21, 21)
20 01local.get 120 00local.get 06ai32.add0bend
- local 0 a
- 21
- local 1 b
- 21
- empty
The stack is empty. Step runs one instruction.
The compiler put b first. Addition gives the same result in either order.
// Compile with clang for the wasm32 target. This function has no runtime dependencies.
int add(int a, int b) {
return a + b;
}Compiled withclang --target=wasm32 -O2 -nostdlib -Wl,--no-entry -Wl,--export=add -Wl,--strip-all add.c -o add.wasm
- What this shows
- The module has a header and six sections. JavaScript calls the exported add function. The function adds two 32-bit integers, so a large result wraps around.
- Honest note
- Clang compiled the C source. A small interpreter on this page runs the same bytes, and your browser's engine checks the result.
Bench 02 / Many hands
Building together.
People and AI change one piece of work. Watch the work stay whole.
Bench 03 / Things in motion
A ball and an arm.
A cricket delivery and a robot arm. Each one moves by a small rule.
Field notes
The experiments run locally in your browser.
Small enough to inspect.