ALL INTELLIGENCE
Hacker News AIT2·Tools

Stated Launches Controlled English to Go Code Compiler

Original title: Show HN: Toy controlled English to Golang code
58AI Score

Stated released v0.1, a proof-of-concept compiler that deterministically translates controlled English documents into readable Go code without any model in the loop. Its grammar and typed vocabulary enforce a single meaning per phrase, rejecting anything ambiguous.

Related Entities

Full Report

Contents4 sections

Write controlled English. Compile deterministic code.

GET STARTEDProof of concept: v0.1DocumentationSource

◆ Controlled source

English-shaped syntax with programming-language rules. Every accepted phrase comes from checked grammar and typed vocabulary.

  • No arbitrary-English interpretation
  • No hidden behavior from familiar names
  • One meaning or a compiler error

◆ Deterministic output

The compiler resolves the whole document into explicit operations, bindings, branches, and data movement before emitting code.

  • Stable lowering from the same source
  • Checked integer arithmetic
  • Explicit ownership and traversal order

◆ Inspect the translation

The generated Go is an artifact you can read, review, diff, and compile with ordinary tooling. No model participates in compilation.

  • Source locations preserved
  • Definitions structurally inlined
  • Unsupported semantics are rejected

Stated · filter.ce

Text
The program accepts an integer sequence named input.
The program accepts an integer named threshold.
The program computes the following result.
Collect the input values in encounter order into a fresh sequence.
Retain each value only when it is greater than the threshold.
Replace each retained value with the doubled value of that value
before appending it.
GO
result := make([]int64, 0)
for _, value := range input {
    if value > threshold {
        doubled, ok := checkedAdd(value, value)
        if !ok {
            return nil, overflowDiagnostic()
        }
        result = append(result, doubled)
    }
}
return result, nil

Inspect the compilation yourself.

Start with one small Stated program, emit its Go source, and compare every authored operation with the generated code.

First programExamplesLanguage referenceStatus and limitations