3 ms·
As I read it, the author wasn't discounting those languages or saying nobody had heard of generics, he was saying that newer languages demonstrate that generics
by cratermoon 9y ago
As I read it, the author wasn't discounting those languages or saying nobody had heard of generics, he was saying that newer languages demonstrate that generics are now expected. Remember, both c++ and Java got generics added on (and c# followed Java's lead).
The introduction of languages that have generics designed in from day one is key. Even though Go doesn't (yet?) have them, the fact that its designers wrestled with the question from the start is an indicator that the concept has become central to programming language design.
- munificent 9y ago> Remember, both c++ and Java got generics added on (and c# followed Java's lead). C++ got templates 27 years ago. Java got generics 13 years ago. C# got them 12 years ago. Go was launched 10 years ago. I can't think of a single statically typed language with significant use when Go was developed that didn't have some for of type parametricity. Maybe C, but you could argue C users can simply opt into C++ if they want that. The Go folks aren't risking being on the wrong side if they history if they don't add generics. They were on the wrong side of history when the language launched. I do understand that generics are very difficult in an ahead-of-time compiled language where fast modular compiles are a priority one goal. I'm not saying its easy, at all. But there's no shortage of brilliant folks on the team. If they put their minds to it, they could solve this. Maybe it was because they had the luxury of controlling the language and core libraries. They could make the types and functions they cared about -- channels, arrays, slices, maps, append(), etc. generic since they could bake them right into the language. It's really easy to not empathize with a user's problem if you don't experience it yourself.
- pjmlp 9y agoYou got your history wrong. C++ got templates during the time it was being designed. Between C++ ARM and ANSI C++98, C++ compilers experimented with them, and its design reflected on the standard work. Borland was one of the first PC compiler vendors to support templates, still on their MS-DOS/Windows 3.1 compilers, with the release of Borland C++ 3.0. Microsoft Research already had a .NET prototype with generics support, by the time v1.0 was about to get released, but they decided it was more relevant to ship v1.0 than waiting for the generics support to be fully done. Don Syme from the F# team has a few blog entries about this. One of the first languages to get generics was CLU in 1975, shortly followed by ML and Ada in the early 80's.
- rst 9y agoC++ did not have templates when the first commercial compilers shipped and the first books were published. It got templates around 1990, five years after the first release of a commercial C++ compiler and the first publication of "The C++ Programming Language". ref: http://www.stroustrup.com/hopl-almost-final.pdf http://www.stroustrup.com/hopl-almost-final.pdf
- pjmlp 9y agoC++ was only set in stone in 1998 with the release of ANSI C++98. Until then, it was a moving target, with C++ compilers catching up with CFront and ongoing work at ANSI/ISO meetings.