论文标题
火柴文化:迈向逐字介绍嵌入
Matchertext: Towards Verbatim Interlanguage Embedding
论文作者
论文摘要
对于多种目的,将文本嵌入另一种语言中是很常见的,但通常需要在嵌入式字符串上进行乏味且容易出错的“逃脱”转换。我们提出了一个简单的跨语法句法,Matchertext,它可以通过简单的“复制和paste”中的任何合规语言将字符串嵌入任何其他语言的字符串中 - 尤其是嵌入式字符串的不逃脱,混淆或扩展。我们将此句法学科应用于几种常见和经常被插入的语言语法,例如URIS,HTML和JavaScript,探讨了采用拟议的MatcherText学科时的收益,成本和兼容性问题。一种基于Matchertext的早期语言是MINML,这是一种简洁但通用的替代语法,用于编写HTML或XML。
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.