3 ms·
> How can it be even remotely as efficient as a compiler with decades of optimization witchcraft and sorcery? This is just a frontend. The optimization witchc
by comex 10y ago
> How can it be even remotely as efficient as a compiler with decades of optimization witchcraft and sorcery?
This is just a frontend. The optimization witchcraft and sorcery all lives in the middle/backend, which in this case is LLVM. LLVM can do a decent job optimizing pretty much anything you throw at it, though broadly speaking it works better the more the IR looks like C. For example, Rust does a lot of moves of large structures, unlike C/C++; IIRC pcwalton submitted some optimizations involving those to LLVM, which are language-neutral but which nobody had bothered to implement before because C/C++ didn't need them as much.
- throwaway7645 10y agoAh didn't know it was using LLVM...thanks.