Re:Go 1.3 is released
by Touche on Wednesday June 18, 2014 @11:03PM
(#7914181)
Most programs do list manipulation and list manipulation in Go is a pain. Generics are one solution for that.
[ Parent
| on HN ]
I agree generic would be a serious win for Golang. However in the meantime we have this workaround/hack which alleviates some of the pain http://clipperhouse.github.io/gen/
Appreciate the mention! Also gen is getting more, um, generic with the notion of custom ‘typewriters’, out on this branch: https://github.com/clipperhouse/gen/tree/3.0
Re:Go 1.3 is released
by logicchains on Thursday June 19, 2014 @12:00AM
(#7914403)
Lisp manipulation? Do you mean linked lists, or arraylists? The only common use of linked lists I've encountered is writing custom allocators, and most programs don't need custom allocators.
Go "lists" are type dynamic -- "generics" in the most important place for generics to be.
Re:Go 1.3 is released
by steveklabnik on Thursday June 19, 2014 @10:43AM
(#7916312)
Heterogeneous lists are not "generics."
A Go map is of the defintion map[KeyType]ValueType. A Go slice and dynamic array is similar typed. That isn't heterogeneous, it isn't of type object, and is 99% of the common use of generics.
Yeah, the native fundamental collections are generic.
Re:Go 1.3 is released
by steveklabnik on Thursday June 19, 2014 @11:23AM
(#7916570)
I have a feeling we're talking about different things: when people speak about Go generics, they mean that the language doesn't support parametric polymorphism. Yes, some of the built-in types are special. That's not the point.
lolwhat? How exactly would list manipulations in Go be made easier because of generics?
Re:Go 1.3 is released
by TheCoelacanth on Thursday June 19, 2014 @10:55AM
(#7916384)
How many of these[1] functions can I write in Go without doing a bunch of casting? Probably less than half.
[1] https://hackage.haskell.org/package/base-4.7.0.0/docs/Data-L...