All languages

SudoLang language

Pseudolanguage whose runtime is the model: typed interfaces, English constraints, and a pipe operator make a prompt read as a program, while most functions are inferred rather than written.

Overview

SudoLang is a pseudolanguage for programs a language model runs itself: a declarative mix of English, interfaces, functions, and constraints. It exists because pseudocode prompts outperform prose ones; an AI model interprets it unaided, so the specification is optional.

Code

count = 0                          // assignment
count += 1                         // compound operators exist
price = 42.5 * 2                   // math operators consume numbers
name = "Echo"
"Hello, $name"                     // template-string interpolation
1..3                               // inclusive range: 1, 2, 3
The tabs read as one program: values and template strings, then destructuring and semantic pattern matching on shape, then functions whose bodies nobody wrote and |> to compose them, then the signature feature — an interface whose English constraint makes the model repair state when a floor moves.

Distinctive traits

  • Constraints are English declarations the model keeps true, so an inferred solver repairs dependent values instead of requiring update code.
  • Referential omnipotence: unnamed functions are inferred on demand, so sort or log exist with no declaration and no body.
  • Constraints follow Sketchpad's propagate-on-edit model, which Elliott cites as the inspiration.
  • The pipe operator composes left to right, and Markdown preambles are executed as context.
  • The spec ships its linter as a SudoLang program, so style conformance is model behaviour, not a compiler check.

Status

Specification v2.0 and an MIT-licensed VS Code extension live in the project repository; no separate compiler or runtime exists. Documentation is articles, examples, and an O'Reilly overview, and transpile handles transpilation to conventional languages.

History

Created in 2023 by prompting GPT-4 to write the specification itself, after Jake Brukhman's Jargon suggested formalising a pseudolanguage syntax; Elliott then asked for a rename to SudoLang and added the pipe operator. The published specification now stands at version 2.0.

Sources & references