4 ms·
No, type checking isn't the whole story. I think most people vastly overestimate how complex those algorithms actually are; you can have fast type checking for
by aseipp 6y ago
No, type checking isn't the whole story. I think most people vastly overestimate how complex those algorithms actually are; you can have fast type checking for a lot of languages that seem really advanced with very expressive features. OCaml is a good example; the compiler is extraordinarily fast despite being a much more high level and powerful language than a lot of others. It's got good code generation too. In the case of Rust, monomorphization is a bigger contributor.
Making a compiler fast is largely a goal you have to continuously strive for, and for the most part doesn't come for free, no matter the language. Saying "it's an issue with the compiler" makes it sound like the Rust team consciously made some horrible design decisions or something, but that isn't evidently clear from anything we can immediately observe.
The story I suspect is correct and vastly, vastly more boring is they probably focused on "the language" (features, APIs, etc) for a really long time and only started focusing on compiler performance in more recent memory, once users started getting more irritated, so it ran away from them a lot. That seems to happen to every compiler these days; features are what get monetary and mindshare support from users. Down-in-the-dirt .5% performance wins day in and day out, which you have to do a lot of to actually improve things most times, normally aren't fun, nor something people trot out the red carpet for.