re: Benefits of Rust VIEW POST

re: You seem to be undervaluing Rust's type system. Generics aside, one of the biggest complaints I see Rust users having when they try Go is how there...

Good point. That was a big phrasing mistake on my part. A better expression of what I was thinking would be "insufficient middle-ground".

I'm sure at least some of it is that we've been spoiled by Rust's excellent support for using sum types (enums containing data... A.K.A. compiler-verified tagged unions) to extend the compiler's ability to catch mistakes in variably-typed fields.

(The name "sum type" refers to the set of possible combinations. A tagged union is the sum of the possible combinations of its values. A struct is an example of a product type because its possible combinations are the set product of the possible combinations of its members.)

...but then the Rust community are overachievers that way. They've been working hard to design a viable system of Pi/Dependent types. (Types where, as in Ada, you can say that type Rating is "Type u8 where the value is in the range '1 through 5'" and get various kinds of compile-time goodness from it.)

Code of Conduct Report abuse