formal-web is a Rust web-engine prototype with a modular architecture and support for formal verification.
The modularity is goal-oriented: it can be used to support the following:
Note: current implementation of generic component reflect Mac OS as the current main development platform: high-performance Mac OS paths with lower-performance cross platform paths. For example, there is a relatively high-performance rendering path on Mac OS, with zero copy texture sharing and a modicum of layering using multiple Core Animation layers to minimize re-rendering, and then there is a relatively low-performance cross platform path involving reading back data to the CPU.
The project has only been run on macOS; all build commands assume macOS. The
Rust toolchain is pinned to 1.94.0 (rustup toolchain install 1.94.0); if it
is not your default toolchain, prefix the commands below with rustup run 1.94.0.
# Default: V8, media on, AppKit embedder, AVFoundation media
# backend and zero-copy IOSurface graphics.
cargo build --release
cargo run --release
Exactly one of the engines below is enabled at a time; enabling none or more than one fails the build. V8 is the default and needs no feature flags; the others replace it:
# Boa
cargo build --release --no-default-features --features boa,media
cargo run --release --no-default-features --features boa,media
# Boa + WebAssembly (`wasm` is Boa-only: V8 and JSC implement WebAssembly natively)
cargo build --release --no-default-features --features boa,wasm,media
cargo run --release --no-default-features --features boa,wasm,media
# JSC (experimental, macOS only)
cargo build --release --no-default-features --features jsc,media
cargo run --release --no-default-features --features jsc,media
graphics build)# Defaults (macOS): AVFoundation media backend and zero-copy IOSurface
# graphics — the default build above
# GStreamer media backend + CPU readback graphics (macOS opt-in; on other
# platforms GStreamer and CPU readback are the only backends)
cargo build --release -p graphics --features backend-gstreamer,cpu_readback
cargo run --release
# CPU readback graphics (macOS opt-in), with the default AVFoundation media
# backend
cargo build --release -p graphics --features cpu_readback
cargo run --release
# Without media
cargo build --release --no-default-features --features v8
cargo run --release --no-default-features --features v8
net build)The fetch transport is one of two backends. macOS defaults to the Apple URLSession backend, which compiles no reqwest/tokio stack; on other platforms the tokio/reqwest backend is the only option and is always compiled:
# Default (macOS): Apple URLSession — the default build above.
# Default (other platforms): tokio/reqwest — always compiled there, the
# default build above.
# macOS: tokio/reqwest backend (opt-in; URLSession is the default and wins
# if both features are enabled)
cargo build --release -p net --features tokio
cargo run --release
A full cargo build --release prebuilds formal-web-net with the platform
default backend and overwrites the copy it places next to the embedder
binary, so build the net package after it when switching backends. See
net/README.md for the backends themselves.
# macOS: AppKit embedder — the default build above
# macOS: winit windowed embedder (Blitz-rendered chrome)
cargo build --release --features winit_embedder
cargo run --release --features winit_embedder
The following components, mapping to processes or extensions, are used:
src/main.rs): runs the embedder, webview, and user_agent crates.user_agent/src/event_loops.rs): runs the content crate; one per similar origin window agent.graphics/src/bin/graphics_process.rs): runs the graphics and media crates.user_agent/src/fetch.rs): runs the net crate.A set of core algorithms will be formalized using TLA+, and their Rust implementation model-checked against those formal specification using the tracing approach described in Validating Traces of Distributed Programs Against TLA+ Specifications. For further details, see the verification folder.
Rust
90.5%
HTML
5.6%
TypeScript
1.8%
TLA
1.1%
formal-web is a Rust web-engine prototype with a modular architecture and support for formal verification.
The modularity is goal-oriented: it can be used to support the following:
Note: current implementation of generic component reflect Mac OS as the current main development platform: high-performance Mac OS paths with lower-performance cross platform paths. For example, there is a relatively high-performance rendering path on Mac OS, with zero copy texture sharing and a modicum of layering using multiple Core Animation layers to minimize re-rendering, and then there is a relatively low-performance cross platform path involving reading back data to the CPU.
The project has only been run on macOS; all build commands assume macOS. The
Rust toolchain is pinned to 1.94.0 (rustup toolchain install 1.94.0); if it
is not your default toolchain, prefix the commands below with rustup run 1.94.0.
# Default: V8, media on, AppKit embedder, AVFoundation media
# backend and zero-copy IOSurface graphics.
cargo build --release
cargo run --release
Exactly one of the engines below is enabled at a time; enabling none or more than one fails the build. V8 is the default and needs no feature flags; the others replace it:
# Boa
cargo build --release --no-default-features --features boa,media
cargo run --release --no-default-features --features boa,media
# Boa + WebAssembly (`wasm` is Boa-only: V8 and JSC implement WebAssembly natively)
cargo build --release --no-default-features --features boa,wasm,media
cargo run --release --no-default-features --features boa,wasm,media
# JSC (experimental, macOS only)
cargo build --release --no-default-features --features jsc,media
cargo run --release --no-default-features --features jsc,media
graphics build)# Defaults (macOS): AVFoundation media backend and zero-copy IOSurface
# graphics — the default build above
# GStreamer media backend + CPU readback graphics (macOS opt-in; on other
# platforms GStreamer and CPU readback are the only backends)
cargo build --release -p graphics --features backend-gstreamer,cpu_readback
cargo run --release
# CPU readback graphics (macOS opt-in), with the default AVFoundation media
# backend
cargo build --release -p graphics --features cpu_readback
cargo run --release
# Without media
cargo build --release --no-default-features --features v8
cargo run --release --no-default-features --features v8
net build)The fetch transport is one of two backends. macOS defaults to the Apple URLSession backend, which compiles no reqwest/tokio stack; on other platforms the tokio/reqwest backend is the only option and is always compiled:
# Default (macOS): Apple URLSession — the default build above.
# Default (other platforms): tokio/reqwest — always compiled there, the
# default build above.
# macOS: tokio/reqwest backend (opt-in; URLSession is the default and wins
# if both features are enabled)
cargo build --release -p net --features tokio
cargo run --release
A full cargo build --release prebuilds formal-web-net with the platform
default backend and overwrites the copy it places next to the embedder
binary, so build the net package after it when switching backends. See
net/README.md for the backends themselves.
# macOS: AppKit embedder — the default build above
# macOS: winit windowed embedder (Blitz-rendered chrome)
cargo build --release --features winit_embedder
cargo run --release --features winit_embedder
The following components, mapping to processes or extensions, are used:
src/main.rs): runs the embedder, webview, and user_agent crates.user_agent/src/event_loops.rs): runs the content crate; one per similar origin window agent.graphics/src/bin/graphics_process.rs): runs the graphics and media crates.user_agent/src/fetch.rs): runs the net crate.A set of core algorithms will be formalized using TLA+, and their Rust implementation model-checked against those formal specification using the tracing approach described in Validating Traces of Distributed Programs Against TLA+ Specifications. For further details, see the verification folder.
Rust
90.5%
HTML
5.6%
TypeScript
1.8%
TLA
1.1%