Check the code
This implementation is inspired by John Crickett’s Challenge.
There’s 2 different execution mechanism:
- BFExecutor interprets the BF code and executes it, opcode by opcode.
- BFCompiler transpiles the BF code to an arbitrary bytecode, hoping to get some efficiency during compile-time (eg. identifying loop jumps and repeating opcodes). Then, the BFVM executes the bytecode.