POV-Ray : Newsgroups : povray.off-topic : Learning C# : Re: Learning C# Server Time
29 Jul 2024 04:26:26 EDT (-0400)
  Re: Learning C#  
From: Orchid Win7 v1
Date: 30 Sep 2012 06:06:07
Message: <5068198f$1@news.povray.org>
>> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.