Development
Development
Section titled “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 ValueThe lexer recognizes +. The parser understands where it belongs. The AST represents the operation. The interpreter evaluates it. The runtime provides the resulting value.
cargo buildOptimized build
Section titled “Optimized build”cargo build --releasecargo checkcargo run -- examples/hello.nxlTesting
Section titled “Testing”NXL will eventually have tests at multiple levels.
Lexer tests
Section titled “Lexer tests”Test:
source → tokensFor example, let x = 10 should produce:
LETIDENTIFIEREQUALNUMBERParser tests
Section titled “Parser tests”Test:
tokens → ASTFor example:
a + b * 2must produce:
a + (b * 2)Interpreter tests
Section titled “Interpreter tests”Test:
AST → runtime resultFor example:
let x = 10print(x)should produce:
10Integration tests
Section titled “Integration tests”Eventually:
.nxl file ↓NXL CLI ↓complete execution ↓expected stdoutGit workflow
Section titled “Git workflow”Each meaningful feature should have its own commit.
Examples:
git add src/runtime.rsgit commit -m "feat: add NXL runtime value types"
git add src/environment.rsgit commit -m "feat: add NXL environment and scope handling"
git add src/interpreter.rsgit 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.