4 ms·
Go does have subtyping (unlike Rust and Haskell), which makes type system needlessly more complicated and type inference harder.
by k_bx 6y ago
Go does have subtyping (unlike Rust and Haskell), which makes type system needlessly more complicated and type inference harder.
- atombender 6y agoGo doesn't have subtyping, only implicit coercions. Not the same thing.
- k_bx 6y agoRight, thank you for this correction! I've just spent some more time with Go, looks like I was wrong and it has something closer to Type Classes (or Traits), but not subtyping. // Too bad editing is not available anymore
- entha_saava 6y agoType deduction from right hand side expression is enough and that was stated in FAQ that they didn't want HM inference. Edit: well not in FAQ but somewhere else. IIRC Rob Pike.
- k_bx 6y agoTurns out I was wrong (and corrected thankfully), Go does not have subtyping, which is good news (at least it makes the language way more tolerable for me).