- From: Bethan Tovey-Walsh <bytheway@linguacelta.com>
- Date: Sat, 29 Aug 2026 12:55:22 +0100
- To: Graydon Saunders <graydonish@fastmail.com>
- Cc: Bethan Tovey-Walsh <bytheway@linguacelta.com>, Norm Tovey-Walsh <norm@saxonica.com>, ixml <public-ixml@w3.org>, Steven Pemberton <steven.pemberton@cwi.nl>
- Message-Id: <81D319C2-5872-4E61-99DE-3EB35731529F@linguacelta.com>
>> But "" is not more or less likely to contain a zero-width space than any other string. > > That has not been the case in my experience. > > And, for whatever reason, people DO use unusual, non-visible Unicode characters inside strings. Granted. But the problem is with the use of those characters, not whether the string appears empty. I would propose that most people who are familiar with programming languages, seeing "" in a grammar, are going to assume they're looking at the empty string. IXML offers a number of ways to clarify. Use hex codes. Add a comment. Define a "zero-width" nonterminal and a "non-breaking" nonterminal and use those instead of the literals. Because you'll always have this problem. Is " " U+00A0 or U+0020? Is "" U+FEFF or U+200B or U+2060 or the empty string? If you're writing a grammar with this kind of character in it, and you're not using one of IXML's very convenient mechanisms to clarify that this isn't the string it probably appears to be to the unprepared reader, that's not a mistake; it's actively hostile grammar design. I don't think we can legislate our way out of the possibility that a grammar author is deliberately obfuscating the grammar. > They might be using an environment (or an editor) where U+FF02 is the default quote mark. Nobody is doing this. Nobody. They couldn't write code in any language if they did. It's okay to dislike "" based on nothing more than vibes. It's important to know if an idea just feels off to a lot of people. But it would make our task of evaluating the proposal much easier to know that this is a vibes-based objection, rather than having to debunk extremely unlikely edge-cases that require people to be using deliberately borked system setups to write deliberately misleading grammars. BTW Sent from my iPhone > On 28 Aug 2026, at 20:26, Graydon Saunders <graydonish@fastmail.com> wrote: > > > On Fri, Aug 28, 2026, at 14:50, Bethan Tovey-Walsh wrote: >> So how can you visually tell the difference between "cat" and "cat"? (That second one also has a zero-width space - U+200B - inside the string). >> >> It sounds to me as though the real problem you're imagining here is people using unusual, non-visible, Unicode characters inside strings, rather than doing the sensible thing and using the hex codes so that the characters are explicitly readable. Anyone doing that is, I hesitantly propose, a bit of an idiot. But "" is not more or less likely to contain a zero-width space than any other string. > > That has not been the case in my experience. > > And, for whatever reason, people DO use unusual, non-visible Unicode characters inside strings. (Often because they want to influence hyphenation mechanisms or where the line breaks do or don't go in longer titles. Less often but memorably because they were using a these-chars-are-specific-tabs table formatting mechanism from ancient times. I'm sure I don't know all the reasons someone might do this.) And yes when you want the grammar to recognize these characters it is much better to write out the hex codes but that's also true of other mechanisms and I would not want to claim that people uniformly do so there. > >> And if you write "cat"with fullwidth spaces (U+FF02), you'll get an error trying to read the grammar, since they're not valid string delimiters. Anyone doing that is a total idiot, and I feel zero hesitation in saying so. > They might be using an environment (or an editor) where U+FF02 is the default quote mark. > > Probably not, or at least probably not yet, but the possibility exists. People make mistakes. It's better if the mistake results in an immediate intelligible complaint from the mechanism rather than unexpected subtle differences of outcomes, so this case where the grammar gives an error is to my mind much better than a case where the grammar does (by user expectation) a weird thing. > > -- Graydon
Received on Saturday, 29 August 2026 11:56:01 UTC