Skip to content

Development

NXL is developed incrementally. Each meaningful language feature should be considered across all compiler/runtime layers.

For example, adding + requires:

Lexer
TokenType::Plus
Parser
Expression::Binary
Interpreter
Runtime Value

The lexer recognizes +. The parser understands where it belongs. The AST represents the operation. The interpreter evaluates it. The runtime provides the resulting value.

Terminal window
cargo build
Terminal window
cargo build --release
Terminal window
cargo check
Terminal window
cargo run -- examples/hello.nxl

NXL will eventually have tests at multiple levels.

Test:

source → tokens

For example, let x = 10 should produce:

LET
IDENTIFIER
EQUAL
NUMBER

Test:

tokens → AST

For example:

a + b * 2

must produce:

a + (b * 2)

Test:

AST → runtime result

For example:

let x = 10
print(x)

should produce:

10

Eventually:

.nxl file
NXL CLI
complete execution
expected stdout

Each meaningful feature should have its own commit.

Examples:

Terminal window
git add src/runtime.rs
git commit -m "feat: add NXL runtime value types"
git add src/environment.rs
git commit -m "feat: add NXL environment and scope handling"
git add src/interpreter.rs
git commit -m "feat: add initial NXL interpreter"
git commit -m "feat: add print builtin"

This makes the project history useful for understanding how the language evolved.