I'd argue that supporting typeclasses *instead of* the current obj
system could reduce cognitive load by providing a single, consistent,
more general way to express a bunch of things that are currently
problematic and special-cased. I'll come up with a serious proposal
when the bootstrapping is behind us.

Correct me if I am wrong, but in a generic typeclass system one can define a new type is an instance of (for example) Number by defining its '<', '+', etc.

Since we intend to support separate compilation, this looks like a really expensive feature.

In the current system a vtable is only produced for each obj X interface pair that is used. Somewhat more expensive and expressive than c++.

If replacing it with type classes, it should be clear to the user where type descriptors are introduced.

How expensive is it to construct the type descriptors? How are they mapped when a function that takes an Integer passes it to a more generic function that takes a Number?

Cheers,
Rafael
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to