English

Matchertext: Towards Verbatim Interlanguage Embedding

Programming Languages 2023-01-02 v1

Abstract

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.

Keywords

Cite

@article{arxiv.2212.14129,
  title  = {Matchertext: Towards Verbatim Interlanguage Embedding},
  author = {Bryan Ford},
  journal= {arXiv preprint arXiv:2212.14129},
  year   = {2023}
}

Comments

23 pages, 4 figures, 2 tables

R2 v1 2026-06-28T07:55:29.910Z