aboutsummaryrefslogtreecommitdiffstats
path: root/research/experiments
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-19 02:12:51 +0100
committereunhhu <[email protected]>2026-10-19 02:12:51 +0100
commitf12346827a136536c5e8e9c6af3da842bd5cc0c3 (patch)
treedaefcb538d7d24995122e90439a7302c3738573f /research/experiments
parent81be688cc6fdfa52633b936a9b8793782b6f5acf (diff)
downloadpure-f12346827a136536c5e8e9c6af3da842bd5cc0c3.tar.gz
pure-f12346827a136536c5e8e9c6af3da842bd5cc0c3.zip
140 after 027: the ten probes compiled again (run.sh writing to a temporary directory: 10-13's -o /dev/null made a compiled probe say Permission denied): three compile as written, the other seven's diagnostics now mostly naming the form, so the same needs written in 027's forms (probes-027/): a byte an i64, bits on i64s, a record holding itself through a list, a recursive fn in a handler with its result type, a character by for and char, a variant in a list's item all compile; three gaps left, each a change of the core: a view calling a recursive fn or a fn with a block, a record or a variant as a state by itself, a character at a cursor; the suite table's column after 027 (2 and 4 written, 6 and 7 work, the first needs of 1, 3, 5 and 9 compiling, 8's layout as a view blocked by the first gap)
Diffstat (limited to 'research/experiments')
-rw-r--r--research/experiments/044-specs/2026-10-19-probes-027.tsv9
-rw-r--r--research/experiments/044-specs/2026-10-19-probes.tsv10
-rw-r--r--research/experiments/044-specs/probes-027/p1-byte.aup5
-rw-r--r--research/experiments/044-specs/probes-027/p2-bits.aup5
-rw-r--r--research/experiments/044-specs/probes-027/p3-nested.aup5
-rw-r--r--research/experiments/044-specs/probes-027/p4-rec.aup6
-rw-r--r--research/experiments/044-specs/probes-027/p4b-rec-view.aup2
-rw-r--r--research/experiments/044-specs/probes-027/p5b-chars.aup8
-rw-r--r--research/experiments/044-specs/probes-027/p6-variant.aup8
-rw-r--r--research/experiments/044-specs/probes-027/p6b-variant-field.aup11
-rw-r--r--research/experiments/044-specs/probes-027/p7-record-state.aup5
-rwxr-xr-xresearch/experiments/044-specs/run.sh12
12 files changed, 83 insertions, 3 deletions
diff --git a/research/experiments/044-specs/2026-10-19-probes-027.tsv b/research/experiments/044-specs/2026-10-19-probes-027.tsv
new file mode 100644
index 0000000..3163d34
--- /dev/null
+++ b/research/experiments/044-specs/2026-10-19-probes-027.tsv
@@ -0,0 +1,9 @@
+p1-byte.aup compiles
+p2-bits.aup compiles
+p3-nested.aup compiles
+p4-rec.aup compiles
+p4b-rec-view.aup p4b-rec-view.aup:2:10: a view calls no fn with a block, nor one that calls itself: handlers do ('depth')
+p5b-chars.aup compiles
+p6-variant.aup p6-variant.aup:8:10: state types are numbers, bools, i64, text, cursor or mark in a text, list of a record and index of a list
+p6b-variant-field.aup compiles
+p7-record-state.aup p7-record-state.aup:5:11: state types are numbers, bools, i64, text, cursor or mark in a text, list of a record and index of a list
diff --git a/research/experiments/044-specs/2026-10-19-probes.tsv b/research/experiments/044-specs/2026-10-19-probes.tsv
new file mode 100644
index 0000000..3bfd43b
--- /dev/null
+++ b/research/experiments/044-specs/2026-10-19-probes.tsv
@@ -0,0 +1,10 @@
+p1-byte.aup p1-byte.aup:4:22: expected a number, not an i64
+p2-bits.aup p2-bits.aup:4:8: bit operations take i64s, not numbers: convert, as in i64(x)
+p2b-bits.aup compiles
+p3-nested.aup p3-nested.aup:2:10: expected a numeric field default
+p3b-nested.aup compiles
+p4-rec.aup p4-rec.aup:2:10: a view calls no fn with a block, nor one that calls itself: handlers do ('depth')
+p5-chars.aup compiles
+p5b-chars.aup p5b-chars.aup:4:17: a text is read by position through its bytes, as in bytes(t)[i]
+p5c-cursor.aup p5c-cursor.aup:6:12: unknown library 'note'; write use note first
+p6-variant.aup p6-variant.aup:2:10: state types are numbers, bools, i64, text, cursor or mark in a text, list of a record and index of a list
diff --git a/research/experiments/044-specs/probes-027/p1-byte.aup b/research/experiments/044-specs/probes-027/p1-byte.aup
new file mode 100644
index 0000000..678c51d
--- /dev/null
+++ b/research/experiments/044-specs/probes-027/p1-byte.aup
@@ -0,0 +1,5 @@
+state first: i64
+input packet = message { data: bytes }
+on packet {
+ first = packet.data[0]
+}
diff --git a/research/experiments/044-specs/probes-027/p2-bits.aup b/research/experiments/044-specs/probes-027/p2-bits.aup
new file mode 100644
index 0000000..1e3fdca
--- /dev/null
+++ b/research/experiments/044-specs/probes-027/p2-bits.aup
@@ -0,0 +1,5 @@
+state h: i64
+input word = message { w: i64 }
+on word {
+ h = (h ^ word.w) << 3
+}
diff --git a/research/experiments/044-specs/probes-027/p3-nested.aup b/research/experiments/044-specs/probes-027/p3-nested.aup
new file mode 100644
index 0000000..0eb26eb
--- /dev/null
+++ b/research/experiments/044-specs/probes-027/p3-nested.aup
@@ -0,0 +1,5 @@
+record Node {
+ name: text
+ children: list of Node
+}
+state root: list of Node
diff --git a/research/experiments/044-specs/probes-027/p4-rec.aup b/research/experiments/044-specs/probes-027/p4-rec.aup
new file mode 100644
index 0000000..a725d81
--- /dev/null
+++ b/research/experiments/044-specs/probes-027/p4-rec.aup
@@ -0,0 +1,6 @@
+fn depth(n) -> number = if n == 0 { 0 } else { 1 + depth(n - 1) }
+state d = 0
+input go = key Space
+on go.down {
+ d = depth(3)
+}
diff --git a/research/experiments/044-specs/probes-027/p4b-rec-view.aup b/research/experiments/044-specs/probes-027/p4b-rec-view.aup
new file mode 100644
index 0000000..05dbca1
--- /dev/null
+++ b/research/experiments/044-specs/probes-027/p4b-rec-view.aup
@@ -0,0 +1,2 @@
+fn depth(n) -> number = if n == 0 { 0 } else { 1 + depth(n - 1) }
+view d = depth(3)
diff --git a/research/experiments/044-specs/probes-027/p5b-chars.aup b/research/experiments/044-specs/probes-027/p5b-chars.aup
new file mode 100644
index 0000000..e81dafd
--- /dev/null
+++ b/research/experiments/044-specs/probes-027/p5b-chars.aup
@@ -0,0 +1,8 @@
+state first: text
+input line = message { t: text }
+on line {
+ for c in line.t {
+ first = char(c)
+ break
+ }
+}
diff --git a/research/experiments/044-specs/probes-027/p6-variant.aup b/research/experiments/044-specs/probes-027/p6-variant.aup
new file mode 100644
index 0000000..606b698
--- /dev/null
+++ b/research/experiments/044-specs/probes-027/p6-variant.aup
@@ -0,0 +1,8 @@
+record Leaf {
+ v = 0
+}
+variant X {
+ leaf(Leaf)
+ word(text)
+}
+state x: X
diff --git a/research/experiments/044-specs/probes-027/p6b-variant-field.aup b/research/experiments/044-specs/probes-027/p6b-variant-field.aup
new file mode 100644
index 0000000..2b1504a
--- /dev/null
+++ b/research/experiments/044-specs/probes-027/p6b-variant-field.aup
@@ -0,0 +1,11 @@
+record Leaf {
+ v = 0
+}
+variant X {
+ leaf(Leaf)
+ word(text)
+}
+record Holder {
+ x: X
+}
+state xs: list of Holder
diff --git a/research/experiments/044-specs/probes-027/p7-record-state.aup b/research/experiments/044-specs/probes-027/p7-record-state.aup
new file mode 100644
index 0000000..ff339d2
--- /dev/null
+++ b/research/experiments/044-specs/probes-027/p7-record-state.aup
@@ -0,0 +1,5 @@
+record Point {
+ x = 0
+ y = 0
+}
+state at: Point
diff --git a/research/experiments/044-specs/run.sh b/research/experiments/044-specs/run.sh
index 670d0a7..81de578 100755
--- a/research/experiments/044-specs/run.sh
+++ b/research/experiments/044-specs/run.sh
@@ -3,11 +3,17 @@
# the first thing a spec in the suite needs (a byte at a position, a bit
# operation, a record inside a record, a call to itself, a variant, a
# character at a position). AUP is the aup checkout (default ../aup beside
-# Pure); the output is the evidence table in 140.
+# Pure); the output is the evidence table in 140. The probes are as written on
+# 2026-10-13 (probes/), or a directory given (probes-027/: the same needs in
+# the forms 027 gave them, and the gaps found after it).
set -u
here=$(cd "$(dirname "$0")" && pwd)
aup=${AUP:-$here/../../../../aup}/build/aup
-for f in "$here"/probes/*.aup; do
+dir=${1:-$here/probes}
+dir=$(cd "$dir" && pwd)
+out=$(mktemp -d)
+trap 'rm -rf "$out"' EXIT
+for f in "$dir"/*.aup; do
printf '%s\t' "$(basename "$f")"
- if out=$("$aup" build "$f" -o /dev/null 2>&1); then echo "compiles"; else echo "$out" | head -1 | sed "s|^$here/probes/||"; fi
+ if said=$("$aup" build "$f" -o "$out/probe.pmod" 2>&1); then echo "compiles"; else echo "$said" | head -1 | sed "s|^$dir/||"; fi
done