3 ms·
Did you create an interpreter for the language before you started on the compiler? I think it's not much overhead and you can run tests with it to make sure you
by Pirate-of-SV 12y ago
Did you create an interpreter for the language before you started on the compiler? I think it's not much overhead and you can run tests with it to make sure you get all the lexing and parsing done correctly. Then you just replace the evaluation with code generation and BAM! you've got a compiler.
- dochtman 12y agoNo, I didn't. For my language, being compiled down to machine code has been one of the design goals. Also, it doesn't seem to me like building an interpreter is significantly simpler than building a compiler (at least given the fact that I've left a bunch of the hard stuff to LLVM magic). LLVM IR isn't that hard to write.