3 ms·
Never thought of doing "optimizations" (like a compiler) in a BF interpreter, but that's genius!
by colejohnson66 4y ago
Never thought of doing "optimizations" (like a compiler) in a BF interpreter, but that's genius!
- klyrs 4y agoIt's quite fun to write a bf->c "compiler" and look at the assembly output that results from compiling that c. The result can be remarkably efficient; GCC will trivially reduce a double-loop of incrementation down to a single multiply instruction for example, it will optimize away pointer manipulation and just use registers, etc.