www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Go has contempt for generics

reply bearophile <bearophileHUGS lycos.com> writes:
Jonathan M Davis:
 Yes, you _can_ add things like generics into the language later, 
 but it can be quite disruptive to do so, and the result could be subpar due 
 to constraints such as backwards compatability.

D didn't have templates for some time. Maybe compile-time function execution plus a type type can replace the need for C++/D/Java style generics :-) Bye, bearophile
May 29 2010
next sibling parent BCS <none anon.com> writes:
Hello bearophile,

 Jonathan M Davis:
 
 Yes, you _can_ add things like generics into the language later, but
 it can be quite disruptive to do so, and the result could be subpar
 due to constraints such as backwards compatability.
 


They showed up much closer to v0.01 than v1.00
 Maybe compile-time function execution plus a type type can replace the
 need for C++/D/Java style generics :-)
 Bye,
 bearophile

... <IXOYE><
May 29 2010
prev sibling parent reply Don <nospam nospam.com> writes:
bearophile wrote:
 Jonathan M Davis:
 Yes, you _can_ add things like generics into the language later, 
 but it can be quite disruptive to do so, and the result could be subpar due 
 to constraints such as backwards compatability.

D didn't have templates for some time.

 Maybe compile-time function execution plus a type type can replace the need
for C++/D/Java style generics :-)

I agree with that. Over time, D has moved very strongly in that direction. I wonder how far that approach could ultimately be taken.
May 29 2010
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 05/29/2010 10:52 AM, Don wrote:
 bearophile wrote:
 Jonathan M Davis:
 Yes, you _can_ add things like generics into the language later, but
 it can be quite disruptive to do so, and the result could be subpar
 due to constraints such as backwards compatability.

D didn't have templates for some time.

 Maybe compile-time function execution plus a type type can replace the
 need for C++/D/Java style generics :-)

I agree with that. Over time, D has moved very strongly in that direction. I wonder how far that approach could ultimately be taken.

Clearly we're still exploring what the best way to carve the territory is, but one trend is clear: * Type-parameterized types and functions for generic programming * Compile-time function evaluation for generative programming Andrei
May 29 2010