Skip to content

gterzian/formal-web

Repository files navigation

formal-web

formal-web is a Rust web-engine prototype in alpha status, with an embedding API and an optional TLA+ verification layer.

Prerequisites

  • Rust toolchain: rustup toolchain install 1.94.0
  • GStreamer (for media): see gstreamer docs for platform-specific installation

Commands

# Check all    (type-check every package without producing binaries)
rustup run 1.94.0 cargo check

# Build all    (root + embedder + content + net + media)
rustup run 1.94.0 cargo build --release

# Run all      (launches the embedder, which spawns content/net/media)
rustup run 1.94.0 cargo run --release

Without media:

rustup run 1.94.0 cargo build --release --no-default-features
rustup run 1.94.0 cargo run --release -- --no-default-features

Project architecture

A multiprocess approach is chosen by default, because the goal is to match Apple's guidelines for an independent browser engine.

The following procesess are used:

  • Main: running the embedder, webview, and user_agent crates. The process is started in src/main.rs.
  • Content: running the content crate, and started in user_agent/src/event_loop.rs, because each process is running what is essentially a window event loop. In the future it will also run dedicated worker event loops. Service workers will likely run in their own process, and for shared worker the issue hasn't been decided yet (it seems there is a move towards isolating them per top-level sites). There is one process per similar origin window agent; this is the only type of process of which there can be more than one.
  • Net: running the net crate. That process is owned by the fetch worker in user_agent/src/fetch.rs, and the code in the process will essentially be the part of the fetch standard that starts at https://fetch.spec.whatwg.org/#http-network-or-cache-fetch.
  • Media: running the media crate, which runs gstreamer, which is started and owned by the media worker in user_agent/src/media.rs. This is an optional feature as expalined above under Quick Start.

Project structure

Directory Description
embedder/ Application lifecycle, window management, browser chrome, redraw loop
user_agent/ Navigables, session history, event loops, timers, fetch workers
content/ DOM, HTML algorithms, Boa JS integration, Web IDL bridges
media/ GStreamer video decoding pipeline
net/ HTTP and file fetch
webview/ Embedder-facing compositor and redraw API
automation/ WebDriver and CDP wire-protocol servers
verification/ Trace recording, TLA+ validation
ipc_messages/ Shared IPC message types
tests/ Formal tests and WPT runner
artifacts/ Default startup pages for testing

Extensions

  • pi-share-hf — Archives pi coding sessions to .pi/collected-sessions/
  • browser — Wraps CDP server into agent-callable dev tools
  • web_standards — Lazily loaded web spec content for interactive reading

Session archiving

Sessions are archived to .pi/collected-sessions/ on shutdown. Upload with:

./sync-hf-sessions.sh

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors