Skip to main content

Posts

Showing posts from 2026

WebAssembly Comes to Hermes

WebAssembly Comes to Hermes Hermes can now compile and run WebAssembly modules. A standard .wasm binary - the same one that runs in a browser or Node.js - can be loaded into Hermes at runtime, or compiled ahead of time into Hermes bytecode ( .hbc ) for zero startup cost. The result is the same fast, compact bytecode format that Hermes already uses for JavaScript, executed by the same interpreter. Why does this matter? WebAssembly opens the door to reusing existing C, C++, and Rust libraries without writing native modules. Image processing, physics engines, crypto routines - anything compiled to Wasm can now run directly in the JS engine, using the standard WebAssembly API familiar from the browser. This post walks through the full pipeline - from C source code to running Wasm inside Hermes - and looks at what happens under the hood. The Simplest Example Let’s start with a function so small there’s nowhere to hide: computing the average of two integers. The C Source int avg ( ...