HN
Today

Bez: Generating a browser engine from specs and tests

Bez proposes a radical method for democratizing web engine development: generating browser engines from web specifications and tests, rather than hand-coding them. This ambitious project seeks to reduce the colossal effort traditionally required, offering hopes for more diverse, embedded, and efficient web renderers. HN is captivated by the potential to disrupt the browser monoculture and the intriguing application of AI/generation to a historically complex engineering challenge.

51
Score
13
Comments
#4
Highest Rank
3h
on Front Page
First Seen
Oct 1, 7:00 PM
Last Seen
Oct 1, 9:00 PM
Rank Over Time
4611

The Lowdown

Bez is an audacious project aiming to generate web rendering engines directly from web specifications and test suites like WPT. The premise is simple yet profound: manually building a browser engine demands hundreds of engineers and years of effort, limiting the field to a select few tech giants. By automating this process, Bez seeks to lower the barrier to entry, enabling the creation of lightweight, specialized, and easily updatable engines.

Key aspects of the Bez project include:

  • Why Generation? To break the monopoly of a few browser engines by making engine development accessible, allowing for more diverse implementations.
  • Key Goals: Produce complete or "tree-shaken" engines (only including features a specific site uses), ensure fast performance on various devices, offer easy embedding for apps, and provide rapid updates by regenerating affected code when specs change.
  • How it Works: The system takes spec text, uses models to write multiple candidate implementations, runs them inside an existing engine (Chromium, Firefox, WebKit) and against WPT, then commits the verified code (currently in Rust). It leverages browser agreement as an oracle.
  • Current Status & Findings: While still in early stages (e.g., 0.6% overall coverage, 2.5% for CSS generated), the project has made interesting findings. Notably, the three major browsers largely agree on rendering, with Firefox occasionally being the outlier due to rounding differences (a real web-compat bug!). Conformance suites and logic programming (e.g., Datalog for margin collapsing) are proving viable as oracles for generation.

In essence, Bez envisions a future where bespoke web engines are not a pipe dream, but a generated reality, tailored precisely to needs and constantly aligned with evolving web standards.

The Gossip

AI's Architectural Acumen: From Specs to Code (and back to reality)

Commenters debate the practical feasibility of AI or automated generation crafting a production-ready browser engine. While the idea of generating from specs is appealing, experienced engine developers caution that current AI models struggle with complex architectural decisions, often producing functionally correct but inefficient or poorly structured code. The underlying web specifications themselves are also highlighted as often human-readable prose, not machine-executable contracts, making direct generation challenging without significant human interpretation and refinement.

Breaking the Browser Barrier: A Monoculture's Many Maladies

A strong sentiment among commenters is the desire to escape the current browser engine monoculture, primarily dominated by Chromium. Many hope that projects like Bez could lead to greater diversity, innovation, and programmatic control over browser functionality, potentially freeing developers from the constraints and whims of a single major vendor. This includes the possibility of more specialized, embeddable engines.

The Name Game: Bez and British Pop Culture

A lighter thread speculates on the origin of the project's name, "Bez." One commenter draws a humorous parallel to Bez from the 90s British band Happy Mondays, known for dancing rather than singing or playing instruments. Another jokingly suggests it might be an "LLM smell" or an "OpenAI goblin problem," hinting at unintended patterns from AI-generated content.