Spec draft. Nothing runs yet.

Structure is code.
Content is intent.

Prom is a programming language for the AI era. You write the skeleton with strict English keywords: modules, types, branches, inputs and outputs. You write the logic in plain language, in any language. The runtime routes between prompts deterministically and gives every step only the context it needs.

support.prom
prompt in
module Support

use Billing from "./billing.prom"
use Bugs from "./bugs.prom"

enum Category { billing, bug, other }

fn handle(ticket: Ticket) -> Reply:

    step classify(ticket) -> Category using fast:
        Read the ticket and decide which group the customer's problem belongs to.
        Only use what the customer wrote. Do not guess.

    match classify:
        billing -> return Billing.handle(ticket)
        bug     -> return Bugs.handle(ticket)
        other   -> return General.handle(ticket)

    examples:
        "crash reports go to Bugs":
            input: { ticket: { subject: "App crashes on login", body: "..." } }
            given: { classify: bug }
            path:  classify > Bugs.handle.summarize
Structure: formal, checked, deterministicIntent: free text, any human language

Where prom fits

Models write code quickly now. What still takes work is saying exactly what you want, and knowing which part of a program a model decided and which part you did.

Prompts in markdown

  • They describe behavior, but a separate codebase still has to run it
  • Instructions, tool results and history pile up in one context until the model starts forgetting the early parts

Agent frameworks in Python/TS

  • Prompts live in string literals between glue code
  • The person who knows the business process usually can't review them
  • You decide what goes into each call, by hand

prom

  • The .prom file is the program. There is no second codebase behind it
  • The model returns typed values. match and if pick the path
  • A support lead can read the refund prompt in the same file that routes the ticket
  • The runtime loads prompts into context the way an OS pages memory: only when a step runs

How it works

This is the design in the M0 spec. None of it is implemented yet.

Deterministic routing

A step returns a typed value. match picks the next prompt. Given the same input and the same earlier outputs, the next prompt is always the same one. The model's wording can differ; the path cannot.

Context on demand

Each step sees its own prompt, its arguments, and the knowledge it asks for. Nothing else. Importing a module reads its signatures, not its prompts. A program with a hundred steps still sends each call a single step's prompt.

Any human language

Keywords are English and fixed. Prompts and descriptions are yours: Vietnamese, Japanese, English, or mixed in the same project.

Test paths, not words

examples assert which prompts an input flows through. given pins model outputs, so routing tests run offline, free and stable.

Trace & replay

Each step records its context, output, tokens and cost. Because only steps are non-deterministic, feeding the recorded outputs back in reproduces the whole run without calling a model.

Providers are a library

prom.aiProvider.anthropic(...) is the first one. Each step picks its model with using, so classification can run on a small fast model and the customer reply on a larger one.

Roadmap

The first compiler and runtime are written in Rust, until prom can compile itself.

  1. M0Core spec: structure grammar, step semantics, context model ← now
  2. M1Parser and prom check
  3. M2Runtime and prom run
  4. M3Imports and context loading on demand
  5. M4prom trace and prom replay
  6. M5prom test
  7. NextLanguage server and editor support, prom serve, then full applications and a self-hosting compiler