r/Compilers • u/Infamous_Treat_1804 • 13d ago
Scoping a first native backend for Blyx, an experimental language implemented in Rust
I'm Rahul, the creator of Blyx, an experimental language implemented in Rust. I'd welcome compiler-engineering feedback on a deliberately small first native-backend milestone.
Current state: the README documents a tree-walking interpreter with integers, booleans, strings, bindings/assignment, direct function calls, bounded recursion, conditionals, loops, and printing. check currently parses syntax only; build validates syntax but does not emit an executable. The repository has a BIR/SSA-oriented architecture, but there is not yet a complete native pipeline.
Issue #10 asks for a focused RFC covering the backend boundary, first host target, initial BIR constructs to lower, unsupported-construct diagnostics, end-to-end fixtures, and reproducible artifact validation.
A possible starting scope to critique—not an implemented feature or settled decision—is one host target and an integer/boolean subset with arithmetic, comparisons, branches, and direct calls. Strings, concurrency, tensor/GPU work, and AI primitives could remain outside that first milestone.
The questions I'd like help with are:
- What semantic/type-checking and IR invariants would you require before starting code generation, given the current syntax-only
checkcommand? - For that scope, how would you weigh emitting C against an LLVM or Cranelift backend? I'm interested in the maintenance and correctness trade-offs more than peak performance.
- Which tests would you insist on before calling the milestone usable? Comparing interpreter and compiled results seems useful, but I don't want shared bugs to become the only correctness oracle.
If this interests you, design notes, focused test cases, and small PRs are welcome. Please discuss substantial changes in the issue first. The project is MIT / Apache-2.0; the contribution guide has the process.
Disclosure: development is AI-assisted, and AI helped prepare this post. The aim here is independent scrutiny of the implementation and a realistic next milestone.