Why I chose D over Ada and Eiffel
bearophile
bearophileHUGS at lycos.com
Wed Aug 21 19:51:49 PDT 2013
Tyler Jameson Little:
> It also has generics, which are runtime generics if I'm not
> mistaken.
> - templates instead of generics (little reason to take a
> performance hit)
As far as I know Rust uses monomorphization just like C++ and D
for generics. The difference in generics between D and Rust is
that Rust has them strongly typed with type classes (this means
inside a function templated on an argument, you can't do on that
argument operations that are not specified in its static type
class). But unlike the type classes of Haskell, the Rust ones are
designed to have no run-time hit (but this makes them currently
less powerful. Some persons are trying to improve this in Rust).
Perhaps the original poster of this thread is looking for this.
Bye,
bearophile
More information about the Digitalmars-d
mailing list