Embedding text in one language within text of another is commonplace for numerous purposes, but usually requires tedious and error-prone "escaping" transformations on the embedded string. We propose a simple cross-language syntactic discipline, matchertext, which enables the safe embedding a string in any compliant language into a string in any other language via simple "copy-and-paste" - in particular with no escaping, obfuscation, or expansion of embedded strings. We apply this syntactic discipline to several common and frequently-embedded language syntaxes such as URIs, HTML, and JavaScript, exploring the benefits, costs, and compatibility issues in adopting the proposed matchertext discipline. One early matchertext-based language is MinML, a concise but general alternative syntax for writing HTML or XML.
翻译:在另一文本中以一种语言嵌入文本,对于许多目的都是常见的,但通常需要在嵌入的字符串上进行乏味和易出错的“避免”变换。 我们建议采用简单的跨语言合成纪律、匹配文本,这样可以安全地通过简单的“复制和粘附”将任何兼容语言中的字符串嵌入任何其他语言的字符串中 — — 特别是不能逃避、混淆或扩展嵌入字符串。 我们对一些常见和经常被编入的语言词典,例如 URIs、 HTML 和 JavaScript, 探索采用拟议的匹配文本纪律的好处、成本和兼容性问题。 早期的匹配文本语言是 MinML, 这是写 HTML 或 XML 的一种简洁但通用的词典。