The Next Big Language
Paulo Pinto
pjmlp at progtools.org
Thu Oct 21 12:45:32 PDT 2010
Sorry but I still don't get it.
Do you mean that the types that erased and the same code is generated?
Then let me say that .Net generics get generated on the fly and JITed for
each
different type.
Eiffel and Modula-3 generics also have specific generated code for each
type.
The major difference regarding C++ code is that the linkers are smarter and
are
able to remove duplicates of the generated code for the same set of type
arguments.
--
Paulo
"Jonathan M Davis" <jmdavisProg at gmx.com> wrote in message
news:mailman.755.1287643587.858.digitalmars-d at puremagic.com...
> On Wednesday 20 October 2010 22:47:15 Paulo Pinto wrote:
>> Eiffel does have templates, as in generic types.
>>
>> Or do you mean the compile time trick that C++ templates allow, thus
>> opening the door for
>> the meta programming done at compile time?
>
> Templates and generics are two separate - albeit related - things.
> Templates
> generate code whereas generics allow you to use multiple types with the
> same
> code (be it by generating code or by actually making them share code). C++
> templates happen to allow for metaprogramming beyond that, but I don't
> think
> that that's necessary for a language to be considered to have templates.
> The key
> thing is that templates _generate_ code whereas generics can simply make
> multiple types use the same code. C++ and D are the only languages that
> I'm
> aware of which have templates. Other languages with generics generally
> don't use
> templates to have generics.
>
> - Jonathan M Davis
More information about the Digitalmars-d
mailing list