3 ms·
I happen to be of the opinion that Rust programs tend to heavily overuse monomorphization. It's not always so clear cut that it's worth gaining a slight amount
by wavemode 2y ago
I happen to be of the opinion that Rust programs tend to heavily overuse monomorphization. It's not always so clear cut that it's worth gaining a slight amount of runtime speed in exchange for losing a massive amount of compilation speed and binary size.
What I'd love is a language which is able to compile 'impl TraitName' into dynamic dispatch in debug mode and only monomorphize it in release mode.
Basically, an automation of this technique: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=1055a2f0583c4c01e1386508bb506ee4 https://play.rust-lang.org/?version=stable&mode=debug&editio...
- mayoff 2y agoSwift does that. https://github.com/swiftlang/swift-evolution/blob/main/proposals/0460-specialized.md https://github.com/swiftlang/swift-evolution/blob/main/propo...