Hacker News new | ask | show | jobs
Show HN: A Brainfuck to C transcompiler in Ruby (github.com)
7 points by cpro 3943 days ago
2 comments

Interesting! I just read [1] this morning, which describes an optimizing BF compiler (written in Rust) that compiles to LLVM IR. The article also gives a good overview of optimization techniques used.

[1]: http://www.wilfred.me.uk/blog/2015/08/29/an-optimising-bf-co...

Edit: Just saw this was also discussed on HN: https://news.ycombinator.com/item?id=10141604

Thanks! It's an interesting article, it really takes the compiling to the next level.
Nice work; how about optimising the C output? Ten plusses in a row can be shortened to *p+=10 for example.
Thanks-- that's a good idea. I didn't think of optimization at all but that sounds like a fun step to take next.