Wren a web browser where WebAssembly runs everything, JavaScript included

Features

The idea

Every browser today carries a native JavaScript engine, with WebAssembly bolted on next to it. Wren starts at the other end.

JavaScript

A whole engine in a sandbox

Wren's own JavaScript engine, written in Odin and compiled to WebAssembly: one instance per page and per worker, a capped heap, scripts stopped when they run too long. A page's JavaScript starts in about 1.3 ms.

Or none at all

A page can be one .wasm file

Name the module with <script type="application/wasm"> and call the browser directly: 58 modules, 1,482 functions, described once in Web IDL, about 7 ns a call.

Under it

New code, not a wrapper

Style, layout, painting, the DOM, Fetch and the shell are written in Odin and drawn on Direct3D 11. No Chromium underneath.

Features

Six things Wren does that most browsers don't. Every number here was measured on the development machine; the long list is in the changelog.

The web platform, from its specifications

The JavaScript bindings are generated from the official Web IDL: DOM, CSSOM, events, observers, custom elements, fetch, streams, storage, WebSocket, workers. 3,821 of 5,310 members are implemented; the others are absent, so feature detection sees the truth.

Nothing escapes the sandbox

Every call into a module, JavaScript included, has a deadline and a capped heap. A loop that never returns is interrupted; a crashed engine loses the page's scripts, not the browser.

Modern CSS

Cascade layers, @property, container queries, CSS Color 4, flexbox, Grid with subgrid, transforms, animations and transitions.

Effects on the GPU

filter, backdrop-filter, 18 blend modes, clip-path, masks, background-clip: text, and gradients interpolated in sRGB, Oklab, Oklch and Lab.

At the display's refresh rate

Wheel scrolling a page of 10,000 paragraphs: 1.4 ms CPU and 2.3 ms GPU at the 99th percentile, under the 5.56 ms of a 180 Hz screen. The start page is drawn 0.3 s after launch.

A native window

Tabs in the title bar with Snap Layouts, downloads, local folders, light and dark mode, find in page, zoom, view-source: and a keyboard path through all of it.

All features and measurements

Status

A young engine, and no pretending otherwise: what works, and what does not, yet.

Works today

  • Documents and CSS-heavy sites, within a few percent of Edge pixel for pixel.
  • Sites whose scripts add to the page: menus, themes, web components, observers.
  • WebAssembly pages with the DOM, events, timers, fetch, WebSocket, workers and storage.

Not yet

  • JavaScript is interpreted, with a JIT for numeric loops only: script-heavy pages are slow.
  • Part of the web platform: about 72 % of the members of its Web IDL are implemented; no WebGPU or WebRTC, WebGL without transform feedback.
  • Linux is newer than Windows: a release needs glibc 2.39 or later, and its GPU video decoding is software for now.

The full status

Write a page for Wren

Two ways to write a page: JavaScript, as anywhere, or WebAssembly alone - a module exporting wb_main that calls the browser through the generated Odin SDK. Every import is described once, in docs/api.

The two ways to write a page

Architecture

A page owns its DOM, its WebAssembly instances (its JavaScript realm is one of them), its requests and its timers. Close a tab and all of it goes, in order. Below: the engine, then Windows.

How Wren fits together

Wren User Licence

Every version is free during the beta. The licence is one payment of 29 €, no subscription: it is personal and perpetual, with two years of updates from the 1.0 release. During the beta it unlocks nothing: it keeps the work going.

Get the licence

License

Wren's source is public under the PolyForm Strict License 1.0.0 (noncommercial use; no redistribution, no changes; versions up to 0.3.0 stay MIT), and the libraries it links keep their own. Every version is free during the beta; a licence only supports its development, and covers the updates from 1.0.