Am I seeing this right, that @rustlang has no Concepts/Type Classes for generics?
-
Show this thread
-
Replying to @ArvidGerstmann @rustlang
Rust traits are better than C++ concepts. Rust can validate the code inside generic functions for correctness even when function is not used by any call sites. No duck typing.
2 replies 0 retweets 11 likes -
Sounds like a disadvantage to me.
1 reply 0 retweets 1 like -
Replying to @shergin @SebAaltonen and
It is only a disadvantage if you can write 100% bug free code 100% of the time. For us humans the guard rails end up being useful
.2 replies 0 retweets 0 likes -
Replying to @MaciejHirsz @shergin and
It also means better error messages, though of course that’s subjective!
1 reply 0 retweets 0 likes -
Replying to @rustlang @MaciejHirsz and
Error messages are not part of the core language design. They can be improved separately.
1 reply 0 retweets 0 likes
This affects errors because errors happen in the function you’re writing, not the expanded template. I’m not aware of a compiler that sees “oh you committed an error in an expansion, let me un-expand and figure out where that came from” but I guess in theory one could be built!
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.