dynamic classes and duck typing

BCS none at anon.com
Wed Dec 2 15:20:14 PST 2009


Hello Leandro,

> Don, el  2 de diciembre a las 22:20 me escribiste:
> 
>> They are metaprogramming tasks. Dynamic languages can do some
>> metaprogramming tasks. They can't do those ones.
>> 
> Because they make no sense, I really don't know how to put it. If you
> need speed, you code in C/C++/D whatever. Its like saying that you
> can't fly with a car and that's a problem. It's not, cars are not
> supposed to fly. If you need to fly, go buy a plane or a helicopter.
> Of course is much cooler to fly than to drive a car, but if you need
> to go just a couple of miles, flying gets really annoying, and it
> would take you more time, money and effort to do it than using your
> car.
> 

Saying "you can do that at runtime" re dynamic languages and D's meta programming 
is like saying a VW bug can carry rock when someone's looking for a pickup 
to move gravel in. Yes it's technically correct, but there are any thing 
a pickup can do that the bug can't (and the same the other way).

The same things is true of the topic at hand; dynamic language can do /some/ 
of what D's meta stuff can do, but not all of it. And I'll point out yet 
again; not all of the extra things D does are perf related.

And befor you say it; yes ther are seom things dynamic languages beat D at. 
All I'm saying is that meta isn't one of them.

>> Metaprogramming can be used to reduce big-O complexity rather than
>> just constant-factor improvement. Lumping that in with "optimisation"
>> is highly misleading.
>> 
> It always depends on the context, of course, but when doing programs
> that deals with small data sets and are mostly IO bounded, you
> *really* can care less about performance and big-O.
> 

1) If I can write a lib that given me a better O() for the same effort (once 
the lib is written) I *Always* care about O()
2) For all programs, the program is irrelevant or you will have someone throw 
more input at it than you ever expected.
3) the phrase is "can't care less" (sorry, nitpicking)





More information about the Digitalmars-d mailing list