Re:Another go at Go failed
by dded on Wednesday January 08, 2014 @08:38AM
(#7023344)
No, the problem is that SetUnion needs to be implemented six times for six different data types.
[ Parent
| on HN ]
Re:Another go at Go failed
by sixthloginorso on Wednesday January 08, 2014 @08:49AM
(#7023403)
Well, as we all know, Go does give you a way, sort of. You'd have to write basically a dynamic version using interface {}, and then write wrappers casting the values in and out, and possibly handing out the equality predicate.
That sucked in Java at the time, though, when you had to screw around casting Objects in your code, I don't see why people would prefer that.
Surprisingly, Erik Meijer (Haskell, C#) can somewhat see the appeal of no generics and a bit of casting:
22m-31m http://www.youtube.com/watch?v=on5DeUyWDqI#t=22m
(I give myself and Google a pat on the back for being able to remember and quickly find this!)
Re:Another go at Go failed
by Paradigma11 on Thursday January 09, 2014 @07:44AM
(#7030111)
Thanks.
Re:Another go at Go failed
by corresation on Wednesday January 08, 2014 @10:10AM
(#7023906)
For the app being described, would there really be six different type signatures required?
Generics would absolutely be nice for Go, primarily because they would allow the core libraries to provide all of these rich collections. However if we're discussing the notion that someone can write these themselves, it just seems contrived that people think generics are critical for any specific app -- in the example he described, it sounds like he would need one single concrete implementation.