beck_host/
lib.rs

1//! The platform, minus the host.
2//!
3//! [`docs/05-tier-lowering.md`](../../../../docs/05-tier-lowering.md) §5.2 calls the runtime "the
4//! 'Roc platform' of Beck — an effectful Rust host owning I/O, scheduling and memory, executing the
5//! pure program". This crate is everything in that sentence *except* the I/O and the scheduling:
6//! the bridge to a compiled program ([`program::Runtime`]), what a logged occurrence is
7//! ([`record`]), what a subscription says to a client ([`protocol`]), and the rules the merge point
8//! applies to a batch of proposals ([`mod@sequence`]).
9//!
10//! # Why it is a crate rather than four modules of `beck-rt`
11//!
12//! Because a browser tab is a second host. [`docs/17-playground.md`](../../../../docs/17-playground.md)
13//! §17.2 says the playground's worker-server is "the rung-0 platform compiled to WASM", and the
14//! whole force of that claim is the word *the*: a tab that ran a second implementation of the
15//! sequencer would be a demo of something adjacent to Beck. `beck-rt` cannot cross to
16//! `wasm32-unknown-unknown` — it holds Postgres, redb, SQLite, TLS and a multi-threaded reactor —
17//! and none of that is what a merge point *is*. So the part that is program-shaped rather than
18//! machine-shaped lives here, `beck-rt` re-exports it unchanged, and `beck-play` links the same
19//! code into a tab.
20//!
21//! Nothing here reads a clock, a socket or a disk. That is the membership rule: if it needs the
22//! machine, it belongs upstairs in `beck-rt`.
23
24pub mod program;
25pub mod protocol;
26pub mod record;
27pub mod sequence;
28
29pub use program::{describe, At, Runtime, Viewer};
30pub use protocol::{ClientMsg, Resumption, ServerMsg};
31pub use record::{Envelope, Instant, Pending, Seq, Snapshot};
32pub use sequence::{sequence, Committed, Decision};