Developer preview v1.1.2 — installation, packaging, and some platform support are still in progress. Read the status
Skip to content

Command line ​

The workspace builds three binaries:

BinaryPurpose
clcCompile .clo sources to one C99 translation unit
clorraineBuild, run, emit, document, and explain diagnostics
clorraine-lspStdio language server for editors

clorraine ​

text
clorraine: build and run Clorraine programs

Usage:
  clorraine <command> [options] FILE...

Commands:
  run     Build and run a program
  build   Build a program without running it
  emit    Print the generated C (or write it with -o)
OptionMeaning
-p, --profile <host|hosted-amiga|hosted-amiga-13|freestanding>Target profile; defaults to host
--releaseOptimize with -O2; strip and section-GC on Linux/Amiga
--sizeOptimize for size with -Os; same release processing; cannot combine with --release
--emit-cPrint the generated C after building
--emulatorAmiga run: use FS-UAE (host handoff)
--captureWrite program stdout to out.txt and print its path
-o FILEemit only: write C to FILE (default stdout)
--doc [-o DIR] FILE...Generate Markdown from /// comments
--explain CODEPrint the registry entry for a diagnostic code
--diagnostics=jsonPrint diagnostics as JSON objects on stderr
-h, --helpPrint help
-V, --versionPrint the version

Options that take a value accept both --profile host and --profile=host. For --diagnostics=json, place the option after the command: clorraine build --diagnostics=json -p host file.clo.

Examples ​

sh
clorraine run hello.clo
clorraine run hello.clo -p hosted-amiga
clorraine build hello.clo -p hosted-amiga-13 --release
clorraine emit hello.clo -p host -o build/hello.c
clorraine --explain E10020
clorraine --doc -o build/api examples/hello/hello.clo

Exit codes ​

CodeMeaning
0Success, including help, version, and the FS-UAE handoff
1Clorraine diagnostic, missing tool, or C compiler failure
2Usage error, or the driver is not inside the SDK container

A run exits with the program's own code, so a program that exits 2 is indistinguishable from a usage or environment error.

clc ​

clc is the compiler front end and emitter. It requires a profile and writes C:

sh
clc --profile host -o build/hello.c hello.clo
clc --profile hosted-amiga -o build/hello.c hello.clo

Useful flags:

FlagMeaning
--profile <name>Required target profile
-o FILEOutput C file
--versionPrint the compiler version
--diagnostics=jsonJSON diagnostic stream
--explain CODEPrint a diagnostic registry entry
--max-errors NCap the reported errors
--deny-warningsPromote warnings to failure
--parse-onlyStop after parsing

clc does not have a --help mode; clorraine --help documents the user-facing driver.

clorraine-lsp ​

The language server speaks LSP over stdio. It provides diagnostics, hover, go to definition, completion, and document symbols. Build it with:

sh
cargo build --workspace

Then point an LSP client at target/debug/clorraine-lsp. The VS Code extension in tools/vscode/ is the reference client.

Documentation generation ​

clorraine --doc renders /// comments from Clorraine sources as linked Markdown:

sh
clorraine --doc -o build/api examples/hello/hello.clo

The output directory defaults to build/doc. This is for your sources; the site's standard library page indexes the embedded modules.

Clorraine is an independent project. Amiga, AmigaOS, Kickstart, and Workbench are trademarks of Amiga Corporation. Not affiliated with or endorsed by Amiga Corporation or Hyperion Entertainment.