Skip to content

Sassembly v0.2.0 — the self-hosting compiler

Latest

Choose a tag to compare

@aaryavrate aaryavrate released this 26 Sep 01:43
· 6 commits to main since this release

A compiler for a language with no English in it, written in itself, which compiles itself into a byte-identical copy.

Stage 1   21 Sassembly sources, compiled by the interpreted compiler
Stage 2   Stage 1 running natively on bare-metal RISC-V, over those same sources

Stage 2 == Stage 1, byte for byte.   1,393,602 octets.

Reproduce it with cargo build --release -p sadhana -p yantra && tools/fixpoint.sh. The script packs the source blob from the working tree immediately before building, so a stale input cannot be mistaken for agreement — an earlier run of this measurement was invalidated by a blob packed four hours before the edit it was meant to test, and the tell was that a different Stage 1 produced a byte-identical Stage 2.

Why byte-identity is the claim

A self-hosting compiler is usually announced when it compiles itself and produces something that works. That is weaker than it sounds: two compilers can both work and still disagree, and the disagreement can hide for a long time.

Reaching this fixpoint meant finding five defects in one day that were invisible to the interpreter and visible only when the compiled compiler ran itself — among them a shift by 64, which is 2⁶⁴ in the host's arithmetic and 1 on RISC-V, so a hex writer's mask was zero natively and correct interpreted; a word above 2⁶³ read as negative by a lowering that was signed where the language is not; and an optional holding zero, indistinguishable from the nil word natively, which was the bootstrap blocker with 484 of 509 slots holed.

What this is not

Not a general-purpose toolchain, and the README says so before the tutorial rather than after it:

No file naming, no file writing, no command-line arguments, no network, no threads, no clock, no standard library. A program computes, allocates from a 512 MiB region the compiler already reserves, reads the input it was handed, prints, and halts.

Networking is undesigned rather than unbuilt: nothing in the language can express "not yet", a socket read has three outcomes and the third has no representation, and the prior question is whether a Sassembly program may be suspended at all. WHY-NO-NETWORKING.md records that question and both candidate answers without adopting either.

What works, with the guard that proves it

capability measured
read the input it was given status: Some(2289) — the exact octet sum of a 25-byte file
allocate dynamically a run grown to 5,000 elements, every element surviving
print to the console HI!\n, asserted from both engines and asserted to agree
compile a fresh program 13.4 s to a 65,832-octet ELF

Verification

  • In this tree: cargo build --release -p sadhana -p yantra → exit 0, 27.02 s · cargo test --workspace --no-run → exit 0, 0 errors
  • Upstream, 2026-09-25: cargo test -p sadhana-t1 -p sanskrit-text -p yantra --no-fail-fast → 129 targets, 1,151 passed, 0 failed, exit 0

Status

Nothing is stable — not the syntax, not the object format, not the tool names. The fixpoint is the result; everything around it is scaffolding for having reached it.

MIT licensed. The licence covers what is published here and nothing else.