The Next Big Language
Simen kjaeraas
simen.kjaras at gmail.com
Thu Oct 21 13:00:23 PDT 2010
Paulo Pinto <pjmlp at progtools.org> wrote:
> 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.
The point is, D and C++ templates can do a lot more than simple generics.
Generics is limited to simple copying and pasting of type names, whereas
templates can build a DSL parser for you, let you choose whether a
function should be parallelized, a type thread-safe, etc.
--
Simen
More information about the Digitalmars-d
mailing list