4 ms·
Doesn't multiple dispatch require run-time type analysis? If so wouldn't that go against Rust's philosophy of zero-cost abstractions?
by m0th87 12y ago
Doesn't multiple dispatch require run-time type analysis? If so wouldn't that go against Rust's philosophy of zero-cost abstractions?
- carterschonwald 12y agonope, its all compile time. its just that instead of deciding which impl to pick based upon information X, youre using a pair of pieces of information (X,Y) Edit, also I think the "convertable" class idea is nearly expressible using associated types in rust today,but im not 100% certain about that
- m0th87 12y agoWikipedia implies that multiple dispatch is done by run-time time analysis in OO languages, which does not apply to Haskell or Rust: https://en.wikipedia.org/wiki/Multiple_dispatch https://en.wikipedia.org/wiki/Multiple_dispatch Maybe it's being pedantic, but I can't tell. Are Haskell's type classes strictly as flexible as multiple dispatch?
- twic 12y agoThe proposed Rust feature sounds like overloading rather than multiple dispatch as it is usually understood.
- kibwen 12y agoRust's upcoming support for multidispatch traits is all strictly static.