Skip to main content

Running and inspecting programs

Build the compiler with the .NET 10 SDK:

dotnet build compiler/WorldCompiler.csproj -c Release

Run wec​

From the repository root, use check to verify a file without running it, run to execute it, or ast to see how it parsed:

.\compiler\bin\Release\net10.0\wec.exe check sample.world
.\compiler\bin\Release\net10.0\wec.exe run --no-prompt --trace --detailed-full sample.world
.\compiler\bin\Release\net10.0\wec.exe ast sample.world

If your checkout path contains a semicolon, as in world.execute(me);, use .\compiler\run.ps1 in place of the executable. It takes the same arguments.

wec uses ClemToken to parse each line of a .world file according to grammar.ct, then uses indentation to group statements into blocks. The compiler includes compiler/lib/ClemToken.dll. You can rebuild the DLL from the ClemToken source and replace the bundled copy before building the compiler.

Use --trace to see the evidence behind checks on stderr. Use --detailed for live state, facts, relationships, events, and recovery as JSON on stdout. --detailed-full adds rehearsal results. To reproduce a run, pass one --input path=value per observation and --no-prompt to leave all others unknown.

Live verdictMeaningExit
trueExecution finished successfully.0
falseA live claim lacked evidence.1
errorAn effect failed, such as an unguarded action with unmet requirements.1
unprovenA domain exception stopped the timeline.1

An invalid --input value gives exit 2. To see whether a rehearsal failed, use --detailed-full; the live verdict can still be true.

Work in VS Code​

Install world.execute(me); from the VS Code Marketplace, or compile it from source. Open the repository root and a .world file in VS Code. Ctrl+Space offers completions; go to definition on a relation to find its declaration.

Build the compiler, then use world.execute(me): Check File or world.execute(me): Run File in the Command Palette. The commands save pending edits. Unlike a terminal run, the editor leaves unspecified observations unknown. For the lamp sample, set:

{
"world.runInputs": {"you.presence": "present"},
"world.runOutput": "detailed-full"
}

See the extension guide for compiler discovery and settings.