4 ms·
I'm going to make the even stronger claim that a general-purpose statically typed language that doesn't support sum types and exhaustive pattern matching to at
by howinteresting 4y ago
I'm going to make the even stronger claim that a general-purpose statically typed language that doesn't support sum types and exhaustive pattern matching to at least the extent that Rust does is unfit for general use, just like a language that doesn't have product types is unfit for general use.
Dynamically-typed languages often have adhoc sum types.
- unclad5968 4y agoWell that's obviously not true given all the successful apps written in languages that don't support sum types.
- tialaramex 4y agoIt depends what you take "unfit" to mean. Suppose I say that cars without seatbelts are "unfit" to use on public roads. Clearly I can't mean it's impossible to use such cars, people used to do it all the time, but perhaps I mean it's a bad idea to use them, and that's harder to argue with which is why we got laws saying you need seatbelts.
- deleted 4y ago[deleted]
- andrewflnr 4y agoA lot of successful apps were written with GOTO. That doesn't mean it's a good idea now.
- mikebenfield 4y agoI know your claim will strike some people as absurd, but I agree. I am honestly flabbergasted that any general purpose language created in the last 20 years doesn't have sum types and pattern matching. To me they are very nearly as fundamental as aggregate types (aka structs or product types).