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

Of course we can, after all we were writing code before generics became mainstream around the mid-2000's.

The point was creating a language without them after they had become a common language feature across all major static languages.



C doesn't have generics. Objective-C didn't get generics until 2015, which is well after Go was released. Not all major static languages have generics and not all major static languages had generics when Go was being planned.

Not that Go ever planned to not have generics. It was always simply a question of how to implement them in a non-ridiculous way. They were warned early on by members of the Java team to tread carefully and not make the same mistakes they did.

The team has crafted many generics proposals over the years, but they all fell short one way or another.


C has basic support for generics since 2011.

Objective-C merges C's type system with the dynamism of Smalltalk. Generics are only meant as a mechanism to ease interop with Swift.

Dynamic languages naturally don't require generics due to their semantics.

The team always handwaved the remarks of many of us as they now themselves recognise.

"In retrospect, we were biased too much by experience with C++ without concepts and Java generics. We would have been well-served to spend more time with CLU and C++ concepts earlier."


To be fair, we had macros and they covered many of the uses of generics people are arguing with.




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

Search: