1
0
Fork 0
mirror of https://github.com/imjasonh/loom synced 2026-07-06 22:52:57 +00:00
No description
Find a file
Jason Hall c585ab55a3 Add Loom bootstrap compiler and self-hosting lexer/parser
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
2026-01-12 08:50:14 -05:00
bootstrap Add Loom bootstrap compiler and self-hosting lexer/parser 2026-01-12 08:50:14 -05:00
examples Add Loom bootstrap compiler and self-hosting lexer/parser 2026-01-12 08:50:14 -05:00
conversation.md Add Loom bootstrap compiler and self-hosting lexer/parser 2026-01-12 08:50:14 -05:00
loom.md add loom.md 2026-01-11 22:00:38 -05:00
plan.md Add Loom bootstrap compiler and self-hosting lexer/parser 2026-01-12 08:50:14 -05:00