Crates.io | bfcc |
lib.rs | bfcc |
version | 0.1.1 |
source | src |
created_at | 2021-12-26 20:11:22.24298 |
updated_at | 2021-12-27 23:57:16.503734 |
description | A brainfuck toolchain |
homepage | |
repository | |
max_upload_size | |
id | 503435 |
size | 53,486 |
A Brainfuck interpreter, transpiler and inspector written in Rust
You can install the newest published version of the binary by running:
cargo install bfcc
bfcc transpile
- a Brainfuck to C optimizing transpilerbfcc run
- a Brainfuck interpreterbfcc spy
- a runtime inspector and soon to be debuggerDuring transpilation the AST gets converted into an intermediary representation that gets optimized in multiple passes.
Although I haven't tested these optimizations enough to provide any sort of guarantee, these optimizations all seem to generate functionally equivalent programs.
Strategy | File | |
---|---|---|
✅ | Fusing increment/decrement commands | fuse_add.rs |
✅ | Fusing movements | fuse_movements.rs |
✅ | Deferring movements | defer_movements.rs |
✅ | Unrolling zero/clear loops | unroll_zero_loops.rs |
Unrolling copy loops | ||
Unrolling multiplication loops |
All transforms can be found under src/transpiler/transforms
These websites have served as great references during development: