Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI Reference

lumen (file) [options]

The file comes first, options after it. With no options the file is compiled and then run.

OptionMeaning
--compileCompile the source file to <file>.bin.
--runRun a compiled program. Used alone, file must be a .bin; combined with --compile, the freshly written <file>.bin is run.
--disassemblePrint the disassembly of a .bin. Cannot be combined with --compile or --run.
--debuggerRun under the interactive debugger. Cannot be combined with --compile alone.
--no-debugDo not embed debug symbols in the compiled .bin (smaller file, no names in the disassembler or debugger).
--verbosePrint prescan tokens, the emitted bytecode and execution progress.

Standalone commands (no file needed):

CommandMeaning
--helpPrint usage.
--versionPrint the language version, git branch, commit and build date.
--introductionWrite a starter script helloworld.lmn to the current directory.
--examplesList the bundled examples.
--examples <name>Write the named example to disk (age.lmn, infinite.lmn, temperature.lmn, fizzbuzz.lmn).

Typical workflows

lumen script.lmn                       # compile + run
lumen script.lmn --compile             # writes script.lmn.bin
lumen script.lmn.bin --run             # run the compiled program
lumen script.lmn.bin --disassemble     # inspect the bytecode
lumen script.lmn --debugger            # compile, then debug
lumen script.lmn --compile --no-debug  # release build without symbols

Errors

Compile errors name the file and line and stop the build:

In file script.lmn
  - Error on line 3
    >>> argument count mismatch for 'println': expected 1, got 0
Compilation failed!

Runtime errors print Runtime error (or Function error when a built-in fails) followed by a message, and the program stops. The process exit code is still 0.