java frontend lessons
I was browsing through Tom Tromey's blog, and found this entry.
I think some aspects of gcjx should be emulated in all future GCC front ends. For one thing, front ends should have their own representation, derived from the language being compiled — they should treat GCC trees as a target format, not a high-level representation. Trees aren’t statically typed, and they carry too much other baggage as well.
Second, front ends ought to be written as libraries. These days it isn’t enough to write a traditional batch compiler — you really want to look ahead a bit and consider IDE indexing, incremental compilation, and other uses of the parser and semantic analyzer.
Without pretending that algol frontend is going to be widely used, or has any killer-app qualities, it's interesting that the intuition led me this way itself. Algol compiler is being built as gcc-independent shared library, used by gcc frontend that does AST-to-GENERIC translation. Must be that unix philosophy thing.
