From 6d677df51faa120a91c44d5f069a0e51f4212727 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Tue, 13 Oct 2026 04:29:52 +0100 Subject: Research 140: a suite of eleven specs from different fields (DNS, SHA-256, inflate, JSON, UTF-8 and line breaking, relational queries and graphs, text editing, box layout, HTTP/1.1 by packets, retries and timeouts, constant-time crypto) with five criteria (written in aup and Pure alone, no workaround, lines against a Python reference, time against C, the spec's own vectors passing in Pure's checks on three machines); ten probes (044) show today's aup stops at a byte by position, bit operations, nesting, recursion, variants and reading a character; the core's minimal candidates and the rule against piling up (only what two specs need); SHA-256 and JSON first --- research/experiments/044-specs/probes/p1-byte.aup | 5 +++++ research/experiments/044-specs/probes/p2-bits.aup | 5 +++++ research/experiments/044-specs/probes/p2b-bits.aup | 5 +++++ research/experiments/044-specs/probes/p3-nested.aup | 5 +++++ research/experiments/044-specs/probes/p3b-nested.aup | 8 ++++++++ research/experiments/044-specs/probes/p4-rec.aup | 2 ++ research/experiments/044-specs/probes/p5-chars.aup | 7 +++++++ research/experiments/044-specs/probes/p5b-chars.aup | 5 +++++ research/experiments/044-specs/probes/p5c-cursor.aup | 7 +++++++ research/experiments/044-specs/probes/p6-variant.aup | 2 ++ 10 files changed, 51 insertions(+) create mode 100644 research/experiments/044-specs/probes/p1-byte.aup create mode 100644 research/experiments/044-specs/probes/p2-bits.aup create mode 100644 research/experiments/044-specs/probes/p2b-bits.aup create mode 100644 research/experiments/044-specs/probes/p3-nested.aup create mode 100644 research/experiments/044-specs/probes/p3b-nested.aup create mode 100644 research/experiments/044-specs/probes/p4-rec.aup create mode 100644 research/experiments/044-specs/probes/p5-chars.aup create mode 100644 research/experiments/044-specs/probes/p5b-chars.aup create mode 100644 research/experiments/044-specs/probes/p5c-cursor.aup create mode 100644 research/experiments/044-specs/probes/p6-variant.aup (limited to 'research/experiments/044-specs/probes') diff --git a/research/experiments/044-specs/probes/p1-byte.aup b/research/experiments/044-specs/probes/p1-byte.aup new file mode 100644 index 0000000..0a5ad6e --- /dev/null +++ b/research/experiments/044-specs/probes/p1-byte.aup @@ -0,0 +1,5 @@ +state first = 0 +input packet = message { data: bytes } +on packet { + first = packet.data[0] +} diff --git a/research/experiments/044-specs/probes/p2-bits.aup b/research/experiments/044-specs/probes/p2-bits.aup new file mode 100644 index 0000000..569825f --- /dev/null +++ b/research/experiments/044-specs/probes/p2-bits.aup @@ -0,0 +1,5 @@ +state h = 0 +input word = message { w: u32 } +on word { + h = (h ^ word.w) << 3 +} diff --git a/research/experiments/044-specs/probes/p2b-bits.aup b/research/experiments/044-specs/probes/p2b-bits.aup new file mode 100644 index 0000000..e432668 --- /dev/null +++ b/research/experiments/044-specs/probes/p2b-bits.aup @@ -0,0 +1,5 @@ +state h: i64 = 0 +input word = message { w: i64 } +on word { + h = h & word.w +} diff --git a/research/experiments/044-specs/probes/p3-nested.aup b/research/experiments/044-specs/probes/p3-nested.aup new file mode 100644 index 0000000..c80a343 --- /dev/null +++ b/research/experiments/044-specs/probes/p3-nested.aup @@ -0,0 +1,5 @@ +record Node { + name = "" + children: list of Node +} +state root: list of Node diff --git a/research/experiments/044-specs/probes/p3b-nested.aup b/research/experiments/044-specs/probes/p3b-nested.aup new file mode 100644 index 0000000..105da0a --- /dev/null +++ b/research/experiments/044-specs/probes/p3b-nested.aup @@ -0,0 +1,8 @@ +record Point { + x = 0 + y = 0 +} +record Box { + at: Point +} +state boxes: list of Box diff --git a/research/experiments/044-specs/probes/p4-rec.aup b/research/experiments/044-specs/probes/p4-rec.aup new file mode 100644 index 0000000..753eaff --- /dev/null +++ b/research/experiments/044-specs/probes/p4-rec.aup @@ -0,0 +1,2 @@ +fn depth(n) = if n == 0 { 0 } else { 1 + depth(n - 1) } +view d = depth(3) diff --git a/research/experiments/044-specs/probes/p5-chars.aup b/research/experiments/044-specs/probes/p5-chars.aup new file mode 100644 index 0000000..95f5c6b --- /dev/null +++ b/research/experiments/044-specs/probes/p5-chars.aup @@ -0,0 +1,7 @@ +state count = 0 +input line = message { t: text } +on line { + for c in line.t { + count = count + 1 + } +} diff --git a/research/experiments/044-specs/probes/p5b-chars.aup b/research/experiments/044-specs/probes/p5b-chars.aup new file mode 100644 index 0000000..c5bc23b --- /dev/null +++ b/research/experiments/044-specs/probes/p5b-chars.aup @@ -0,0 +1,5 @@ +state first: text +input line = message { t: text } +on line { + first = line.t[0] +} diff --git a/research/experiments/044-specs/probes/p5c-cursor.aup b/research/experiments/044-specs/probes/p5c-cursor.aup new file mode 100644 index 0000000..97a73f9 --- /dev/null +++ b/research/experiments/044-specs/probes/p5c-cursor.aup @@ -0,0 +1,7 @@ +state note: text +state at: cursor in note +state c: text +input next = key ArrowRight +on next.down { + c = note.char(at) +} diff --git a/research/experiments/044-specs/probes/p6-variant.aup b/research/experiments/044-specs/probes/p6-variant.aup new file mode 100644 index 0000000..35f12fc --- /dev/null +++ b/research/experiments/044-specs/probes/p6-variant.aup @@ -0,0 +1,2 @@ +record Leaf { v = 0 } +state x: Leaf | text = "" -- cgit v1.2.3