Back to Docs
|
A deep dive into the hand-written recursive-descent parser and where it stands today.
Technical Deep Dive: The Voyage Compiler
The compiler lives at github.com/voyage-org/voyage-lang, built against dotnet-sdk-10.0 as voyage-lang.slnx, with a canonical directory structure and per-directory READMEs. Work happens on the dev branch; the completed spec lives on main.
Lexer & Parser
Per ADR-0010, the parser is hand-written and recursive-descent, matching Swift's own approach rather than a generated parser. Progress so far:
- Lexer: Fully implemented, 46 checks passing, with paren-depth-tracking string interpolation
- Parser — 248 checks: hello-world, let/var bindings and operators, func declarations
- Control flow: if/else/while/break/continue
- Types: struct/enum/case with type annotations, assignment, protocol/extension, generics
- Latest: member access, richer type syntax, string interpolation, switch statements with pattern matching
Known Gaps
A sweep against the spec's own examples surfaced the parser work still ahead:
- Labeled call arguments (highest impact)
- Generic-call disambiguation
- Attributes and declaration modifiers
- associatedtype dispatch
- Computed property get/set
- A spec inconsistency:
classappears in memory-model.md but not yet in grammar.md
Testing Without a Package Registry
The development sandbox has no access to NuGet, so instead of xUnit the project uses a hand-rolled test harness to verify the lexer and parser as they grow.