DIP 1026---Deprecate Context-Sensitive String Literals---Community Review Round 1
Dennis
dkorpel at gmail.com
Tue Dec 3 14:45:31 UTC 2019
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 for the usual
reasons:
- less code in dmd
- less specification text
- less didactic material / stuff to learn for new D programmers
- less bug/enhancement reports
- any tool that re-implements some part of the compiler is easier
to make
In this case, such tools would be syntax highlighters. There are
lots of syntax highlighting implementations for D, just a few off
the top off my head:
- GitHub
- Code-d
- Kate
- Atom
- Sublime
- Chroma
- Vim
- Emacs
- Notepad++
- ...
They all tend to use their own domain specific language, and I'm
pretty sure most of them are not powerful enough to express
identifier-delimited strings. Here's an example of one if you're
curious what they look like:
https://github.com/alecthomas/chroma/blob/master/lexers/d/d.go
Notice the:
> // TODO support delimited strings
If we don't want D support in syntax highlighters to be
half-baked everywhere, keeping the lexical grammar simple is a
good cause.
I can improve the rationale for this DIP with examples like in
this post, though if you're absolutely adamant that this is a
waste of effort then that won't help obviously.
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.
More information about the Digitalmars-d
mailing list