dynamic classes and duck typing
BCS
none at anon.com
Wed Dec 2 15:26:05 PST 2009
Hello Sergey,
> BCS wrote:
>
>> I'm not arguing on that point. What I'm arguing is that (at least for
>> me) the primary advantages of metaprogramming are static checks (for
>> non-perf benefits) and performance. Both of these must be done at
>> compile time. Runtime metaprogramming just seems pointless *to me.*
>>
> One of important applications of metaprogramming is code generation
> which would be too tedious or bug-prone to generate and support
> manually. Dynamic languages can definitely provide for that.
>
They can, but I question if it's the best way to do it in those languages.
Generating code and running it at runtime seems to be pointless. Why have
the intermediate step with the code? I have something I want to do, so I
use encode it as one abstraction (a DSL), translate it into another (the
host language) and then compute it in a third (the runtime). If it's all
at runtime anyway, why not just use the runtime to evaluate/interpret the
DSL directly.
More information about the Digitalmars-d
mailing list