News for hackers. Stuff that matters.
Re:Go 1.2 Release Candidate 1 released by CoffeeDregs on Friday September 20, 2013 @12:43PM (#6418853)
I really want to like Go, but I'm having a hard time believing that they don't have a plan for generics. I've read the FAQs about go+generics, but do we have any better idea of when generics might make an appearance? Not being able to write a generic "map" function in a modern language seems very strange to me.

edit: there's something "map"-ish here: https://code.google.com/p/go/source/browse/src/pkg/exp/itera...

Re:Go 1.2 Release Candidate 1 released by dragonwriter on Friday September 20, 2013 @01:12PM (#6419041)
> I really want to like Go, but I'm having a hard time believing that they don't have a plan for generics. I've read the FAQs about go+generics, but do we have any better idea of when generics might make an appearance?

As a language feature: not likely any sooner than Go 2.0, given everything that's been said on the issue, though I suppose if a way could be found to do generics that doesn't explode compilation time and doesn't involve syntax changes that would break any existing Go 1.x code, it might happen in a later 1.x release. Wouldn't hold my breath.

Via a preprocessor? Its already a thing: https://github.com/droundy/gotgo

Re:Go 1.2 Release Candidate 1 released by bsg75 on Friday September 20, 2013 @02:42PM (#6419680)
http://golang.org/doc/faq : "Generics are convenient but they come at a cost in complexity in the type system and run-time. We haven't yet found a design that gives value proportionate to the complexity, although we continue to think about it. Meanwhile, Go's built-in maps and slices, plus the ability to use the empty interface to construct containers (with explicit unboxing) mean in many cases it is possible to write code that does what generics would enable, if less smoothly."

One of Go's goals is a certain level of simplicity. The above point seems to state that generics don't fit that goal, but they are not precluded from a future version.

I take this to mean that since no language has every feature that anyone could possibly want, if generics are a requirement for your work, then Go does not fit the requirements.

Some potentially relevant material here - http://commandcenter.blogspot.de/2012/06/less-is-exponential... :

"Early in the rollout of Go I was told by someone that he could not imagine working in a language without generic types. As I have reported elsewhere, I found that an odd remark."

Re:Go 1.2 Release Candidate 1 released by masklinn on Friday September 20, 2013 @12:52PM (#6418909)
> I really want to like Go

Why? 4 years on seems a long enough time to come to term with what Go is.