Language Policy

Strings & Templates

Canonical grammar, semantics, constraints, and deferred boundaries for Strings & Templates.

Strings are exact Unicode text; tagged templates preserve domain intent and interpolation boundaries as typed values rather than relying on host-language quoting tricks.

Policy

Ordinary double-quoted and triple-quoted strings use {expression} interpolation and the fixed escape set. The adjacent registry tags are p, r, sh, and sql, each over either string form. p carries path normalization intent, r reduced-escaping regex intent, sh shell safety metadata without automatic execution, and sql parameter metadata without direct interpolation text insertion.

Specified behavior

Interpolation evaluates at runtime and uses the standard renderer. A tagged template keeps raw parts, interpolation spans, and tag kind; SQL interpolations become parameters. Triple-quoted content follows exact closing-indent removal. Tag recognition requires no whitespace between tag and delimiter; with whitespace the tag is an ordinary identifier and juxtaposition is not a call.

Constraints and loud decline

Backticks, ${expression}, single-quoted strings, html tags, user-defined tags, unknown adjacent tags, direct SQL interpolation insertion, and claims that an sh template executes are rejected. Tags are not keywords outside adjacency. Regex details beyond the specified reduced-escaping floor and platform-specific path rendering must not be invented in language policy.

Deferred boundary

HTML templates, user tag registration, macro expansion, compile-time template execution, a fully fixed cross-platform regex dialect, shell execution semantics, and broad path/filesystem behavior remain deferred or belong to libraries and host surfaces.

Worked example

TOPAZ
let region = "EMEA"

let report = sql"""
    SELECT name, total
    FROM orders
    WHERE region = {region}
    ORDER BY total DESC
    """