Language Guide
Falx is dynamically typed and C-like: braces for blocks, semicolons to end statements, and // comments. This guide walks through the language a piece at a time, in the order a new reader typically needs it.
Variables & types
let, const, and the six runtime types.
Operators & precedence
Arithmetic, comparison, logical and compound-assignment operators.
Control flow
if/elseif/else, while, foreach, break/continue.
Functions & closures
First-class functions, default parameters, and closing over enclosing state.
Structs
Fields with defaults, methods, and how instances get constructed.
Arrays
Literals, indexing, iteration, and every built-in array method.
Maps
Key/value literals, indexing with arbitrary keys, and map methods.
Strings
Escape sequences, indexing, concatenation, and string methods.
Tuples & destructuring
The one place Falx has a tuple type, and how to unpack one.
Modules
Splitting a program across .flx files with require.
Conventions used in this guide
- Code samples are runnable as-is with
python -m src.Main run <file>.flx. - Where a sample prints something, the exact output appears directly beneath it in a second block.
- Every documented behaviour has been checked against the interpreter's source on the
masterbranch, not just the README - Falx moves quickly and is pre-1.0, so behaviour can change between commits.