DIP 1026---Deprecate Context-Sensitive String Literals---Community Review Round 1

Andrei Alexandrescu SeeWebsiteForEmail at erdani.com
Tue Dec 3 19:42:12 UTC 2019


On 12/3/19 9:45 AM, Dennis wrote:
> On Tuesday, 3 December 2019 at 12:38:29 UTC, Andrei Alexandrescu wrote:
>> Waste of labor is sadly a common theme in our community.
> 
> I consider this low-hanging fruit: just deprecating a token takes little 
> implementation effort, and reduction in language complexity is (as far 
> as I know) always welcome

These can never be the primary reasons for removing a feature. One 
doesn't remove a feature because it's easy to remove. One removes a 
feature because there are good reasons to remove it, and as perks we get 
simplification of the language and maybe it's easy to remove.

> In this case, such tools would be syntax highlighters.

The entire narrative of the DIP puts CFG front and center. Reader's 
first thought is, "wait, the author is confused about what a CFG is."

FIRST sentence in the abstract: "D is intended to have a context-free 
grammar..."

FIRST paragraph in the rationale: "Regarding language design, Walter 
Bright has stated: [... CFG stuff ...]"

Even the "Grammar Changes" section should be a give-away: the diff 
proposed is in the LEXICAL definition (https://dlang.org/spec/lex.html), 
not in the GRAMMAR definition (https://dlang.org/spec/grammar.html).

If syntax highlighters are the primary reason for the DIP, it should be 
the primary reason in the DIP. The entire rationale needs to be redone. 
There should be an enumeration of syntax highlighters along with their 
success/failure of implementing heredocs. (Didn't test all but far as I 
can tell I've never heard of difficulties with implementing heredocs for 
bash, perl and the like.)

> Maybe you don't care about syntax highlighting, but please judge this 
> DIP by its own merits and not compared to potential other DIPs that you 
> care more about.

A DIP ought to be judged by reading the DIP. This DIP is ill informed 
because it is built around the CFG argument, a non-existing issue. If 
the DIP requires a forum post explaining how it needs to be judged, 
that's a problem with the DIP, not the reader.


More information about the Digitalmars-d mailing list