Live data from Hacker News

I wrote a Brainfuck to Go compiler

kabirgoel.com

21–23 of 23 posts

Re: I wrote a Brainfuck to Go compiler

#21

I might be wrong, but is this not a transpiler instead of a compiler?

Author here. You’re correct. I spent about 20 minutes mulling over whether to call it a transpiler for the purposes of the post, but "compiler" felt more appropriate. Technically, it could even be called a decompiler since it's going from low to high level. But ultimately even that's a compiler. :)

Re: I wrote a Brainfuck to Go compiler

#22
post #10

Meanwhile, a Go to Brainfuck compiler remains uncharted territory. (If you are genuinely curious, there is already a BASIC-to-Brainfuck compiler [1] and a C-to-Brainfuck compiler [2].) [1] https://esolangs.org/wiki/BFBASIC [2] https://esolangs.org/wiki/C2BF (and I think I've seen at least two more)

> a Go to Brainfuck compiler remains uncharted territory. Not at all... Just compile your Go code to WebAssembly [1], then to C [2], and finally to BF [3]. [1] https://binx.io/2022/04/22/golang-webassembly/ [2] https://webassembly.github.io/wabt/doc/wasm2c.1.html [3] https://esolangs.org/wiki/C2BF

I wonder how the code would look like if we compile the resulting BF code back to Go with the posted compiler.

Re: I wrote a Brainfuck to Go compiler

#23
post #10

Earlier quoted context omitted.

> a Go to Brainfuck compiler remains uncharted territory. Not at all... Just compile your Go code to WebAssembly [1], then to C [2], and finally to BF [3]. [1] https://binx.io/2022/04/22/golang-webassembly/ [2] https://webassembly.github.io/wabt/doc/wasm2c.1.html [3] https://esolangs.org/wiki/C2BF

I wonder how the code would look like if we compile the resulting BF code back to Go with the posted compiler.

You will probably want to go back to BF instead.
Post reply on HN