Skip to content

Commit 2889640

Browse files
committed
docs(echo-types): record canonical operation names + runtime strategy
Capture the deferred-operation decisions so the future implementer has the canonical mapping (no code behaviour change): - Canonical builtin names mirror EchoTypes.jl for cross-repo consistency: echo(x, y), echo_input(e), echo_output(e), echo_to_residue(e), residue_strictly_loses(e); plus the sample_echo/bet_echo bridge. Shorter aliases may follow, but canonical names preserve the conceptual mapping. - Runtime: start with a single-witness core (not whole-fibre — that needs first-class functions and waits); echo_to_residue erasure should carry a stability penalty in Error-Lang, not a free coercion; add a runtime residue payload only when an operation demands it (Echo T / EchoR T stay ghost/erased meanwhile, while the checker keeps them distinct). https://claude.ai/code/session_01NGKc4681nuptfQADqreAfc
1 parent 5d32b71 commit 2889640

1 file changed

Lines changed: 36 additions & 5 deletions

File tree

docs/echo-types.adoc

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,44 @@ sample_echo : Dist T -> Echo T // retains that residue (DEFERRED)
8585

8686
== Deferred (next passes)
8787

88-
* Introduction/elimination forms: `echo_intro : T -> Echo T`,
89-
`proj₁ : Echo T -> T`, `echo_to_residue : Echo T -> EchoR T`.
90-
* The residue-retaining `sample_echo` / `bet_echo` operations and their
91-
typing rules.
88+
=== Canonical operation names (deferred)
89+
90+
When the echo operations land, their *canonical* names mirror
91+
`EchoTypes.jl` for cross-repo conceptual consistency (shorter aliases may
92+
be added later, but the canonical names preserve the mapping):
93+
94+
[cols="2,3"]
95+
|===
96+
| Builtin | Meaning
97+
98+
| `echo(x, y)` | Introduce an echo (the witness core, `echo-intro`).
99+
| `echo_input(e)` | Project the retained input/source witness (`proj₁`).
100+
| `echo_output(e)` | Project the visible output/base value.
101+
| `echo_to_residue(e)` | Lower a full echo to its residue (`Echo T -> EchoR T`).
102+
| `residue_strictly_loses(e)` | The strict-weakening witness: the residue is non-recoverable.
103+
|===
104+
105+
The probabilistic bridge adds `sample_echo : Dist T -> Echo T` (and
106+
`bet_echo`), retaining the draw/branch residue that `sample`/`bet` discard.
107+
108+
=== Runtime representation strategy (deferred)
109+
110+
* Start with a **single-witness core**, not a whole-fibre representation.
111+
Whole-fibre runtime requires first-class functions and must wait.
112+
* Erasing an `Echo` down to its residue (`echo_to_residue`) should incur a
113+
**stability penalty in Error-Lang** (the Landauer/Bennett-style cost of
114+
discarding retained lineage) — not a silent, free coercion.
115+
* Add a runtime residue payload only when an operation requires it; until
116+
then `Echo T` / `EchoR T` stay ghost/erased (codegen represents them as
117+
`T`) while the checker keeps them distinct.
118+
119+
=== Still to do
120+
121+
* Introduction/elimination + residue forms (canonical names above) and
122+
their typing rules.
123+
* The `sample_echo` / `bet_echo` operations and their typing rules.
92124
* Lean typing rules + metatheory for the echo operations once the runtime
93125
residue representation is settled.
94-
* Runtime residue payload (only when an operation requires it).
95126

96127
== References
97128

0 commit comments

Comments
 (0)