

Show HN: A Brainfuck to C transcompiler in Ruby - cpro
https://github.com/prophittcorey/bft

======
killercup
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...](http://www.wilfred.me.uk/blog/2015/08/29/an-optimising-bf-compiler/)

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

~~~
cpro
Thanks! It's an interesting article, it really takes the compiling to the next
level.

------
tomsmeding
Nice work; how about optimising the C output? Ten plusses in a row can be
shortened to *p+=10 for example.

~~~
cpro
Thanks-- that's a good idea. I didn't think of optimization at all but that
sounds like a fun step to take next.

