dynamic classes and duck typing

BCS none at anon.com
Thu Dec 3 12:44:56 PST 2009


Hello Bill,

> On Wed, Dec 2, 2009 at 3:26 PM, BCS <none at anon.com> wrote:
> 
>> Hello Sergey,
>> 
>> 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.
>> 
> You may be able to memoize the generated code so you only have to
> generate it once per run, but use it many times.
> Probably performance is the reason you wouldn't want to reinterpret
> the DSL from scratch every use.  Even dynamic language users have
> their limits on how long they're willing to wait for something to
> finish.
> --bb
> 

Yes, some of the performance issue (that I didn't bring up) can be addressed. 
But what about the points I did bring up? Like added conceptual complexity 
and another degree of separation between what you want and what you get?





More information about the Digitalmars-d mailing list