Synchronous reactive languages: Esterel and Céu (Esterel, Céu, HipHop.js)
The imperative synchronous languages: programs are sequential threads of control that await events, run in parallel with ||/par, and are killed lexically by abort/watching, all under the hypothesis that a reaction takes zero logical time.
| Field | Value |
|---|---|
| Language | Esterel (standalone, compiled to C or circuits); Céu (compiled to C via a Lua compiler); HipHop.js (a JavaScript DSL) |
| License | Céu: MIT (LICENSE); Esterel v5: academic distribution (INRIA / Ecole des Mines); HipHop.js: license file present, GitHub reports NOASSERTION |
| Repository | ceu-lang/ceu (surveyed at 5e0c8d3, 2019-07-17); manuel-serrano/hiphop (at 7236e0a, 2026-11-20); atmos-lang/atmos (Céu's successor, at a06998a) |
| Documentation | Esterel v5 Language Primer (v5.91, 2000-06-05); Céu manual v0.30; HipHop.js docs at hop.inria.fr/hiphop (unreachable) |
| Category | Imperative synchronous language: control-flow reactivity, not dataflow |
| Versions surveyed | Esterel v5.91; Céu v0.30 (manual) at the repository head; HipHop.js at master |
| Core abstraction | The instant (Esterel) / reaction chain (Céu): one atomic, run-to-completion step of all awakened trails in response to one input event |
NOTE
This page covers the imperative synchronous family. The dataflow synchronous languages (Lustre, Signal, Lucid Synchrone) belong to the same school but match the signal/FRP deep-dives (Sodium, Elm) more closely. They are not surveyed here.
Overview
What it solves
The worked pipeline in this survey is a control problem, not a data problem: wait for a keystroke, wait some milliseconds unless another keystroke comes first, run a job unless another keystroke or a toggle kills it. Dataflow libraries (RxJS, Kotlin Flow) express this as an operator chain (debounceTime → switchMap). Synchronous languages express it as a program text whose lexical structure is the state machine. Berry's ABRO example is the canonical demonstration. The specification "emit O as soon as A and B have occurred; reset each time R occurs" compiles to an automaton whose states grow as 2ⁿ in the number of awaited signals, yet the program stays three lines (primer §3.1.3):
module ABRO:
input A, B, R;
output O;
loop
[ await A || await B ];
emit O
each R
end moduleThe primer calls Mealy machines "in no way good programs" and names the five ingredients of the Esterel version: "delay, signal emission, sequencing, concurrency, and abortion". The worked pipeline uses exactly these five.
Design philosophy
The synchronous hypothesis (Berry's perfect synchrony) says that a program reacts to an input event in zero logical time, so its outputs belong to the same instant as the input (primer §3.1.1):
"the output part of an event occurs at the same logical time as the input: only bookkeeping actions are performed in a reaction, and such actions should not consume logical input time. This model is called the perfectly synchronous or zero delay model."
Céu restates it for software trails (synchronous_execution_model.md):
"The synchronous execution model of Céu is based on the hypothesis that reaction chains run infinitely faster in comparison to the rate of input events. … In practice, if a new input event occurs while a reaction chain is running (step 2), it is enqueued to run in the next reaction."
Determinism is the second axiom. Esterel's primer states that "reactivity and determinism are the minimal requirements a program should obey" (§5.1.1). Céu gets determinism by scheduling trails in source order: "When multiple trails are active at a logical time … Céu schedules them in the order they appear in the program text. This policy is arbitrary, but provides a priority scheme for trails, and also ensures deterministic and reproducible execution" (synchronous_execution_model.md).
Céu calls its own position Structured Synchronous Reactive Programming (overview): "Reactive: code executes in reactions to events. Structured: code uses structured control-flow mechanisms, such as spawn and await … Synchronous: event reactions run atomically and to completion on each line of execution." This makes Céu the synchronous-language sibling of the structured coroutines surveyed elsewhere.
How it works
Esterel: signals, instants, preemption
An Esterel program reacts in discrete instants. In each instant, every signal is either present or absent ("a signal is present if and only if it is emitted", §5.1.1), and a valued signal S exposes its value as ?S. The kernel statements are:
| Statement | Meaning (primer section) |
|---|---|
emit S / emit S(v) | Make S present in the current instant, broadcast to all threads |
present S then p else q end | Test S in the current instant |
await S / await immediate S | Pause until a later instant where S is present (the immediate form also accepts the current instant); await 3 Meter counts occurrences (§4.7.9) |
p ‖ q (written ||) | Synchronous parallel; terminates when both branches do |
abort p when S | Strong preemption: "the body does not receive the control at abortion time" (§4.7.10) |
weak abort p when S | Weak preemption: "the body receives the control for a last time at abortion time … (p has rights to its 'last wills')" (§4.7.10) |
suspend p when S | Freeze p in each instant where S is present: "Abortion violently preempts … like ^C … Suspension has a milder action, like ^Z" (§4.7.12) |
loop p each S, every S do p | Restart p on every S. every S do p end "is actually not a primitive statement, but an abbreviation for" await S; loop abort p; halt when S end loop (§3.6) |
exec T(...) return R | Run an external task asynchronously; R is its return signal (§4.7.17) |
Because signal status is decided within an instant, a program can contradict itself. present O else emit O end is non-reactive (no consistent status for O), and present O then emit O end is non-deterministic (two consistent statuses). The compiler rejects both through constructive causality analysis (primer ch. 5): a program is accepted only if every signal status can be derived by forward propagation of facts, never by guessing. This compile-time causality check has no counterpart in any library-level reactive system in this survey. It is the price of instantaneous broadcast with same-instant reaction to absence.
Céu: trails, reaction chains, lexical abortion
Céu removes Esterel's same-instant absence test and the causality problem that comes with it. An await only wakes on a future occurrence. Internal emit is a stack-based nested reaction (internal_reactions.md), not a fixpoint. The execution model has four steps (synchronous_execution_model.md):
- The boot reaction starts the program in a single trail.
- "Active trails, one after another, execute until they await or terminate. This step is named a reaction chain, and always runs in bounded time."
- The program goes idle.
- "On the occurrence of a new input event, all trails awaiting that event awake." Then go to step 2.
Parallel composition supports "awaiting in parallel, rather than executing in parallel" (parallel_compositions_and_abortion.md). There are three rejoin policies: par/and (all), par/or ("rejoins after any trail in parallel terminates, aborting all other trails automatically"), and par (never). watching e do body end is sugar for par/or do await e; with body end (parallel_compositions.md). Bounded reaction time is enforced statically: "Céu requires every path inside the body of a loop statement to contain at least one await or break statement" (bounded_execution.md). Unbounded computation goes to async.
Abortion runs finalizers, and the compiler requires them where C resources are involved: "A finalization statement unconditionally executes a series of statements when its associated block terminates or is aborted". A native call that receives or returns a pointer "does not compile without the finalize statement" (c_integration.md). The SenSys 2013 paper names the design goal: "The finalization mechanism is fundamental to preserve the orthogonality of the par/or construct, i.e., an aborted trail does not require clean up code outside it." It also calls par/or "an orthogonal preemption primitive", adding that "traditional (asynchronous) multi-threaded languages cannot express thread abortion safely" (Sant'Anna et al. 2013).
HipHop.js: Esterel embedded in JavaScript
HipHop.js (Berry & Serrano, PLDI 2020) is "a synchronous reactive language that adds synchronous concurrency and preemption to JavaScript. Inspired from Esterel …" and "compiled into plain sequential JavaScript" (PLDI 2020). The host drives instants explicitly with mach.react("S") (test/exec-susp-res.hh.js). Its kernel mirrors Esterel: fork { } par { }, abort { } when (L.now), suspend { } when (S.now), do { } every (I.now) (doc/lang/flow.md). Its async form is the modern counterpart of Esterel's exec (see below).
WARNING
The HTML documentation host hop.inria.fr/hiphop refused connections on 2026-11-22 (unverified). Every HipHop.js claim here cites the Markdown sources in the repository instead.
Evaluation model
- Push, event-driven, discrete. The environment pushes one input event; the runtime runs one reaction; the program goes idle. There is no pull and no lazy evaluation. Nothing is "cold" or "hot": a trail that is not currently
awaiting an event cannot observe it. Céu: "An input event is broadcast to all active trails, which share the event as an unique and global time reference" (overview). - One event per logical instant (Céu). "Only a single input event is handled at a logical time" (
synchronous_execution_model.md). Esterel instead allows several simultaneous input signals per instant (ABRO must decide whatAandBmean when they coincide withR, §3.1.1). - Glitch-freedom is structural. A reaction is atomic, so no other trail or the environment ever observes an intermediate state. In Esterel the output event of an instant is a single consistent vector of statuses, guaranteed by constructive causality. In Céu the source-order scheduler makes intra-reaction ordering deterministic, but within a reaction a later trail does see an earlier trail's writes. Céu warns about such accesses statically: the SenSys paper's algorithm detects concurrent accesses to variables and "conflicting weak and strong abortions" (sensys13).
- Synchronous, run-to-completion propagation. There is no batching beyond the reaction itself. Céu queues inputs that arrive mid-reaction for later reactions.
Composition
Composition happens through statements, not operators. The whole surface is a dozen control constructs:
| Need | Esterel | Céu | Rx equivalent (for comparison) |
|---|---|---|---|
| Wait for one event | await S | var T v = await E; | first() |
| Run concurrently, join | p ‖ q | par/and | zip / forkJoin |
| Race, first wins | abort p when S | par/or, watching | race / takeUntil |
| Restart on event | loop p each S | loop do … par/or … await E | switchMap |
| Repeat on event | every S do p end | every v in E do … end | subscribe |
| Freeze / resume | suspend p when S | pause/if e do … end | none (windowToggle / bufferToggle) |
| Derived value | ?S + emit in a thread | a var updated by a trail | map / scan |
| Fire-and-forget subtask | (none; all is lexical) | spawn do … end (scoped) | subscribe (unscoped) |
Derived values are ordinary variables written by a dedicated trail. There is no memoised dependency graph: these languages trade derivation for control flow. A map/filter/scan pipeline is written as a loop around await. Céu's successor Atmos adds "Functional Streams (à la ReactiveX)" with "Safe finalization of stateful streams" on top of the task core (Atmos README), which suggests that control-flow composition alone was found too low-level for data transformation.
Céu's every body cannot contain synchronous control statements (await, par/or, watching, …) "ensuring that no occurrences of the specified event are ever missed" (loops.md). A body that waits, as debounce does, must be a loop do … await … end, and the program must then cope with events that arrive while it waits (see the worked pipeline).
Time and scheduling
- Time is logical: input events are the clock. Céu treats wall-clock time as one more input: the host calls
ceu_input(CEU_INPUT__WCLOCK, &dt), and the runtime asks back for its next deadline throughCEU_CALLBACK_WCLOCK_MIN, "whenever a next minimum timer is required" (c_api.md). This is exactly the shape of a frame loop that sleeps withwakeIn: the program reports its earliest deadline, and the host wakes at that deadline or on input. - Timers are countdowns with residual compensation.
ceu_wclock_(src/c/ceu.c) storesdt - wclk_latewhen anawaitstarts, subtracts the elapseddton each clock input, and reports the minimum outstanding timer to the host. An expiredawaitevaluates to the residual delta, and "if a program awaits timers in sequence (or in aloop), the residualdtfrom the preceding timer is reduced from the timer in sequence" (event_handling.md). Periodic loops therefore do not drift. - Debounce is not a primitive; it is an idiom.
par/or do await (interval)ms; … with await QUERY; endis the whole implementation. The code generatorAwait_Wclock(src/lua/codes.lua) evaluates theWCLOCKEexpression ((t)ms) when theawaitstarts: "await (t)ms;awaits the current value of the variable "t" in milliseconds" (event_handling.md). So the duration can change at runtime, and each new debounce picks up the current value. A debounce already pending keeps its old deadline unless the program also races it against theINTERVALevent. - Esterel time is a signal like any other.
await 3 Meterandabort p when 2 Secondcount occurrences of the input signalsMeterandSecond(§4.7.10). A debounce isabort … when N MSwithMSa millisecond-tick input. There is no ambient clock, so a test simply feeds ticks. - Scheduler. Esterel compiles to a single automaton or circuit, so its notion of scheduling is a static order. Céu's scheduler walks trails in lexical order (
synchronous_execution_model.md). Neither has threads, dispatchers or priorities beyond source order.
Concurrency and cancellation
Latest-wins is a control-flow construct
par/or (Céu), abort … when and loop … each (Esterel) are latest-wins. The work trail and the "newer query" trail race inside one lexical block; the first to finish ends the block and aborts the other in the same reaction. Nothing is subscribed, so there is nothing to unsubscribe. Abortion is lexical and total: everything nested inside the aborted block dies, and its finalize clauses run, innermost first. In Esterel the strong/weak distinction decides whether the body gets one last instant at abortion time. Céu's par/or is strong for the losing trails and runs only their finalizers.
CPU-bound work: async, async/thread, Esterel exec
Synchronous reactions must be bounded, so CPU-bound work needs a separate mechanism (asynchronous_execution.md):
"Asynchronous execution supports tight loops while keeping the rest of the application, aka the synchronous side, reactive to incoming events. … Even though asynchronous blocks execute in separate, they are still managed by the program hierarchy and are also subject to lexical scope and abortion."
| Form | Runs where | How abortion reaches it | Does abort wait? |
|---|---|---|---|
Céu await async (vars) do | Same thread, interleaved: "Start/Resume whenever the synchronous side is idle", "Suspend after each loop iteration" | The async trail HALTs on CEU_INPUT__ASYNC after each loop iteration (__loop_async), and the host resumes it with ceu_input(CEU_INPUT__ASYNC, NULL) (ceu_loop). An aborted async is simply never resumed, so cancellation is exact at iteration granularity | No: abortion is synchronous and immediate |
Céu await async/thread (vars) do | A real pthread, "completely detached from the synchronous side" | Abortion runs the block's generated finalizer, which sets has_aborted = 1 and calls CEU_THREADS_CANCEL → pthread_cancel (Async_Thread, env/threads.h). Each atomic do inside the thread first checks has_aborted and jumps to the exit label (Atomic) | No: the thread is reaped later by ceu_threads_gc, which uses pthread_tryjoin_np, not join (src/c/ceu.c) |
Esterel exec T(..) return R | The environment, "asynchronously with the Esterel program" | "During its execution, an exec statement can be suspended or aborted. This is signaled to the external task by sending appropriate suspension and abortion signals" (§4.7.17) | No: the abort is logical, and the environment honours it later |
HipHop.js async { } kill { } | A JS async action (timer, promise, worker) | "The optional arguments kill, suspend, and resume are JavaScript statements that are executed when the HipHop statement state changes. They give the opportunity to the JavaScript program to cleanup a computation if the async block is preempted" (doc/lang/async.md) | No: kill is a synchronous callback |
IMPORTANT
Every system here makes cancellation logically instantaneous and physically cooperative. The synchronous side stops caring at once, and the worker stops when it next checks. In Céu, pthread_cancel uses deferred cancellation by default, and a pure hashing loop contains no POSIX cancellation point. The effective check is therefore the has_aborted test at each atomic entry. A thread that never enters atomic runs to completion after its scope is gone, and the source contains no pthread_setcanceltype that would change this (searched at 5e0c8d3). A D design should state this split explicitly: a cancellation token checked at chunk boundaries, plus a scope that does not join.
Errors and completion
- Completion is termination of a block. A trail completes when its code falls off the end.
par/and/par/ordefine how completions combine. Anawaiton a code instance evaluates to its return value, and ado … endcanescape vto produce a value (blocks.md). There are no streams to complete, only control reaching the end of a block. - Errors are mostly compile-time. Esterel rejects non-constructive programs. Céu rejects tight loops, missing
finalize, and synchronous control statements in forbidden positions (synchronous_control_statements.md). Runtime errors are C-level asserts. - Exceptions are immature in Céu.
throw/catchexist in the v0.30 grammar, but the section reads onlyTODO(exceptions.md), and the generator warns'exception inside \async/thread`'([codes.lua][ceu-codes-exc]). Esterel hastrap T in … exit T … end trap`, a structured, statically scoped exit that preempts like a weak abort (§3.11: "At exit time, all statements in the trap body are weakly aborted, as for a weak abort statement (weak abort is actually a macro-statement built using traps)"). - Typed error values are absent from both languages. A D library would carry
Expectedthrough the sameescape/return path.
State and sharing
- Value cells: Esterel valued signals keep their last value, readable as
?S(the basis of the speed measure and counting examples, §3.3–3.5). Céu uses ordinaryvars in lexical scope, shared freely among trails because "accesses to shared variables among trails are deterministic and do not require synchronization primitives" (overview). - Multicast is the default. Every
emitis a broadcast to every awaiting trail. There is no subscription, no replay, and no buffer: an event that nobody awaits in that reaction is lost (the "empty reaction chain" at t2 insynchronous_execution_model.md). - Conflation is implicit. Because only the current reaction's event is visible, latest-wins and conflation are the natural semantics. Accumulation (a queue) has to be programmed explicitly.
- Threads break the model.
async/threadshares the listed variables by memory and "require[s] explicit atomic blocks on accesses to variables to avoid race conditions" (asynchronous_execution.md).
Lifetime and ownership
Lifetime here is pure lexical scope, the strongest form in this survey:
- "Céu provides static memory management based on lexical scope and does not require a garbage collector" (overview). Trail memory is a statically sized union, because parallel trails are known at compile time.
spawn do … endis scoped: "When the enclosing block terminates, the spawned block is aborted" (parallel_compositions.md). There is no unscoped fire-and-forget: leaks of thesubscribe-without-unsubscribekind cannot be written.finalizeattaches cleanup to the scope that owns a C resource, and the compiler forces it for pointer-carrying calls (c_integration.md). The_send_request/_send_cancelexample is precisely "cancel the in-flight external operation when the scope dies".- The one leak is
async/thread: its OS thread can outlive its scope, as described above.
This is the same contract as structured concurrency (a scope does not end until its children have ended), with one difference that matters: here a child "ends" logically at the abort, not when its physical work stops.
Testing
The synchronous model makes tests deterministic by construction. A test is an input trace, and the expected output is a function of that trace.
- Simulation in the language. A Céu
asyncmayemitinputs and time toward the synchronous side: "Anasyncblock can emit input and timer events towards the synchronous side, providing a way to test programs in the language itself. Every time anasyncemits an event, it suspends until the synchronous side reacts to the event" (asynchronous_execution.md). The manual's exampleemit 1s35ms;advances virtual time and asserts that a 10 ms loop ran exactly 103 times. This is the counterpart ofTestClock: virtual time is just an input. - Debounce test.
emit QUERY(1); emit 100ms; emit QUERY(2); emit 300ms;is a complete, wall-clock-free debounce test. The second query aborts the first timer, and only query 2 is hashed. - Esterel / HipHop tests are sequences of
reactcalls with the present inputs listed, each followed by an assertion on the emitted outputs (mach.react("S")intest/exec-susp-res.hh.js). - The limit: real
async/threadandexecwork is non-deterministic, so tests stub it out with an input event that plays the return signal.
The worked pipeline
The naive shape and its bug
The shape that comes to mind first, loop do var q = await QUERY; par/or do await (interval)ms; <hash> with await QUERY end end, loses the newer query. The await QUERY in the second branch consumes the keystroke that aborts the debounce. When control loops back to the top await QUERY, that reaction is already in progress. Céu wakes only the trails that were awaiting when the event occurred (step 4 of the model). The runtime implements this in two phases: ceu_bcast_mark first flags matching trails CEU_INPUT__STACKED, and only then are the flagged trails run (src/c/ceu.c). As a result, the top await waits for the next keystroke, and the latest text is never hashed. The fix is to carry the winning event's value out of the par/or, which is what Esterel's loop … each QUERY + ?QUERY does for free.
Céu
// Céu v0.30 (fenced as `c` for highlighting); compile with --ceu-features-thread
input int QUERY; // payload: handle of the query text (string handling elided)
input int INTERVAL; // new debounce interval, ms (from the numeric field)
input none TOGGLE_ON;
input none TOGGLE_OFF;
output u64 RESULT;
var int interval = 300;
par do
var int v;
every v in INTERVAL do // `every` bodies may not await: just store
interval = v; // read by the next `await (interval)ms`
end
with
loop do // the toggle: off ⇒ abort the whole pipeline
await TOGGLE_ON;
watching TOGGLE_OFF do
var int q = await QUERY;
loop do
q = do // value of the newest query: latest-wins
par/or do
await (interval)ms; // debounce
var u64 acc = 0;
await async/thread (q, acc) do // CPU-bound hash, real thread
var int i;
loop i in [0 -> _nfiles(q)[ do
var u64 h = _hash_file(q, i);
atomic do // also the cancellation check
acc = acc ^ h;
end
end
end
emit RESULT(acc);
escape await QUERY; // idle until the next keystroke
with
var int nq = await QUERY; // newer query: abort the left trail
escape nq;
end
end;
end
end
end
endPseudo-Esterel (labelled: v5 syntax, untested)
module Pipeline:
input QUERY : integer, TOGGLE_ON, TOGGLE_OFF, MS;
input INTERVAL : integer; % assume an initial emission at boot
output RESULT : integer;
task Hash (integer) (integer);
return HASHED;
loop
await TOGGLE_ON;
abort % strong: off kills timer and task
await QUERY;
loop
var res : integer in
await ?INTERVAL MS; % debounce: count MS ticks
exec Hash (res) (?QUERY) return HASHED;
emit RESULT(res)
end var;
halt
each QUERY % strong abort + restart; ?QUERY is the new text
when TOGGLE_OFF
end loopPer-event trace (Céu version)
| Event (one reaction each) | What happens |
|---|---|
TOGGLE_ON, then QUERY(1) | The watching body starts; q = 1; the par/or arms a 300 ms timer (ceu_wclock_ reports the new minimum to the host, which sets wakeIn(300ms)) and awaits QUERY. |
QUERY(2) during debounce | The right trail wakes, escape 2 ends the do, the par/or aborts the left trail and its timer disappears with it, q = 2, and the loop re-enters par/or with a fresh await (interval)ms. All of this happens in one reaction, with no intermediate state visible. |
| Timer expires | The host feeds WCLOCK(dt); the left trail wakes, spawns the hashing thread, and halts awaiting CEU_INPUT__THREAD. The UI stays responsive because the synchronous side is idle. |
QUERY(3) during hash | The right trail wins. Aborting the left trail runs the async/thread finalizer: has_aborted = 1, pthread_cancel. The synchronous side does not wait; it re-arms the debounce for q = 3 at once. The old thread exits at its next atomic (between files), and ceu_threads_gc reaps it on a later loop iteration. Its acc is never emitted. |
INTERVAL(500) | The first trail stores interval = 500. A debounce already pending keeps its old deadline; the next await (interval)ms uses 500. Adding with await INTERVAL; escape q; as a third par/or branch would restart the pending debounce with the new value. |
TOGGLE_OFF | The watching aborts everything nested: the pending timer, or the hashing thread (via its finalizer). Control returns to await TOGGLE_ON. Keystrokes while off wake nobody and are dropped, which is the intended semantics. |
RESULT(acc) reaches the UI | emit of an output event calls the host's output callback synchronously within the reaction; the widget tree reads the stored result on the next frame. |
Fit with a per-frame UI
- Good fit: a frame is a natural instant. The host loop already has the right shape: collect input, call
ceu_inputonce per event, ask for the next timer deadline (CEU_CALLBACK_WCLOCK_MIN↔wakeIn), render. The pipeline's state lives in whichawaiteach trail is parked on, not in flags, so a toggle-off cannot leave a stale "debouncing" bit behind. - Mismatch 1, one event per instant: Céu handles one input per reaction, while a frame may carry several (a keystroke and a toggle). The host must serialise them, and their order becomes semantics. Esterel's multi-signal instant matches a frame better but brings causality analysis with it.
- Mismatch 2, retained vs immediate mode: trails are retained, long-lived state machines. In an immediate-mode tree they live beside the per-frame widget rebuild as a controller, and the widgets read their results. This is the pattern Elm and Jetpack Compose formalise from the other side.
- Mismatch 3, the physical/logical gap: an aborted hash keeps burning a core until its next check. The language hides this behind "instantaneous" abortion, so the D library must make it observable (for example, a scope that can optionally
joinits cancelled worker).
Strengths
- Lexical, total abortion. One
par/or/watching/abortkills an arbitrary subtree of timers, awaits and nested parallels, and runs its finalizers. Nothing liketakeUntilplacement or forgottenunsubscribecan go wrong. - Latest-wins without operators.
switchMapsemantics fall out of control flow, and the code reads like the specification. - Determinism and reproducibility. Source-order scheduling (Céu) or constructive semantics (Esterel) make every input trace replayable. Tests need no clock mocking: time is an input.
- Bounded reactions are checked statically (Céu's tight-loop rule, Esterel's instantaneous-loop rejection), so a reaction cannot hang the UI frame.
- No GC, static memory (Céu): trail storage is computed at compile time, and the language targets wireless-sensor nodes: reimplemented drivers and protocols came within "an increase in ROM and RAM below 10%" of nesC (sensys13).
- The host interface fits an event loop. Input events in, next deadline out.
event-horizon'swakeInmaps onto this one to one.
Weaknesses
- No dataflow vocabulary. Derived values,
map/scan/combineLatestand memoisation are hand-written loops. Atmos later bolted on Rx-style streams (atmos-readme). - Consuming awaits lose events. The naive pipeline drops the newest query, because an
awaitreached mid-reaction does not see that reaction's event. Programs must thread the winning value out explicitly. - Real parallelism is second-class.
async/threadgives up determinism, needsatomic, and its cancellation is cooperative and unjoined. The plainasyncis cooperative and single-core. - Causality analysis (Esterel) is subtle. Rejected programs are hard to explain: the primer devotes a whole chapter (ch. 5) to why
present O else emit O endhas no meaning. Reports that HipHop.js users still hit hard-to-locate causality cycles were seen only in search-result summaries (unverified). - Small ecosystems and stalled tools. Céu's last commit on this repository is 2019-07-17, and
exceptions.mdanddeterministic_execution.mdare stillTODO. Its author moved on to d-Ceu (announced February 2023) and Atmos (announced 2025-08-17, ceu-lang list).
Key design decisions and trade-offs
| Decision | Rationale | Trade-off |
|---|---|---|
| Synchronous hypothesis: reactions take zero logical time | Outputs are a function of the input trace; no interleavings to reason about | Real work must be bounded or exiled to async/exec; the physical cost of a reaction is invisible in the model |
Abortion is a lexical block (abort, par/or, watching) | Cancellation composes like if; finalizers make it safe for resources | Only tree-shaped lifetimes; work that outlives its scope needs an explicit escape (spawn is still scoped) |
| Strong vs weak preemption (Esterel) | Lets the programmer choose whether the body gets "last wills" in the abort instant | Two near-identical constructs whose difference is one instant: easy to choose wrongly |
| Abort vs suspend as distinct primitives | ^C vs ^Z: kill state, or freeze it (timers included) | The toggle must choose: pause/if would resume a stale debounce, watching discards it |
| Same-instant absence tests (Esterel) vs non-immediate awaits (Céu) | Esterel: maximal expressiveness, reaction to absence; Céu: no causality cycles | Esterel needs constructive causality analysis; Céu needs explicit value threading (the lost-event pitfall) |
| Source-order trail scheduling (Céu) | Deterministic without an analysis; doubles as priority | Behaviour depends on textual order of par branches |
| Time as an input event | Virtual time for free; host controls the clock (WCLOCK_MIN ↔ wakeIn) | Every timer depends on the host delivering dt accurately; residual-dt compensation is needed against drift |
CPU work via async (cooperative) or async/thread (pthread) | Keeps the synchronous side bounded; abortion still reaches the work lexically | Thread abort is pthread_cancel + flag checked at atomic; no join, so the work runs on after the abort |
| Static memory per trail (Céu) | No GC; runs on microcontrollers | Dynamic fan-out needs pools with declared bounds |
Sources
- Gérard Berry, The Esterel v5 Language Primer, v5.91, 2000-06-05 (read in full; quotes above are verbatim from this copy).
- Gérard Berry & Georges Gonthier, "The Esterel synchronous programming language: design, semantics, implementation", Science of Computer Programming 19(2):87–152, 1992 (bibliographic details confirmed; publisher page returned HTTP 403, full text not read).
- Gérard Berry & Manuel Serrano, "HipHop.js: (A)Synchronous Reactive Web Programming", PLDI 2020 (abstract read).
- HipHop.js sources:
README.md,doc/lang/async.md,doc/lang/flow.md,test/loopeach.hh.js,test/exec-susp-res.hh.js; HTML docs athop.inria.fr/hiphop(unreachable on 2026-11-22 and 2026-11-24, with no archived copy). - Francisco Sant'Anna, Noemi Rodriguez, Roberto Ierusalimschy, Olaf Landsiedel, Philippas Tsigas, "Safe System-level Concurrency on Resource-Constrained Nodes", SenSys 2013 (copy read).
- Francisco Sant'Anna, Roberto Ierusalimschy, Noemi Rodriguez, "Structured Synchronous Reactive Programming with Céu", Modularity 2015 (bibliographic details via DBLP/Wikipedia; full text not read).
- Céu manual v0.30: overview, synchronous execution model, parallel compositions and abortion, bounded execution, internal reactions, parallel compositions, event handling, loops, asynchronous execution, C integration / finalization, blocks, synchronous control statements, exceptions, C API.
- Céu runtime and compiler:
src/c/ceu.c—ceu_wclock_,ceu_bcast_mark/ceu_bcast,ceu_threads_gc,ceu_loop;src/lua/codes.lua—Await_Wclock,__loop_async,Async_Thread,Atomic;env/threads.h. - Successors: Atmos README; Atmos announcement on the ceu-lang list, 2025-08-17.
- Related: RxJS · Effect-TS · Kotlin Flow · Elm · Sodium · Jetpack Compose · Concepts · Comparison · Structured coroutines · Async I/O survey