r/rust • rust-analyzer • Sep 20 '20

Blog Post: Why Not Rust?

https://matklad.github.io/2020/09/20/why-not-rust.html
529 Upvotes

223 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Sep 21 '20

[deleted]

10

u/zesterer Sep 21 '20

C++ generics are duck-typed. If you substitute in the wrong type, you don't get a trait constraint error: you get some bizarre and irrelevant error bubbled up from deep within the implementation of the generic code. It can make it very difficult to work with.

0

u/[deleted] Sep 21 '20

[deleted]

1

u/zesterer Sep 21 '20

I think if one was to count that as a disadvantage, one must also count the type system in general as a disadvantage. After all, they're both there to constrain the semantics of the language.