diff options
| author | Elis Eriksson <spelis@spelis.li> | 2026-06-20 11:26:50 +0200 |
|---|---|---|
| committer | Elis Eriksson <spelis@spelis.li> | 2026-06-20 11:26:50 +0200 |
| commit | de91ec0542aea5959376ee0d2c9d486268dd9392 (patch) | |
| tree | 2720ad71b20b9fcb6bf4a32d3890cf94a3e0d77a /README.md | |
| parent | cbdca328495a772716f14b1e95a7ab7d6450cc27 (diff) | |
| download | bfc-de91ec0542aea5959376ee0d2c9d486268dd9392.tar bfc-de91ec0542aea5959376ee0d2c9d486268dd9392.tar.gz bfc-de91ec0542aea5959376ee0d2c9d486268dd9392.tar.bz2 bfc-de91ec0542aea5959376ee0d2c9d486268dd9392.tar.lz bfc-de91ec0542aea5959376ee0d2c9d486268dd9392.tar.xz bfc-de91ec0542aea5959376ee0d2c9d486268dd9392.tar.zst bfc-de91ec0542aea5959376ee0d2c9d486268dd9392.zip | |
Add a README, replace the shell script with C code. Add a LICENSE.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..3ab27f6 --- /dev/null +++ b/README.md @@ -0,0 +1,44 @@ +# BFC - Brainf*ck compiler + +A Brainf*ck compiler for Linux. + +`bfc` translates Brainfuck into C and immediately feeds it into GCC, producing small standalone ELF executables. No interpreters, no virtual machines, no runtime dependencies. + +## Build the compiler + +Just one command: + +`make` + +## Build a brainfuck program + +Just one more command: + +`cat file.bf | ./build/bfc > output` + +Then running the program is as simple as: + +`./output` + + +## How it works + +Brainf*ck source -> Lexer -> Parser -> AST -> C codegen -> GCC -> ELF executable + +A simple Hello World! program is about 9.3kb big. + +## Limitations + +* Linux only +* Soft-requires GCC (could be substituted for something else) +* Finite memory tape (30kb) + +## Why? + +Because interpreters suck. + +Also because turning Brainf*ck into an ELF executable is just objectively fun. + +## License + +MIT |
