Wren

Wren 0.6.0

Wren 0.6.0 runs its JavaScript on an engine written in Odin, and no C of ours is left. The engine (jsrt) runs inside the WebAssembly module under Wasmtime, so the sandbox is the one of 0.5.0; QuickJS-ng, its C glue and its generators are gone from the build.

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

Highlights

  • The JavaScript engine is Odin. jsrt is the default and only engine: parser, bytecode interpreter, a JIT for numeric loops (compiled to WebAssembly), regular expressions, BigInt, dates, number conversion and the module loader. The glue to the Web APIs is generated Odin (native/js/odin/bindings_gen.odin). Only lexbor remains as external C. Checked against the same suites as before: the JavaScript, DOM, load, web and frames test programs, test262 (no regression) and the JIT's own verification.
  • Speed and memory. The interpreter reaches about the speed of QuickJS in native code; under Wasmtime it is still 1.5 to 2.5 times slower than QuickJS in C on calls and slower to create a realm. An empty realm takes 6.4 MiB of WebAssembly memory (7.7 before), a page with 650 KiB of script 27 MiB (46 before).
  • More pages look like Edge's. A side-by-side comparison with Edge (tools\site_compare.ps1, 40 public pages) found and fixed: linked stylesheets applied in arrival order instead of document order (python.org), <dialog> without its default style (Bootstrap 6 pushed its page 185 px down), the page's CSS ignored inside inline <svg> (icons, light-dark()), <button> width in block and flex display, and text-wrap: balance. getbootstrap.com went from 49 % to 9 % of pixels different, python.org from 51 % to 11 %.
  • A crash fixed. Going from one CSS-heavy page to another in the same window could read freed memory (custom property layers pointed into rules a rebuild had freed).

Edit this page on GitHub