PrototypeSource availableRust to Brainfuck transpiler / 2025
Problem
Compiler concepts are easier to understand when they are implemented end to end, even against a deliberately tiny source language and target runtime.
Solution
Build a pure-Rust CLI that reads source, prints debug output, then emits `.bf` through a lexer, parser, AST model, generator, and error layer.
Key Features
Lexer for identifiers, integer literals, keywords, operators, braces, parentheses, and semicolons
Recursive descent parser with expression precedence for equality, comparison, addition/subtraction, and multiplication/division
AST model for let bindings, assignments, print calls, if statements, while loops, and binary expressions
Brainfuck generator with variable cell allocation, temporary cells, value copying, arithmetic helpers, and output instructions
Position-aware transpiler errors and CLI failure handling
Example programs for simple variables, arithmetic/comparison, and control flow
Integration tests for compilation, output file creation, and missing-file error handling