3 ms·
It's important to not only take compilation speed but also code quality into account. Swift and Go made very different tradeoffs here with SIL+LLVM compared to
by pcwalton 11y ago
It's important to not only take compilation speed but also code quality into account. Swift and Go made very different tradeoffs here with SIL+LLVM compared to Plan 9.
- oofabz 11y agoI think Go hoped GCC would be their high-performance compiler, but it never got the attention it needed. GCC has better micro-optimization in gccgo, but the compiler lacks important features like escape analysis and an up-to-date runtime so it's slower on real-world code.
- pcwalton 11y agoYeah, it goes to show that you really want a mid-level language-specific IR (which is what the Plan 9-based compilers have) if your language is at all high level. I think the ideal for best performance of generated code is 3 IRs: a mid-level language-specific IR for high-level optimizations (especially around memory management and devirtualization), a low-level IR for lower-level optimizations (e.g. algebraic simplifications), and a codegen IR (for instruction selection and scheduling). This is what Swift is doing, as far as I can tell.