mirror of
https://github.com/imjasonh/loom
synced 2026-07-06 22:52:57 +00:00
Implement a Python-based bootstrap compiler for the Loom language, plus self-hosting lexer and parser written in Loom itself. Bootstrap compiler (Python): - Lexer: tokenizes all Loom syntax including multi-char operators - Parser: recursive descent with proper operator precedence - AST: dataclass-based node definitions - VM: executes Loom programs with main() as entry point - Stdlib: string, array, math, and file I/O functions - CLI: run command for executing .loom files Self-hosting components (Loom): - lexer.loom: complete lexer that can tokenize itself (298 tokens) - parser.loom: recursive descent parser producing dict-based AST - loom_compiler.loom: integrated lexer+parser for end-to-end compilation Example programs: - simple.loom, refund.loom: basic Loom syntax demos - arrays.loom: iteration constructs (@map, @filter, @reduce) - stdlib_test.loom, file_test.loom, unary_test.loom: feature tests Key language features implemented: - Nodes ($name), pipes (->), commits (!var), guards (?), journals (~>) - Branch expressions: (condition) true_expr : false_expr - Iteration: @each, @map, @filter, @reduce - Arrays, dicts, property access, function calls |
||
|---|---|---|
| .. | ||
| arrays.loom | ||
| file_test.loom | ||
| lexer.loom | ||
| loom_compiler.loom | ||
| parser.loom | ||
| refund.loom | ||
| simple.loom | ||
| stdlib_test.loom | ||
| unary_test.loom | ||