Why Scheme?

in the age of AI programming

Not because it reads elegantly to a human — because a model can reliably generate it, verify it, and manipulate it.

The bottleneck of AI-written code isn't taste — it's trust. A model is strongest at producing constrained structure and weakest at guaranteeing runtime semantics. Scheme's value for AI is that its structure lines up with the first and hands the second to a machine. That points to an optimum that looks different from the one you'd pick for a human.

1

Homoiconicity is the ideal substrate for generation

Code is data — generating it is parsing it.
  • No text↔AST round-trip. An s-expression the model emits is already a parsed tree. Generation, validation and rewriting all happen on the same structure — no fragile JS/TS parser standing between intent and syntax. This is exactly what web-porter leans on: the target language is s-expr, so verification and rewrites work on the tree.
  • Structural validity is nearly free. JS invites missing semicolons, mismatched async, a forgotten await. An s-expr is syntactically valid the moment its parens balance — the error surface shrinks by an order of magnitude.
  • Macros let the model generate at the right altitude. It doesn't hand-roll a codec line by line; it emits one (define-message …) declaration and the macro expands it to correct code. The model writes intent — short, clear, checkable — and the compiler writes the implementation. That's the division of labour it's least likely to botch.
2

The generate–verify loop is the real win

Untrusted output, made trustworthy by a cheap, automatic oracle.

This is the part that's genuinely specific to AI. Generated code is not to be believed; it has to be proven. Scheme makes the proof cheap and automatic.

  • Differential testing as the acceptance test. One harness drives the original and the port through identical inputs and compares outputs. The model never claims correctness — it is forced to demonstrate it. (That's the web-porter contract.)
  • The self-hosting fixpoint as bedrock. The compiler recompiles itself and stage1 == stage2 must hold byte-for-byte, on every change. An oracle that automatically rejects a wrong edit is worth more than any amount of "well-written."
  • read/write round-trip is a free property test. For any value, (equal? x (read (open-input-string (write‑>string x)))) is a correctness check the model gets for nothing.
3

In networking, make the protocol verifiable data

The bugs a model ships are protocol bugs — move them earlier.

The biggest risk in AI-written network code is the protocol: fields out of order, an encoder that doesn't match its decoder, a state machine missing a transition — the kind of thing that only detonates at runtime. Scheme moves it forward in time.

  • Same language on both ends, s-expr on the wire. There is no protocol to design — the model just reads and writes. No protocol, no protocol bug. For the thing a model is most likely to get wrong, the best move is to delete it.
  • Declarative schema for the heterogeneous case. Facing a foreign backend, the model generates a define-json / define-message schema rather than a hand-written codec — and the test checks symmetry directly: (decode (encode x)) = x.
  • Not hypothetical — it already ships. Igropyr, a high-performance network server written in pure Scheme, already accepts s-expression payloads over the wire. The same-language, no-codec path is production, not a proposal.
The optimum, in one line

Declarative protocol & schema, plus automatic differential and round-trip verification. The model emits short, declarative, structurally-valid intent — schemas, routes, sx templates; macros produce the implementation; the machine proves it correct. Work lands on the model's strength; risk lands on the verifier.

An honest counterpoint

Ecosystem and training data cut the other way

Models have seen orders of magnitude more JavaScript, so their intuitive recall for it is stronger; writing Scheme leans harder on the verification scaffolding above to catch what recall would have caught for free. JavaScript is the language a model remembers better — but Scheme has the properties that matter for code that must be verified anyway, provided you actually build the loop. Here, it's built: differential testing, the self-hosting fixpoint, and read/write round-trips.

And the ecosystem gap is narrower than it looks, because you don't have to leave the JavaScript world to enter Goeteia. Its (web js) FFI bridge reaches straight into the host: a port can call into any existing JavaScript library — the whole npm-scale ecosystem stays one call away, seamlessly. You verify the code you write; you borrow, unchanged, the libraries the world already wrote.