From 0cf9c874fbe78e9fde60567aa345620b01ee7133 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Tue, 27 Oct 2026 10:26:39 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20the=20ISC=20language=20reference=20(IS-?= =?UTF-8?q?1=20v2)=20=E2=80=94=20the=20normative=20page=20+=20docs-index?= =?UTF-8?q?=20link?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/docs/index.astro | 2 +- src/pages/docs/isc-language.astro | 102 ++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 src/pages/docs/isc-language.astro diff --git a/src/pages/docs/index.astro b/src/pages/docs/index.astro index 8c73a3b..fbb4327 100644 --- a/src/pages/docs/index.astro +++ b/src/pages/docs/index.astro @@ -20,7 +20,7 @@ const docs = renderAsciiDocDir("src/content/docs")

Getting started

Interscript runs in Ruby, TypeScript, and Python. All consume the - same authority-backed maps. An optional phonological layer (secryst crystals + the interscript-ml contract) recovers vowels + same authority-backed maps. An optional the ISC language reference (secryst crystals + the interscript-ml contract) recovers vowels and phonemes when a map needs vocalized input.

diff --git a/src/pages/docs/isc-language.astro b/src/pages/docs/isc-language.astro new file mode 100644 index 0000000..bc7165c --- /dev/null +++ b/src/pages/docs/isc-language.astro @@ -0,0 +1,102 @@ +--- +import Base from "../../layouts/Base.astro" + +const docStructure = `system "AUTHORITY:lang-SrcScript:DstScript:year" { + metadata { + authority_id odni + id 2004 + language iso-639-3:prs + source_script Arab + destination_script Latn + } + stage main { + parallel { + sub "ئ" "" + } + } + tests { "input" -> "expected" } +}` + +const rules = `sub { from "a" + any("bc") to "X" before "d" after boundary } +maybe("h") // zero-or-one, participates in longest-match +capture("a") + "b" // captured; ref(1) substitutes it in the target +any("0" .. "9") // inclusive codepoint range +any_character // any single character` + +const aliases = `aliases { vowel = any("aeiou") } +stage main { parallel { sub { from "b" + vowel + "t" to "X" } } }` + +const run = `run stage.main // this document +run map.dep.stage.main // a declared dependency + +downcase // stage-level stdlib directives run at their +upcase // rule position on the whole string +title_case +compose / decompose +separate / unseparate` + +const casing = `sub { from "ة" to upcase } // uppercases the matched text only` + +const tests = `tests { "input" -> "expected" }` +--- + + +

The ISC Language

+
+

+ ISC (Interscript Specification Code) is the declarative language for + script conversion. A .isc file denotes exactly one + conversion function; every runtime computes the same object. This is + the normative language reference (IS-1 v2 — the executable form is + the 22-vector suite in interscript-ruby). +

+ +

Document structure

+
{docStructure}
+ +

Stages

+

sequence executes rules in order. parallel is + single-pass longest-match — the longest applicable rule wins at each + position; duplicate rules resolve last-declared-wins.

+ +

Rules and contexts

+
{rules}
+

before/after are zero-width + lookbehind/lookahead. boundary is a zero-width word edge. + not_before/not_after negate. + There is no alternation operator — alternatives are + separate rules.

+ +

Aliases

+
{aliases}
+

Aliases bind named item expressions at parse time and are usable in + both from and to positions.

+ +

Stages calling stages; stdlib directives

+
{run}
+

run takes no other form — stray identifiers are a + parse error (a typo'd map fails loudly). The rababa + directive invokes the ML adapter with mandatory keyword arguments; + an unprovisioned model raises a named error enumerating known ids.

+ +

Casing targets

+
{casing}
+ +

Embedded tests

+
{tests}
+

Normative data on the document — executed by the verification layer + (the conformance runner), never by transliterate.

+ +

The strict parse

+

The corpus is strict-parse-clean: stray identifiers and undeclared + constructs are parse errors. A typo'd map fails loudly.

+ +

Normative reference

+

The full specification (IS-1 v2) with the 22 frozen rulings and the + cross-runtime guarantee lives in + interscript-models/docs/IS-1-v2.md.

+
+