Rather D1 then D2

Jonathan Marler johnnymarler at gmail.com
Sat Sep 22 20:40:14 UTC 2018


On Saturday, 22 September 2018 at 19:04:41 UTC, Henrik wrote:
> On Saturday, 22 September 2018 at 15:45:09 UTC, Jonathan Marler 
> wrote:
>> On Saturday, 22 September 2018 at 15:25:32 UTC, aberba wrote:
>>> On Saturday, 22 September 2018 at 14:31:20 UTC, Jonathan 
>>> Marler wrote:
>>>> On Saturday, 22 September 2018 at 13:25:27 UTC, rikki 
>>>> cattermole wrote:
>>>>> Then D isn't the right choice for you.
>>>>
>>>> I think it makes for a better community if we can be more 
>>>> welcoming, helpful a gracious instead of responding to 
>>>> criticism this way. This is someone who saw enough potential 
>>>> with D to end up on the forums but had some gripes with it, 
>>>> after all who doesn't? I'm glad he took the initiative to 
>>>> provide us with good feedback, and he's not the first to 
>>>> take issue with the inconsistent '@' attribute syntax.  I'm 
>>>> sure everyone can agree this inconsistency is less than 
>>>> ideal but that doesn't mean D isn't right for them and we 
>>>> should respond this feedback like this with thanks rather 
>>>> than dismissal.
>>>
>>> That inconsistency is an issue for me. I wish there a clear 
>>> decision to make things consistent.
>>
>> Yeah there's been alot of discussion around it over the years, 
>> which is why I put this together about 4 years ago:
>>
>> https://wiki.dlang.org/Language_Designs_Explained#Function_attributes
>>
>> Gosh I've forgotten how long I've been using D.
>
> Interesting article.
>
> "int safe = 0; // This code would break if "safe" was added as 
> a keyword"
>
> My question here: why didn't D use a similar solution as C when 
> dealing with these things? Look at the introduction of the bool 
> datatype in C99. They created the compiler reserved type 
> "_Bool" and put "typedef _Bool bool" in "stdbool.h". The people 
> wanting to use this new feature can include this header, and 
> other can leave it be. No ugly "@" polluting the language on 
> every line where it's used. Wouldn't a similar solution have 
> been possible in D?

That works for types but wouldn't work for keywords. Keywords 
have special meaning in the lexical stage and you can't 
extend/change the grammar of the language via an alias or 
typedef.  You could do something like this with a preprocessor 
but then you run into all sorts of other problems (i.e. #define 
safe @safe).

If you come up with other ideas then feel free to share.  No one 
likes the current state but no one has come up with a good 
solution yet.



More information about the Digitalmars-d mailing list