3 ms·
> solid type system Politely closes door in your face
by shpongled 3y ago
> solid type system
Politely closes door in your face
- bheadmaster 3y agoI personally enjoy working with Go's type system even more than Rust's. For example, implicit interfaces make code reuse much easier than Rust's traits.
- shpongled 3y agoLack of sum types is complete deal-breaker for me unfortunately.
- bheadmaster 3y agoThere's a proposal, for what it's worth: https://github.com/golang/go/issues/57644 https://github.com/golang/go/issues/57644 Although I'm curious, what is your use case that cannot be fulfilled by interfaces, but can with sum types?
- shpongled 3y ago`if err != nil` is the easiest example. Sum types allow you to express type-level OR. Structs/tuples etc are AND (product types). I like to be able to use both OR and AND at both the expression and type level.