3 ms·
I imagine most of the complaining is by people that haven't even spent much time in the language, let alone this new tool. I'm would wager that generics were a
by blakecaldwell 12y ago
I imagine most of the complaining is by people that haven't even spent much time in the language, let alone this new tool.
I'm would wager that generics were a driving force behind this. They don't want to add them to the language (fair), but are willing to offer a way for us to add them at precompile time.
- mseepgood 12y ago> I'm would wager that generics were a driving force behind this. The driving forces were yacc, protocol buffers, enum strings, unicode tables, encoding/decoding arrays, time zone data. That's what they use it for.
- lomnakkus 12y agoHow would that work? AFAIU the idea is that library authors check in the generated code -- so a consumer of your code wouldn't be able to (or at least would be actively discouraged from) generate new code for a library. And thus wouldn't be able to generate "instances" for generic code.
- blakecaldwell 12y agoI haven't spent much time looking into this, and haven't used it yet, but from the Stringer example, they're providing us with a tool to generate strings for enum values. That same approach could be used to generate support for typed collections for your types. I could make the collection-generating code, and you could generate the collections for your types.
- lomnakkus 12y agoYeah, for your types, but if I'm a provider of a library of generic data structures (which is what the people asking for generics are probably thinking about), you're out of luck since I have no way of letting you generate appropriate instances.