dynamic classes and duck typing

BCS none at anon.com
Wed Dec 2 09:37:34 PST 2009


Hello Leandro,

 
> If you say dynamic languages don't have metaprogramming capabilities,
> you just don't have any idea of what a dynamic language really is.
> 

If you say you can do metaprogramming at runtime you just don't have any 
idea of what I want to do with metaprogramming. For example:

unit carrying types: check for unit errors (adding feet to seconds) at compile 
time. I can be sure there are no unit error without knowing if I've executed 
every possible code path.

Domain specific compile time optimizations: Evaluate a O(n^3) function so 
I can generate O(n) code rather than write O(n^2) code. If you do that at 
runtime, things get slower, not faster.

Any language that doesn't have a "compile time" that is evaluated only once 
for all code and before the product ships, can't do these. 





More information about the Digitalmars-d mailing list