/ Stream
build 2026.12.03 · --:--:-- UTC · RSS

BabbTools for the frontier.

mascot mascot

Making

SeriesHow Stream Was Created

15 · Which language to build it in

2026-11-23. The questions in order: how to code this as one repository, and in what language? Then alternatives to Rust, assembly, bash, Pascal, and finally: is Rust best, and how?

The requirements

RequirementImplication
A small, exact, trustworthy kernel readerMemory-safe, compiled, no hidden runtime
Runs on servers, browsers and ZAKO devicesCompiles natively, to WebAssembly, and to bare-metal targets
Views must be provably pureA sandbox that enforces purity
View methods pinned by hashA portable compiled artifact
A web shellA web front end

Recommendation: Rust for the core, WebAssembly for views

  • One kernel crate everywhere. A no_std crate compiles natively, to WebAssembly and to microcontrollers. The browser validates with the same code as the server.
  • The type system enforces the design. Exhaustive matching over the 64 verbs and the phases; distinct types for addresses and IDs; decimals, never floats; Result for validation.
  • Append-only is part of the API. Log has append and read, and no update or delete methods.
  • Views run in wasmtime with no imports. No clock, randomness or network can be reached, so purity is enforced by construction. The module hash is the view's method.
  • Exact bytes and exact arithmetic, fast folds with no GC pauses, and safe parallelism.
  • Tooling: cargo-fuzz for the parser, property tests for round trips and balance, Miri, benchmarks, generated C headers and JS bindings.

The costs: a learning curve, slower compiles than Go, and a smaller hiring pool.

The rest of the stack: - TypeScript for the web shell; - C through a thin interface for devices; - the Python trial kept as a second, independent implementation, checked against the same conformance logs.

Alternatives weighed

OptionVerdict
GoFastest practical alternative. Simple, with wazero (WebAssembly in pure Go). But garbage-collected, binaries of several MB, and weak on small devices.
ZigSmall, explicit, excellent C interop, which suits ZAKO. But pre-1.0 and a small ecosystem.
CMatches ZAKO and has the smallest footprint, but isn't memory-safe for parsing untrusted input. Suitable only for a tiny device reader.
TypeScriptOne language end to end, but slow, not for devices, and needs WebAssembly for purity anyway
PythonFastest to prototype, and the trial exists; slow at scale. A good second implementation.
OCaml or HaskellNatural for folds and views; a small community
C++Complexity without much gain here
AssemblyNo. Not portable, unchecked, slow to write, and rarely faster than a compiler. At most a few measured hot loops on tiny devices, inside C or Zig. The real energy savings come from writing fewer bytes, not hand-tuned instructions. (WebAssembly is different: it's the format views run in.)
BashThe interface, not the engine. Good for CLI glue, adapters, setup and quick awk/grep views on the readable form, which the canonical line is designed to allow. Unsuited to canonical bytes, exact decimals, binary forms, safe concurrent appends, sandboxing and scale. Two of the three v1 bugs were shell conveniences that broke guarantees: the in-place sort -o and the awk dedup key.
Pascal (Free Pascal)Readable, strongly typed, range-checked, and compiles to many targets, with a fitting lineage (Blaise Pascal's calculator). A good choice for a clear kernel reader. Weak for hosting views (no WebAssembly runtime of its own), and a small community.
PriorityBest
Kernel correctness and safetyRust, then Zig
Speed to version 1Python, then Go
One codebase across device, server and browserRust, then Zig
Fit with ZAKO's CZig, then C
HiringGo, TypeScript, Python

The repository shape proposed

spec/       kernel.md, kernel.descriptor, conformance/
crates/     stream-kernel (no_std), stream-log, stream-codec, stream-pack,
            stream-views, stream-books, stream-cli, stream-ffi
packs/  views/  shell/  adapters/  reference/python/  tools/lineage/

Rules that keep it honest: - the kernel depends only on a hash function; - every implementation runs the conformance logs in CI; - built-in views use the same WebAssembly host as anyone else's.

The owner chose Rust, and the build followed (16).

Read on Telegraph