Hey, recently I posted a suggestion (DIP) for adding indentation-aware multi-line strings to the D language, but another idea has also occurred to me a few times, and I'll share it in this separate thread to keep things clean.
While it is possible to use D's string delimiting syntax to mark raw ("WYSIWYG") strings as being different types of strings implicitly, it seems like having official attributes for strings of common programming languages would increase the chances of tighter integration of syntax highlighting for other programming languages within strings.
Thus, instead of something like:
string s = q"HTML
<ul>
<li>Item 1</li>
</ul>
HTML";
... perhaps official attributes would be better to express intent unambiguously, like so:
string s = @lang(HTML) `
<ul>
<li>Item 1</li>
</ul>
`;
This would increase the odds of this approach becoming effective eventually in 3rd party software.
The problem with using special delimited strings for this is that there is no actual unambiguous intent to actually use the string as containing that language from the standpoint of 3rd party tools (it could just be a coincidence), whereas an official attribute that can be filled with the official commonly used language in use would be less ambiguous.
Meanwhile, users could still use the special delimited raw strings for uncommon languages or for setting up syntax scanning for languages that they themselves have made such as markup for their own data files.
Admittedly, 3rd party tooling even just for D itself is already not the best for things like IDE features and syntax, but that is no reason to not do this. Anything that helps the prospects is worth doing and things should be done on principle.
This idea is not that important to me, but I just wanted to put it out there anyway.