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.

Bench 01 / Beneath the interface

A little WebAssembly

Call a compiled C function from JavaScript. Then read the 65 bytes of its WebAssembly module.

Try

Run add(a, b) to call the compiled C function.

Preparing the module…

Show

Bytes

00061736d0100000001070160027f7f01
167f0302010005030100020608017f0141
328088040b071002066d656d6f72790200
480361646400000a09010700200120006a
640b
00061736d01000000
801070160027f7f01
167f03020100050301
2400020608017f0141
328088040b07100206
406d656d6f72790200
480361646400000a09
56010700200120006a
640b

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)

  1. 20 01local.get 1
  2. 20 00local.get 0
  3. 6ai32.add
  4. 0bend
local 0 a
21
local 1 b
21
Stack
  1. empty

The stack is empty. Step runs one instruction.

The compiler put b first. Addition gives the same result in either order.

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.
Back to the bench ↑

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.