3 ms·
Does it provide interesting advantages over "transpiling" to C?
by astrobe_ 9y ago
Does it provide interesting advantages over "transpiling" to C?
- le-mark 9y agoThis is my question as well, seems like a boat load more work than writing c to a file and calling gcc on it. One thing I can think of; if the language you're implementing has exceptions, you'd have to implement these the naive way wiht setjmp/longjmp if you target c. Supposedly if you used gcc in the way this article shows, you could use gcc to generate "real" excpetions.
- dajt 9y agoIf the author wants to show how to write a front end targeting GCC then writing a translator to C would not do that. It is an educational exercise.