v0.3.0 · experimental language

Falx

A small, tree-walking scripting language, written in Python. Structs, closures, arrays and maps, with a syntax that stays close to C-family languages.

Hello, Falx

Every .flx file is a flat list of statements - no boilerplate, no main function required.

func greet = define(name = "world") {
    return "Hello, " + name + "!";
}

output(greet());
output(greet("Falx"));
$ python -m src.Main run hello.flx
Hello, world!
Hello, Falx!

What's in the language

Everything below is implemented and tested on the master branch today.

Variables & types

let and const, plus numbers, strings, booleans, arrays, maps, tuples and null.

Closures

Functions are values. Nested func declarations close over their enclosing scope, including private state.

Structs

Fields with optional defaults, plus methods that read and mutate the instance's fields directly, no this needed.

Arrays & maps

Literal syntax and a set of built-in methods for both - push, sort, keys, contains and more.

Modules

require("name") loads another .flx file as a module, with circular-dependency detection.

Friendly diagnostics

Lexer, parser and runtime errors report a source location instead of a raw Python traceback.

Before you build something real

Falx is experimental and pre-1.0. The language, its syntax and its standard library are all considered unstable and may change without notice. It isn't yet recommended for anything beyond experimentation. See the roadmap and changelog for what's shipped and what's planned.