13.4.1 How it works
The observable effects are output, input, capability operations, the failure and the termination. They happen exactly in the order the language's rules prescribe. Effect-free computations may be reordered internally, but never in a noticeable way.
A statement that fails produces no partial effects. Write computes all its expressions before writing anything:
ProgramA Write that never gets to write
Algorithm SinParcial
Define cero As Integer <- 0;
Write "antes";
Write "uno ", 1 Div cero;
EndAlgorithmOutput
antes
Diagnostics
divisionByZero· error · 4:19 · Division by zero
The program finishes with an error.
A tape with three numbered entries: output, file and clock, joined by arrows. Below, the note that they are chained and that replaying gives the same run.
Every effect goes through two phases: requested, when its arguments are computed and it gets a sequence number, and resolved, when the host answers. The result is committed, failed or uncertain; reads are never uncertain.
The tape keeps the run's identity —code, profile, seed, limits— and one entry per effect, chained with a cryptographic digest. On replay everything is checked to match; secret data is stored redacted.
In short
- Effects happen in program order.
- A failing statement leaves no half-done effects.
- Every effect is requested, resolved and noted on the tape.
- The tape allows replaying the run exactly.