logoalt Hacker News

umanwizardlast Tuesday at 11:11 PM1 replyview on HN

What makes you think Rust’s compile times are related to its type system?


Replies

munificentlast Wednesday at 2:24 AM

The way the type system interacts with the rest of the language leads you down the path to monomorphization as the compilation strategy. Monomorphizing is what gives you huge piles of instantiated code that then has to be run through the compiler back end.

Blaming it on LLVM like another comment does misses the point. Any back end is slow if you throw a truck-load of code at it.

I'm not saying monomorphization is intrinsically bad. (My current hobby language works this way.) But it's certainly a trade-off with real costs and the Go folks didn't want their users to have to pay those costs.

show 2 replies