KotobaDocs

Executable examples for the Amu course

Six positive examples gradually add integers, arithmetic, let, if, loops, and function calls. Each expects ok from check, 42 from run, and exit code 0. Three negative controls expect checking to refuse the input.

FileAdded featureObserved result
00-literalZero-argument main and i6442
01-arithmetic+42
02-bindingslet42
03-branchComparison and if42
04-looploop/recur42
05-functionsTyped helper call42
negative-nameUndefined variableE2102, exit 1
negative-operationUnsupported slurpE2101, exit 1
negative-typeBool passed to integer additionE2104, exit 1

Record your own observations

Point the observer at an existing native Mac ARM64 Amu CLI and choose a new output directory. It copies inputs there without modifying the originals or overwriting old observations. Replace /path/to with actual locations.

python3 /path/to/amu/scripts/seed/native_build_queue.py -- \
  python3 docs/learn/amu/examples/observe.py \
  --amu /path/to/amu/bin/amu \
  --output /path/to/new-observation-directory

Python only stages files, starts native processes, and records output and hashes. It does not interpret Kotoba or generate machine code. The supplied native Amu performs checking, compilation, and execution. The shared build queue respects existing concurrency limits.

Recorded execution

The raw observations from 6 November 2026 contain 15 macOS ARM64 observations: six check/run pairs and three refusals, all matching expectations. The CLI SHA-256 is 72e26e48e58d0cb9ce58f081b97877ffc132fdfff35ad371963d87aa97c0b310. The record also names compiler-image and packager digests and the source revision, corresponding to Amu's CLI descriptor.

These observations establish that the small examples behaved as expected on that CLI. They do not establish performance, complete language conformance, the DefCID producer, IPLD state, the entire Kototama VM, or Linux/browser execution. Pseudo-IR and identity/admission diagrams in the chapters are explanations, not observer dumps.

Course contents