Re:Go 1.3 is released
by seanmcdirmid on Wednesday June 18, 2014 @10:19PM
(#7914072)
Most programs don't need generics like most programs don't need static typing. Just use "any" and downcast.
[ Parent
| on HN ]
That's entirely different. Generics can be replaced by code-generation (C++-style templates) in a preprocessor with no loss of safety, or by boring copy-paste (with some loss of safety :-().
non-static typing is a massive loss of safety.
Static typing can be replicated in a dynamically typed language with a preprocessor too. (For example, see TypeScript.)
Re:Go 1.3 is released
by seanmcdirmid on Thursday June 19, 2014 @03:00AM
(#7914793)
Templates/macros/preprocessing do sacrifice separate compilation and separate type checking; so your error messages might not be comprehensible, your compile times can be much slower, and...you need source for your generic container. Rob Pike probably knows the drawbacks of that approach well and I doubt he would go there.