does D already have too many language features ?

Abdulhaq alynch4047 at gmail.com
Tue Apr 9 16:56:39 UTC 2019


On Tuesday, 9 April 2019 at 11:39:33 UTC, Atila Neves wrote:
> On Monday, 8 April 2019 at 18:59:25 UTC, Abdulhaq wrote:
>> On Monday, 8 April 2019 at 18:45:24 UTC, jmh530 wrote:

>>
>> The problem with AST macros, and Walter seems to agree with 
>> this POV, is that every medium to large project will have its 
>> own private language that ripples throughout the code. Only a 
>> few of the developers will really understand this new language 
>> and how it can safely be used and where its pitfalls are. It 
>> will be poorly documented and a nightmare for new developers.
>
> Every medium to large project in a language *without* AST 
> macros already has its own private language that is poorly 
> documented and only a few of the developers really understand. 
> It's just that this DSL is in the syntax of the host language.

Yes, and writing those DSLs for that big project is often the 
most fun part. However, those DSLs are normally tucked away in a 
specific functional area, whereas when the developer can create 
AST macros, the DSL can do crazy stuff and can be present or even 
required in every source file.

For instance, take the named parameters proposals. With AST 
macros each person can implement their own ideas. We could end up 
with one library having them one way, another library having them 
implemented a very different way with different behaviour. It 
would be very annoying if you wanted to use both libraries. Then 
multiply that by all the other unapproved DIPs.






More information about the Digitalmars-d mailing list