Hades programs are executed by passing a source file toDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ToberlerOhn/hades/llms.txt
Use this file to discover all available pages before exploring further.
main.py through the Python interpreter. The runner resolves file extensions automatically, surfaces helpful formatted errors when something goes wrong, and offers a verbose mode that prints the full token list and parse tree — useful when you want to understand exactly how the interpreter sees your code.
Basic Usage
hello.hds:
File Extension Resolution
You do not always need to type the full filename. The runner applies the following resolution rules in order:- No extension supplied —
.hdsis appended automatically.
python3 main.py hello→ looks forhello.hds .hdsnot found,.hdexists — falls back to the.hdvariant automatically.
python3 main.py hello→ trieshello.hds, thenhello.hd- Unexpected extension supplied — the file is still run, but a warning is printed to let you know the extension is non-standard.
Both
.hds (Hades Script) and .hd (Hades) are valid Hades file extensions. The VS Code extension recognises both. Prefer .hds for new files.Verbose Mode
Passing-v or --verbose as the second argument instructs the runner to print the complete token list and AST (Abstract Syntax Tree) to standard output before executing the program. This is invaluable for debugging parser behaviour or understanding how an expression is parsed.
15) follows the debug dump.
Exit Codes
| Code | Meaning |
|---|---|
0 | Program ran successfully |
1 | File not found |
1 | Syntax error (lexer or parser) |
1 | Runtime error (interpreter) |