foreach and metaprogramming

Bill Baxter dnewsgroup at billbaxter.com
Tue Nov 7 19:44:45 PST 2006


Charles D Hixson wrote:
> Per Eckerdal wrote:
>> ...
>> To me the question seems to be whether to implement one feature after 
>> another and inevitably seeing D become bloated like all the other 
>> languages (Java, C++) or implementing a metaobject protocol and have 
>> all those features in a snap and being able to extend the language 
>> beyond Java's wildest dreams, without bloating the core language. 
>> (Okay, I admit that was slightly angled towards my view, but I hope 
>> you get my point)
>>
>> Don't think I dislike D, I am seriously impressed by it and like it a 
>> lot. I just think it could be even better :)
>>
>> /Per
> 
> I more or less agree with you, but many people here are much more 
> focused on speed.  General features are powerful, but code generated 
> using them tends to be (relatively) slow. Functions coded in a more 
> specialized fashion can be faster. Whether the difference is significant 
> or not depends on what you are planning to do.

And if you don't need the speed then there are number of nice languages 
out there that will probably suit most folks needs better than D, so it 
makes sense that D should not yield on that point.

On the other hand, there are cases where a more general feature could be 
as fast or faster than the specialized functions, but the general 
feature is much harder to implement in the compiler.  In that case D 
tends to go for the easy fix.  Working fast today is valued more than 
being general today and maybe working fast someday.  D tends toward 
"fast today" and "maybe general someday".

Lisp is a good example of 'general today, maybe fast someday'.  From 
what I understand, there still aren't any high-quality freely-available 
Lisp compilers out there.

--bb



More information about the Digitalmars-d mailing list