Re:I wrote a 231-byte Brainfuck compiler by abusing everything
by zelon88 on Monday July 12, 2021 @09:37AM
(#27810106)
It seems more like a parser than a compiler. It doesn't write a binary, it just translates brainfuck to C source code. In the OPs defense, they did say "by abusing everything."
[ Parent
| on HN ]
Re:I wrote a 231-byte Brainfuck compiler by abusing everything
by barosl on Monday July 12, 2021 @09:50AM
(#27810239)
A compiler doesn't have to emit machine code. It just needs to translate one language into another, which the author's program does.
Also, a parser implies having an internal, structured representation. As the C language is neither internal nor structured, I'd say the program is more likely a compiler.
Re:I wrote a 231-byte Brainfuck compiler by abusing everything
by recursive on Monday July 12, 2021 @10:08AM
(#27810421)
I blame the rise of the word "transpiler" for making people think that compilation is some more magic/narrow/special thing.
Re:I wrote a 231-byte Brainfuck compiler by abusing everything
by whatshisface on Monday July 12, 2021 @11:36AM
(#27811338)
There is a practical, empirical distinction between compilers and transpilers. Most compilers in practice have backends full of deep and well-explored techniques specific to machine code like register allocation, window optimizations, and other stuff like that. Most transpilers you see out in the wild share more in common with compiler frontends in the techniques and the theory they apply.
Re:I wrote a 231-byte Brainfuck compiler by abusing everything
by mywittyname on Monday July 12, 2021 @04:12PM
(#27814517)
The term transpiler arose when there was a need to denote a special kind of compiler whose target is another language or version of the same language.