Re:Writing a Compiler in Go
by pjmlp on Tuesday May 03, 2016 @09:35AM
(#11620462)
When I did my compiler class at the university, our professor teached us a nice way to do dumb compilers, that I always suggest as learning process.
Generating bytecodes in a suitable text format, that can be either be easily validated and executed with a dumb interpreter, or translated into machine code via a Macro Assembler.
Surely the code performance sucks, but it gives the students the gratification of producing something that executes real machine code and that they can show off to their friends.
Generating bytecodes in a suitable text format, that can be either be easily validated and executed with a dumb interpreter, or translated into machine code via a Macro Assembler.
Surely the code performance sucks, but it gives the students the gratification of producing something that executes real machine code and that they can show off to their friends.