[ ArgumentList ] vs. @( ArgumentList )

deadalnix deadalnix at gmail.com
Fri Nov 9 06:05:26 PST 2012


Le 08/11/2012 20:27, Nick Sabalausky a écrit :
> On Thu, 08 Nov 2012 21:53:11 +0400
> Dmitry Olshansky<dmitry.olsh at gmail.com>  wrote:
>
>> 11/7/2012 5:40 PM, deadalnix пишет:
>>>
>>> I think D has already too many feature, and that many of them can be
>>> implemented as attribute + AST processing.
>>
>> +1
>>
>
> Doesn't that still amount to the same amount of features though? At
> least from the user's standpoint anyway. Plus, I would imagine
> that library-implemented features would be slower to compile (simply
> because it's just that much more to be compiled).
>
> Not that I'm necessarily saying "Always stuff everything into the
> language forever!" I just don't see it as quite so clear-cut.
>

It have several advantages.

It is easy to test a feature as a lib, and then include it later in the 
standard lib if it does make sense. This is a great improvement as it 
don't require hacking the compiler.

This allow many people to play around with the feature they like without 
breaking the language in many pieces. As before, successful features can 
be included.

Implementing a feature don't require anymore to know the compiler 
internal, and do not require either to know other feature internals.

A new feature in compiler A is available in other compiler as well at 
the same time. Same goes for tooling around the language. Now, it is 
almost impossible to provide proper tooling around D because new feature 
are dropped into dmd master quite often and all tools have to be updated 
(most people give up at some point).

As of speed, some people, including me but I'm not the only one, are 
working toward JIT compile for CTFE. With some bytecode caching, I'm 
pretty sure really good performance can be achieved (unless the 
feature's implementation suck badly).


More information about the Digitalmars-d mailing list