5 ms·
I'm assuming there's some sort of transpiler to brainfuck? I just cannot stomach the idea that that was written by hand somehow....
by lukeramsden 4y ago
I'm assuming there's some sort of transpiler to brainfuck? I just cannot stomach the idea that that was written by hand somehow....
- rrdharan 4y agohttps://en.wikipedia.org/wiki/Brainfuck https://en.wikipedia.org/wiki/Brainfuck > Although Brainfuck programs, especially complicated ones, are difficult to write, it is quite trivial to write an interpreter for Brainfuck in a more typical language such as C due to its simplicity. There even exist Brainfuck interpreters written in the Brainfuck language itself.
- shpongled 4y agoThe parent comment was about a transpiler targeting brainfuck, not an interpreter. Writing a brainfuck interpreter (or compiler to x86/etc) is indeed trivial... writing a compiler targeting brainfuck is another beast entirely.
- rrdharan 4y agoYou're right of course. Although I guess some do exist: https://github.com/arthaud/c2bf https://github.com/arthaud/c2bf https://github.com/felko/bfpy https://github.com/felko/bfpy
- retrac 4y agoUsual strategy is to use a macro assembler and lots of macros to build up some civilized things like stacks and subroutines. But there are also several high level (ish) languages that have compilers to BF. https://esolangs.org/wiki/Brainfuck_code_generation https://esolangs.org/wiki/Brainfuck_code_generation