{"slug": "day-6-my-language-now-compiles-to-webassembly-and-i-emit-the-bytes-by-hand", "title": "Day 6: my language now compiles to WebAssembly — and I emit the bytes by hand", "summary": "A solo developer building LOOM, an open-source language designed as a machine-checked trust layer for AI-written code, has added a WebAssembly backend by manually emitting the binary bytes. The language now compiles to WebAssembly, running on Node's built-in WebAssembly module, and passes 298 checks across all backends. The developer also landed a new provenance rule, proposed autonomously by the AI organism that grows the language, allowing attestation of specific foreign components.", "body_md": "I'm building LOOM — a small open-source language that is a machine-checked trust layer for AI-written code. I don't write it by hand anymore: an organism I built grows it, day and night, on my own machine. This is Day 6, and the whole day went to one thing — **WebAssembly**.\n\nLOOM already runs three ways: an interpreter, and backends that compile checked code to Python and JavaScript. The thesis is \"trust survives translation\" — effects and provenance, proven once, hold the same on every target. WebAssembly is the strongest test of that: a low-level stack machine with linear memory, nothing like Python or JS.\n\nAnd there was a constraint. This machine's clang has no wasm target, and I install nothing paid or heavy. So I don't compile *to* wasm through a toolchain — **I emit the wasm bytes myself** (LEB128, the type / function / memory / global / export / code sections, the i32 stack machine) and run them through node's built-in `WebAssembly`\n\n. Zero dependencies.\n\n`fib`\n\nto a value runtime, in a day\nEvery step was prototyped and proven (wasm output == interpreter output) *before* it touched the kernel:\n\n`if`\n\n, first-order calls and recursion. `fib(10)`\n\nbecomes 61 bytes of real WebAssembly and returns 55, identically on the interpreter, Python, Node and wasm.`let`\n\nand integer `$cons`\n\ncell allocator; `head`\n\n/`tail`\n\nare `i32.load`\n\n, `empty`\n\nis `i32.eqz`\n\n). A list sums and folds by recursion, inside wasm.`(variant Tag e)`\n\nbecomes a tagged cell `[tag-id | payload]`\n\n; `match`\n\nloads the tag, compares, binds the payload, branches.You can watch it: the live playground has a **Compile → WAT** button and `WASM · fib`\n\n/ `list-sum`\n\n/ `match`\n\nexamples. Type a program, see it become real assembly, in your browser.\n\n**Honest scope:** ints, `let`\n\n, integer lists and sum types compile to wasm today. Records, closures and effects are the next frontiers (closures are the hard one — a function table plus a heap environment). Anything outside the supported set fails closed — it never emits wrong code.\n\nWhile I worked on wasm, the organism worked on the trust layer. I'd landed D26 — a rule that provenance does **not** survive an opaque foreign (FFI) call, so the host can vouch for what foreign code is *granted* but never for what it *returns*. D26 left an honest gap in its own comments: a vetted, signed library was treated no better than an arbitrary `.so`\n\n.\n\nThe organism, on its own overnight pass, proposed the answer — and I reviewed it and landed it. `(vouch ROLE WHO COMP)`\n\n: a non-AI authority signs a **specific** foreign component, so that component's output carries the authority's anchor instead of being stripped. It's an *attestation* — traceability to a named, non-AI auditor of that exact component — not a claim the component is correct. It fails closed everywhere (an AI vouching for itself, a name mismatch, a value laundered through the call — all rejected). A machine I built found and closed a gap in my own design.\n\n**298 checks, all green.** Across every day, the language has only ever gotten greener.\n\nBuilt solo, in the open, from Ukraine 🇺🇦.\n\n⭐ Code (MIT): [https://github.com/umbraaeternaa/loom](https://github.com/umbraaeternaa/loom)\n\n▶ Try it live: [https://umbraaeternaa.github.io/loom/play.html](https://umbraaeternaa.github.io/loom/play.html)\n\n☕ Support: [https://send.monobank.ua/jar/AHaziFXjYX](https://send.monobank.ua/jar/AHaziFXjYX)", "url": "https://wpnews.pro/news/day-6-my-language-now-compiles-to-webassembly-and-i-emit-the-bytes-by-hand", "canonical_source": "https://dev.to/umbraaeternaa/day-6-my-language-now-compiles-to-webassembly-and-i-emit-the-bytes-by-hand-c0o", "published_at": "2026-06-26 21:22:32+00:00", "updated_at": "2026-06-26 21:34:35.814744+00:00", "lang": "en", "topics": ["developer-tools", "machine-learning", "ai-safety"], "entities": ["LOOM", "WebAssembly", "Node.js", "GitHub", "Ukraine"], "alternates": {"html": "https://wpnews.pro/news/day-6-my-language-now-compiles-to-webassembly-and-i-emit-the-bytes-by-hand", "markdown": "https://wpnews.pro/news/day-6-my-language-now-compiles-to-webassembly-and-i-emit-the-bytes-by-hand.md", "text": "https://wpnews.pro/news/day-6-my-language-now-compiles-to-webassembly-and-i-emit-the-bytes-by-hand.txt", "jsonld": "https://wpnews.pro/news/day-6-my-language-now-compiles-to-webassembly-and-i-emit-the-bytes-by-hand.jsonld"}}