This guide gets you writing real Hades code as fast as possible. By the end you will have run a hello world, declared typed variables, written a recursive function, indexed a list, and used verbose mode to inspect the interpreter pipeline. All you need is a cloned copy of the repository and Python 3.12+. If you haven’t done that yet, start with the Installation guide.Documentation 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.
Write and run Hello World
Create a new file called Run it:Expected output:A few things to notice right away:
hello.hds in the root of the cloned hades/ directory with the following content:- Variables must be declared with a type hint —
name: str— before being assigned. printaccepts any number of arguments and concatenates them with no separator.- Semicolons are required at the end of most statements, but are not required immediately before a closing
}or after one.
Declare variables with types
Hades is statically typed: every variable carries an explicit type hint that the interpreter enforces. Create Run it:Expected output:The built-in
types_demo.hds:nothing is the only type that does not require an initializer. All other types must be declared and initialized in the same statement. Booleans use the uppercase literals TRUE and FALSE.type() function returns the Hades type name of any value as a string — handy for debugging. The nothing type prints as the string nothing and is the Hades equivalent of null or None.Define and call a function
Functions in Hades use the Save this as Expected output:Key syntax points:
func keyword, declare typed parameters, annotate the return type with =>, and use => as the return statement inside the body.The example below defines a classic recursive Fibonacci sequence and a factorial function (both adapted from testing.hds in the repository), then prints the first ten values of each:math_demo.hds and run it:=>before the return type in the signature:func name(params) => ReturnType { }=>as the return statement inside the body:=> expression- The C-style
forloop initializes a typed loop variable:for (i: int = 0; i < n; i++) - Compound assignment operators like
*=work as expected.
Work with lists
Lists in Hades are mutable ordered sequences. They are created with square-bracket literals and elements are accessed using the Run it:Expected output:You can also iterate over a list with a
-> index operator.Create lists_demo.hds:List indices are zero-based. Accessing an index outside the list’s bounds raises a runtime error:
List index N out of range (length M).for-in loop:Explore verbose mode
Hades ships with a built-in debug flag that prints the token list and AST produced by the Lexer and Parser before execution begins. This is a great way to understand how your source is being interpreted.Run any file with You will see output similar to the following before your program’s normal output:The verbose output has two sections:
-v or --verbose:- Short flag
- Long flag
| Section | What it shows |
|---|---|
| Token list | Every Token object emitted by the Lexer — type, raw value, and line/column position |
| AST | The full ProgramNode tree produced by the Parser — every node type and its children |
What to Explore Next
You have now covered the core building blocks of Hades. Here are natural next steps:Variables & Types
Learn the full type system, truthiness rules, and operator precedence.
Functions
Closures, typed parameters, return annotations, and recursion patterns.
Control Flow
While, do-while, for, for-in, break, next, and _goTo.
Built-in Reference
Full documentation for
print, type, and len.