Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The Golang FAQ mentions from the day one that they are going to consider adding ge<censored>ics someday in the future. So I was wandering if there are any updates regarding this. I didn't expect such a fanboysm though...


The FAQ also says that Go 1 will not introduce backwards-incompatible changes. Generics would be such a backwards-incompatible change.

So the answer to "are there generics in 1.x release" will always be "no".

http://golang.org/doc/faq#What_is_the_status_of_the_project http://golang.org/doc/go1compat

Go 2 is years away (if it even happens).


How are generics backward-incompatible? They would obviously affect forward compatibility, but what previously valid programs would have to become invalid with the introduction of generics? (Incidentally, as an interesting contrast, this GOMAXPROCS default change will break some existing programs.)


The only way to keep old code working would be to add generics but continue having an awful standard library that never uses them.


How will GOMAXPROCS default change break existing programs?


Per the OP: "Increased parallelism could make bugs in racy programs more likely to cause crashes or other problems. The setting of GOMAXPROCS=1 may have thus far let those bugs go undetected. Raising it may therefore make buggy programs less reliable."


GOMAXPROCS isn't really a language feature, that's all implementation specific AFAIC.


What old code would break when adding generics?


>"are there generics in 1.x release"

I've never asked this. Certainly it would have been a big news. I asked if there are any updates in general - any new thoughts, plans...


Generics were added to Java 1.5 in a backwards compatible way: all your existing Java code would build fine with Java 1.5 javac. So it is not inherently impossible.


Even if there were news, it's certainly off topic for this post.


If you ever implement it, I suggest a release on april 1st.


That would be my favorite April Fools ever.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: