D community's view on syntactic sugar

rumbu rumbu at rumbu.ro
Sat Jun 16 05:03:30 UTC 2018


On Saturday, 16 June 2018 at 02:44:04 UTC, Jonathan M Davis wrote:
>
> Typically, the approach right now is to do stuff in libraries 
> rather than the language if it's at all reasonably possible. 
> The language is incredibly powerful as it is, and we can do a 
> _lot_ of stuff with libraries, frequently without making it 
> much noisier than it would be to put it in the language.

The main problem with library solutions is the fact that 
corresponding language services are not available for them (think 
of code completion). Even if a language service will make the 
effort to interpret a library construct like SafeAccess!stuff and 
provide code completion, it will not work for other names - maybe 
I'd like to use Elvis!stuff. On the contrary, if it's built in 
the language and the meaning of stuff? is guaranteed to be the 
same across compilers, the language services can safely assume it 
and provide all associated goodies.

The same problem is encountered with property bloat code, mixin 
constructs are not the best friends of language services.




More information about the Digitalmars-d mailing list