Wren a web browser where WebAssembly runs everything, JavaScript included

Wren 0.3.0

Wren 0.3.0 compiles JavaScript to WebAssembly, loads iframes and no longer lets a busy page freeze the browser. WebAssembly is still the only execution engine: hot JavaScript functions are compiled to Wasm modules while the page runs, in the same sandbox.

This is still a beta, under development, and Windows-only.

Highlights

  • A JIT for JavaScript that produces WebAssembly. Hot functions and loops of QuickJS-ng are compiled to Wasm modules on background threads, then by Wasmtime (Cranelift); guards fall back to the interpreter exactly. Modules are position-independent, shared by every page and kept in the disk cache: a second tab or a reload compiles nothing. Octane about 1.75 times as fast as the interpreter (navier-stokes ×4, zlib ×2.7), loops and property accesses ×4 to ×6, DOM getters twice as fast. test262 and web-platform-tests show no regression, with everything compiled at once too.
  • Iframes. Each <iframe> is a document of its own, with its origin, its scripts and its JavaScript engine instance: src, srcdoc, sandbox, allow (Permissions Policy), postMessage, cross-origin WindowProxy limits, X-Frame-Options and frame-ancestors, forms and links aimed at a named frame, storage and HTTP cache partitioned by top-level site.
  • The browser never waits for a page. A long script, style or layout pass no longer freezes tabs, the address bar or the menus: a 200 ms script task now holds the interface about 15 ms (it held it 210 ms). A busy page keeps its last picture, which scrolls at once.
  • An HTTP cache. Memory and disk, RFC 9111 (freshness, revalidation, Vary, partitioning by site), about:cache; F5 revalidates, Ctrl+F5 reloads everything. Web fonts come from the cache before the first paint: no more flash of the fallback font between pages.
  • Passkeys. navigator.credentials and WebAuthn through Windows (Windows Hello, security keys, phones), with the specification's origin and RP ID rules.
  • History as a tree. Going back restores the scroll position, zoom and filled forms; back and forward are instant (back/forward cache); branches are kept, about:history (Ctrl+H) lists every visit and draws each tab's tree, which can be panned, zoomed and shown horizontally or vertically.
  • A command palette (Ctrl+K or Ctrl+Shift+P) over commands, tabs, settings and visited pages; address bar suggestions from history and open tabs, each history row with a cross that removes it.
  • Immediate feedback. Hover and press states show at once, without fades, and every CSS cursor is applied, url() included.
  • Closer to real sites. clockin.sacha.house renders as in Edge (stylesheet load events, grid and form fixes, scroll events), DuckDuckGo's icons take their color (currentColor on an inline <svg>), fieldset legends cut their border, Tailwind pages style about ten times faster.
  • Steadier. Memory leaks now fail the tests (tracking allocator everywhere, a check build, AddressSanitizer on unit tests); an idle browser gives memory back (612 MB down to about 320 MB with one tab after a long session); test tools print a symbolized stack when they crash; a use-after-free at page close was fixed. One wheel notch follows the Windows setting (100 px for 3 lines), and smooth scrolling can be turned off from the View menu.
  • Development builds wear a blueprint logo and a DEV badge; releases keep the amber one.

Edit this page on GitHub