Replaces BF code by a C program with too many macros, then it delegates the heavy-lifting to the system's default C compiler via cc.
Inspired by "Tiny sh Brainfuck compiler". I wanted to make it even more portable by depending solely on cc: no sh, no POSIX utils, just ISO-C.
Compile the compiler 🤯
./buildPipe BF to it:
# non-halting `cat`
printf %s '-[>,.<]' |
./bfc > cat.c && \
cc cat.c -o cat -O2 && \
./catIf you have bigger programs:
./bfc < tmp.bf > tmp.c && \
cc tmp.c -o tmp -O2 && \
./tmp