Skip to content

Commit 0cf9c87

Browse files
committed
docs: the ISC language reference (IS-1 v2) — the normative page + docs-index link
1 parent 7fa39a6 commit 0cf9c87

2 files changed

Lines changed: 103 additions & 1 deletion

File tree

‎src/pages/docs/index.astro‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const docs = renderAsciiDocDir("src/content/docs")
2020
<h2>Getting started</h2>
2121
<p>
2222
Interscript runs in Ruby, TypeScript, and Python. All consume the
23-
same authority-backed maps. An optional <a href="/docs/phonological-layer">phonological layer</a> (secryst crystals + the interscript-ml contract) recovers vowels
23+
same authority-backed maps. An optional <a href="/docs/isc-language">the ISC language reference</a> (secryst crystals + the interscript-ml contract) recovers vowels
2424
and phonemes when a map needs vocalized input.
2525
</p>
2626
<div class="runtime-tiles">

‎src/pages/docs/isc-language.astro‎

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
import Base from "../../layouts/Base.astro"
3+
4+
const docStructure = `system "AUTHORITY:lang-SrcScript:DstScript:year" {
5+
metadata {
6+
authority_id odni
7+
id 2004
8+
language iso-639-3:prs
9+
source_script Arab
10+
destination_script Latn
11+
}
12+
stage main {
13+
parallel {
14+
sub "ئ" ""
15+
}
16+
}
17+
tests { "input" -> "expected" }
18+
}`
19+
20+
const rules = `sub { from "a" + any("bc") to "X" before "d" after boundary }
21+
maybe("h") // zero-or-one, participates in longest-match
22+
capture("a") + "b" // captured; ref(1) substitutes it in the target
23+
any("0" .. "9") // inclusive codepoint range
24+
any_character // any single character`
25+
26+
const aliases = `aliases { vowel = any("aeiou") }
27+
stage main { parallel { sub { from "b" + vowel + "t" to "X" } } }`
28+
29+
const run = `run stage.main // this document
30+
run map.dep.stage.main // a declared dependency
31+
32+
downcase // stage-level stdlib directives run at their
33+
upcase // rule position on the whole string
34+
title_case
35+
compose / decompose
36+
separate / unseparate`
37+
38+
const casing = `sub { from "ة" to upcase } // uppercases the matched text only`
39+
40+
const tests = `tests { "input" -> "expected" }`
41+
---
42+
43+
<Base
44+
title="The ISC Language — Interscript"
45+
description="The normative reference for ISC, the declarative specification language for script conversion (IS-1 v2)."
46+
>
47+
<h1 class="mb-6 text-3xl font-bold">The ISC Language</h1>
48+
<div class="prose">
49+
<p>
50+
ISC (Interscript Specification Code) is the declarative language for
51+
script conversion. A <code>.isc</code> file denotes exactly one
52+
conversion function; every runtime computes the same object. This is
53+
the normative language reference (IS-1 v2 — the executable form is
54+
the 22-vector suite in interscript-ruby).
55+
</p>
56+
57+
<h2>Document structure</h2>
58+
<pre><code>{docStructure}</code></pre>
59+
60+
<h2>Stages</h2>
61+
<p><code>sequence</code> executes rules in order. <code>parallel</code> is
62+
single-pass longest-match — the longest applicable rule wins at each
63+
position; duplicate rules resolve last-declared-wins.</p>
64+
65+
<h2>Rules and contexts</h2>
66+
<pre><code>{rules}</code></pre>
67+
<p><code>before</code>/<code>after</code> are zero-width
68+
lookbehind/lookahead. <code>boundary</code> is a zero-width word edge.
69+
<code>not_before</code>/<code>not_after</code> negate.
70+
<strong>There is no alternation operator</strong> — alternatives are
71+
separate rules.</p>
72+
73+
<h2>Aliases</h2>
74+
<pre><code>{aliases}</code></pre>
75+
<p>Aliases bind named item expressions at parse time and are usable in
76+
both from and to positions.</p>
77+
78+
<h2>Stages calling stages; stdlib directives</h2>
79+
<pre><code>{run}</code></pre>
80+
<p><code>run</code> takes no other form — stray identifiers are a
81+
parse error (a typo'd map fails loudly). The <code>rababa</code>
82+
directive invokes the ML adapter with mandatory keyword arguments;
83+
an unprovisioned model raises a named error enumerating known ids.</p>
84+
85+
<h2>Casing targets</h2>
86+
<pre><code>{casing}</code></pre>
87+
88+
<h2>Embedded tests</h2>
89+
<pre><code>{tests}</code></pre>
90+
<p>Normative data on the document — executed by the verification layer
91+
(the conformance runner), never by <code>transliterate</code>.</p>
92+
93+
<h2>The strict parse</h2>
94+
<p>The corpus is strict-parse-clean: stray identifiers and undeclared
95+
constructs are parse errors. A typo'd map fails loudly.</p>
96+
97+
<h2>Normative reference</h2>
98+
<p>The full specification (IS-1 v2) with the 22 frozen rulings and the
99+
cross-runtime guarantee lives in
100+
<a href="https://github.com/interscript/interscript-models/blob/main/docs/IS-1-v2.md">interscript-models/docs/IS-1-v2.md</a>.</p>
101+
</div>
102+
</Base>

0 commit comments

Comments
 (0)