|
![](/i/fill.gif) |
>> And Haskell generates one version of the code, and lets you request
>> specific versions if you want them.
>
> Well, all three do that, for some definition of "version" and "request"
> and "specific". :-) I think you'd have to be a little more precise if
> you were trying to make a point there.
Java does all polymorphism at run-time.
C++ does polymorphism at compile-time if you implement it with
templates, and at run-time if you implement it with inheritance. (I.e.,
to switch from one to the other, you have to radically restructure your
application.)
I have no idea what C# does.
Haskell does polymorphism at run-time. Unless you add a single compiler
pragma, in which case you can selectively turn on compile-time
polymorphism instead, on a per-function, per-type basis. (Usually only
for types you use heavily, or for primitive types where it's going to
allow lots of other optimisations to fire.)
And really, whether it's done at compile-time or run-time is an
implementation detail. It /ought/ to be trivial to switch from one to
the other...
Post a reply to this message
|
![](/i/fill.gif) |