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.goOmit -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
| Boundary | Representative categories | Meaning |
|---|---|---|
| command/files | usage, io, build | bad flags, missing file, Go tool failure |
| metadata/source | metadata, definition_source, term, syntax, reference, type | package shape, grammar, resolution, typing |
| Go emission | backend_unsupported | accepted 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.