Skip to content

Commands, execution, and diagnostics ​

Generated Go ​

go
package generated

func CopyValues(p0 []int64) ([]int64, error) {
	result := make([]int64, len(p0))
	copy(result, p0)
	return result, nil
}

The compiler emits callable Go like this from a Stated source file. It adds no executable wrapper or runtime.

Compiler CLI ​

sh
go run ./cmd/stated -source PROGRAM.st -emit-go GENERATED.go

Omit -emit-go to print the generated Go to standard output. The repository Makefile wraps this as make stated INPUT=PROGRAM.st, printing the source followed by a separator and the generated Go.

Diagnostic categories ​

BoundaryRepresentative categoriesMeaning
command/filesusage, io, buildbad flags, missing file, Go tool failure
metadata/sourcemetadata, definition_source, term, syntax, reference, typepackage shape, grammar, resolution, typing
Go emissionbackend_unsupportedaccepted source cannot be represented by the current Go backend

Diagnostics include a category, message, and origin information. Arithmetic errors reached by callers are returned as ordinary Go errors from the generated function.

Stated compiles controlled English deterministically. It does not call an LLM at compile time.