1. 2

Hacker News discussion of http://www.jerf.org/iri/post/2917 (2013)

  1.  

  2. 1

    The various options given here for doing Sum Types represent a common complain about Go: the simplicity of the language makes the implementation of ideas more complicated. I think it’s very hard to argue that sum-types in Go, whether it be @jerf’s solution or Alan Pierece’s, are simpler to understand than sum-types in a language like Ocaml. So the author has a choice to make use of a concept that is clearly valuable but a relatively complicated implementation or not make use of it and solve the problem another way which is likely complicated as well.

    1. 2

      I generally agree with your assessment. I’d say that Go lacks first class Sum Types and this saddens me somewhat. In many ways I’d compare it to forcing Java users to jump through the hoops of anonymous inner classes instead of just providing first-class functions (though that’s not a perfect metaphor). Language feature orthogonality does not always make for the most immediately expressive or consistently readable language.