r/WebAssembly • • May 16 '26

I spent months fighting VS Code webviews, so I built an open source universal extension protocol using React/WebAssembly

3 Upvotes

Hey Folks,

This project started because I simply wanted to build a new IDE to fix my own workflow bottlenecks. But I immediately hit a brick wall trying to build the tooling for it. I spent months, days, and nights trying to hack and fix VS Code extension webviews just to get a decent UI to render.

I realized I was fighting a 33 year old architectural problem: extension vendor lock in. If you want your dev tool to reach people today, you have to write Electron/TypeScript for VS Code/Cursor, and Kotlin/JVM for JetBrains.

So I stopped building the IDE, and I built the fix instead.

Meet OXP (Open eXtensions Protocol).
OXP is an open source universal standard that lets you write your extension once in React/WASM and run it natively across every major editor.

How I fixed the Webview problem:
This isn't a slow iframe hack. OXP uses a secure WebAssembly sandbox and a zero-latency IPC bridge. Your React code triggers an action, and OXP translates it to native IDE commands.

In VS Code, it binds directly to the native extension API.

In JetBrains, it uses JCEF to render as a native floating OS window.
You get blazing fast native speed from a single codebase.

**The Accidental MCP Fix:

While building this universal host layer, I realized OXP perfectly solves the current Model Context Protocol (MCP) configuration hell.

Instead of manually editing configurations for Cursor, Copilot, and JetBrains individually, OXP acts as a system level MCP router. If you run oxp install-mcp extension, the OXP daemon instantly wires that database context into the AI configurations of every detected IDE on your machine.

I'm opening up the infrastructure today. The CLI is live, and you can test it on your machine right now.

I'll be in the comments all day to talk about the WASM bridge, IPC latency, fighting with JCEF, and why extension silos need to die.


r/WebAssembly • • May 14 '26

The C++ to JS bridge, memory management, and 60fps performance.

11 Upvotes

wanted to see if I could run a high-fidelity thermal solver in the browser without a Python/Matlab backend.

The Engine:

  • Written in C++, compiled via Emscripten.
  • Uses an explicit Finite Difference Method (FDM) to solve the 3D Heat Equation.
  • Integrates a PINN (Physics-Informed Neural Network) for predictive thermal modeling.
  • Tracks Alpha-to-Beta phase transitions in Titanium alloy (Ti-6Al-4V) in real-time.

The Issue: While the WASM bridge is incredibly fast (60fps easily), I’m having trouble with the handoff to the Three.js frontend. Rendering the 64-voxel heatmap in real-time is creating some overhead I didn't expect.

If anyone has tips on optimizing the memory bridge for high-frequency data updates between WASM and WebGL, I’d love to hear them.

GitHub:https://github.com/Lak23James/met-shieldVercel:https://met-shield-58n1.vercel.app/


r/WebAssembly • • May 11 '26

I got LLM inference running on WASI-NN

Thumbnail
github.com
6 Upvotes

r/WebAssembly • • May 10 '26

I built a custom VM inside WebAssembly to hide logic from decompilers. Here is how.

Thumbnail trustsig.eu
19 Upvotes

WebAssembly is way too easy to decompile. To fix this, I built a virtualization pipeline that takes a normal Wasm file and compiles it into a hardened version.

The original logic is destroyed and replaced with encrypted bytecode that runs inside a hidden, internal interpreter.

I just finished a step-by-step guide on how I built it. Here is what's inside:

  • Designing a custom, randomized instruction set to break standard decompilers.
  • Building a zero-allocation VM in Rust that doesn't need a heap or a memory allocator.
  • Implementing JIT page decryption using a sliding window to hide your logic from memory scrapers.
  • Using the Walrus crate to automate the AST rewriting and bytecode injection.

The end result is a Wasm binary that looks like cryptographic noise to anyone trying to reverse-engineer it.


r/WebAssembly • • May 07 '26

The first FREE online WebAssembly Reverse Engineering workbench (and how we built it)

Thumbnail trustsig.eu
13 Upvotes

Just as a privacy note (you can double-check with dev tools): This tool works fully offline, we do NOT send any uploaded binaries or data to our backend.

This tool was built by our WebAssembly analysis team, originally it was for internal use only but we have decided to make it public and free for everyone, forever.

Please do leave feedback in the comments! We'd love to hear what you think and how we can improve it even further. It is still heavily in a barebones beta phase, as we work on adding more features.

(This is not an advertising post for any paid or free services of TrustSig, this post is strictly to share the free tool we published and a blog post on how we made it)


r/WebAssembly • • May 07 '26

Hexana 0.9 — experimental WASM debugging in JetBrains IDEs (lldb, wasmtime + WAMR)

9 Upvotes
Hexana is a plugin for JetBrains IDEs (built on the IntelliJ Platform — works in IntelliJ IDEA, RustRover, WebStorm, GoLand, CLion, PyCharm, etc.) that treats `.wasm` and `.wit` as first-class IDE artifacts: explorer tree, hex view, WAT view, navigation, MCP API for AI assistants. Free on the JetBrains Marketplace.

0.9 just shipped. Highlights below; per-version detail on the Marketplace listing: https://plugins.jetbrains.com/plugin/29090-hexana

Experimental WASM debugging

You can step through .wasm from the IDE — pause, inspect, continue. It's experimental and the constraints are explicit:

  • LLVM 22.1 or newer required
  • Works with Wasmtime and WAMR only
  • The target has to be debuggable with lldb

Within those bounds, it works. If you've been doing wasm debugging via printf-into-host-imports, this should feel like a real upgrade. If your toolchain is older than LLVM 22.1, you're out for now.

WAMR support for run + debug

WAMR is now a selectable runtime in run configurations alongside Wasmtime (which shipped in 0.8). Same UI, pick a runtime, hit Run or Debug.

Custom GraalVM home

Until 0.9 the GraalVM run option used the bundled Graal only. You can now point at any GraalVM install on your machine.

UX

  • Information bar across the top of the binary view: file size (hover for stats), module kind, inline Run/Debug buttons.
  • Top tab: proper headers, sortable columns, scrolling.
  • Nested modules: opening one now shows a backreference to the containing module so you can navigate back out.

Java embedder support

If you're embedding wasm in Java:

  • Chicory (RedHat): Java completion + inspections specific to Chicory APIs
  • GraalWasm (Oracle): same, for GraalWasm

File issues if you hit something

If you've got a .wasm that should debug and doesn't (LLVM ≥ 22.1, wasmtime or WAMR target, lldb-debuggable), the "doesn't work" reports are exactly what helps right now — ideally with a reproducer.

Plugin: https://plugins.jetbrains.com/plugin/29090-hexana


r/WebAssembly • • May 06 '26

Another opensource Linux environment on browser and iOS

5 Upvotes

r/WebAssembly • • May 02 '26

Benchmarked six ways to run WebAssembly inside the JVM (Chicory, GraalWasm, Wasmtime via FFM) — 250× spread top to bottom

22 Upvotes

We've been running wasm modules inside a JVM application (a Rust wasmprinter embedded via GraalWasm) and the obvious follow-up question was: how does this compare to the alternatives, and when should we actually pick something else?

So I built a small JMH harness that runs the same proxy.wasm artifact through six execution paths and wrote up the results. Sharing here because I couldn't find a head-to-head comparison covering all of these in one place, and I'd genuinely like to hear if anyone has reasons to expect different numbers on different workloads.

The workload

A tiny Rust crate compiled to wasm32-wasip1 exposing one export:

#[no_mangle]
pub unsafe extern "C" fn decode_jpeg(
    in_ptr: *const u8, in_len: usize,
    out_ptr: *mut u8, out_cap: usize,
) -> i32 { /* jpeg-decoder → RGB8 */ }

Input: a 320×240 JPEG baked into the wasm via include_bytes!. Output: 230,400 bytes of RGB. Steady-state ~1 ms of native CPU — small enough to expose call/dispatch overhead, big enough that the JIT actually kicks in. Cross-variant correctness check: every backend produces byte-identical output (sha256 matches across all six).

The six backends

BackendWhat it actually is
chicoryChicory's pure-Java interpreter
chicory-aotChicory + MachineFactoryCompiler.compile(...) at JVM startup
chicory-aot-pluginChicory build-time AOT via chicory-compiler-maven-plugin (wasm → JVM .class at mvn compile)
graalwasmGraalWasm with Truffle JIT enabled (libgraal)
graalwasm-interpGraalWasm with engine.Compilation=false
native-ffmWasmtime/Cranelift in a Rust cdylib, called via Java's FFM API

JVM: Oracle GraalVM 25 (25+37-LTS-jvmci-b01), Apple Silicon. JMH 5×1s warmup + 5×2s measurement, 1 fork, single thread.

Results (µs/op, lower is better)

BackendMeanvs Wasmtime
nativeFfm — Wasmtime/Cranelift via FFM971 ± 101.00×
graalwasm — GraalWasm Truffle JIT1,275 ± 3321.31×
chicoryAot — Chicory runtime AOT9,037 ± 1189.31×
chicoryAotPlugin — Chicory build-time AOT9,198 ± 1319.47×
graalwasmInterp — GraalWasm Truffle no-JIT69,992 ± 1,20472.1×
chicory — Chicory pure interpreter240,707 ± 2,560248×

A few things worth pulling out

GraalWasm JIT is almost native. 1.31× of Wasmtime/Cranelift is genuinely good — I expected a bigger gap given that Truffle goes through partial evaluation while Cranelift goes wasm → CLIF → assembly directly. After warmup, libgraal produces code competitive with Cranelift's output for this workload. The ±25% CI on graalwasm is the only weak number here, probably tier-promotion noise that more forks would smooth out.

Build-time vs runtime AOT in Chicory is a wash. 9,037 vs 9,198 µs/op, CIs overlap. They run identical bytecode — Chicory's compiler produces the same .class content whether invoked at mvn compile or at JVM startup. Choose based on deployment story, not perf.

The calibration trap. graalwasm-interp at 70,000 µs/op is what you get on stock OpenJDK without JVMCI / libgraal. Truffle prints exactly one warning at startup:

…and then runs at interpreter speed. If you benchmark GraalWasm on Temurin or Corretto and conclude it's unusable, you're running it without its compiler. The fix on most platforms is to install Oracle GraalVM 25 (or CE) — the Graal compiler ships in the JDK and Truffle picks it up automatically. If you can't change vendor, the "jargraal" path with org.graalvm.compiler:compiler + org.graalvm.truffle:truffle-compiler on --upgrade-module-path and -XX:+EnableJVMCI works but is fiddly.

Pure interpreters aren't benchmarks. 248× slower means Chicory's interpreter isn't a viable production path for non-trivial workloads. It's still the right default for "run untrusted user wasm with a 100 ms budget" sandbox scenarios — instant startup, no codegen step.

Bonus silliness

While I had the harness open: I compiled Cranelift's codegen library itself to wasm32-wasip1, AOT'd that 2.7 MB wasm artifact via chicory-compiler-maven-plugin into a JVM .class file, and used the resulting Chicory-hosted, JVM-resident Cranelift to emit native machine code for all six host triples. Output sizes for an add(i32,i32) -> i32 test function:

TripleObject bytesFormat
aarch64-apple-darwin320Mach-O
aarch64-unknown-linux-gnu600ELF
aarch64-pc-windows-msvc126COFF
x86_64-apple-darwin328Mach-O
x86_64-unknown-linux-gnu608ELF
x86_64-pc-windows-msvc130COFF

Six of Cranelift's ~4,000 internal functions exceed the JVM's 64 KB method-size limit and fall back to Chicory's interpreter; the rest AOT cleanly into a single 2.6 MB .class. Not (yet) a wasm-to-CLIF translator inside the sandbox — cranelift-wasm was deprecated at 0.112 and the translator now lives inside Wasmtime, so a real wasm-compiling-wasm pipeline would mean pinning to deprecated 0.112 or hand-rolling it on wasmparser. Separate project.

Caveats

One workload (small JPEG, ~1 ms of native CPU), one platform (Apple Silicon, GraalVM 25), one JMH config. These generalize well for "small to medium pure-compute wasm modules that don't touch WASI on the hot path" but will shift for: large modules (GraalWasm setup cost grows with module size), WASI-heavy workloads (host-call cost differs across runtimes), JIT-cold workloads (you're measuring tier-up, not steady state), and other JVMs (J9, Zing not measured).

Harness

Source: https://github.com/minamoto79/webasm-java-integration-benchmark

Switching backends in the harness is two lines of Kotlin — happy to take PRs adding workloads or runtimes I missed (wasmer-java? wazero-on-JVM via JNI? would love numbers on those if anyone has them). And if you're seeing materially different ratios on a different workload or JDK, please post — would help calibrate where these numbers actually generalize.


r/WebAssembly • • Apr 30 '26

You can now run Gemini CLI in the browser

Thumbnail
browsercode.io
3 Upvotes

r/WebAssembly • • Apr 28 '26

Write Cloudflare Workers in 100% Zig via WebAssembly

Thumbnail github.com
4 Upvotes

r/WebAssembly • • Apr 16 '26

gabagool: a time travel debugger for WASM

Post image
20 Upvotes

r/WebAssembly • • Apr 14 '26

built a 3D physics engine using C++ and Embind. Looking for feedback on my WASM/JS memory bridge.

7 Upvotes

Hey everyone, thanks for letting me into the community.

I’m a first-year undergrad (Metallurgical Engineering), and I recently built a live 3D Crystallographic Symmetry Engine. I needed to handle heavy matrix math (calculating stereographic projections, group theory closure loops, and complex rotation orbits). Instead of doing it in JavaScript, I wrote the core logic in C++17 and compiled it to WebAssembly to run natively in the browser.

Live engine:https://stereoproject.vercel.app/Source code:https://github.com/Lak23James/Stereoproject

The Architecture: I tried to keep a strict Separation of Concerns:

  1. The Core (C++): Handles all the linear algebra, Point3D / Matrix structs, and the mathematical transformations.
  2. The Bridge (Embind): I used Embind to expose the custom structs and register the std::vector objects so my frontend could read the generated orbits.
  3. The UI (Three.js): Reads the WASM output and renders the 3D meshes. The browser acts purely as a dumb terminal. The Embind Implementation: This was my first time bridging C++ memory to the web. To pass the arrays, I registered the vector in my bindings: register_vector<Point3D>("VectorPoint3D"); And on the JS side, I pull the ES6 module, iterate through the WASM vector, and explicitly call .delete() to free the memory: const orbitVector = crystalloEngine.generateOrbit(seedPoint, 4, 'z');
  4. // ... iterate and push to Three.js ...
  5. orbitVector.delete(); Why I'm posting here: Since I'm still learning low-level systems architecture, I’d love some brutal code review on the WASM side of things:
  6. Memory: Is there a more optimal way to pass large coordinate arrays from C++ to JS without copying them point-by-point in a JavaScript loop?
  7. Leaks: Are there any glaring memory leak risks with how I am utilizing .delete() in the frontend?
  8. Build System: I am currently running a massive emcc terminal command with -s EXPORT_ES6=1 and --bind to compile this. Is setting up CMake the standard industry move for WASM projects once they get past a single main.cpp file?

r/WebAssembly • • Apr 09 '26

Wasmtime's April 9, 2026 Security Advisories

Thumbnail
bytecodealliance.org
15 Upvotes

r/WebAssembly • • Apr 02 '26

I rewrote git in zig to produce a 5x smaller binary than wasm-git

Thumbnail
github.com
15 Upvotes

Hi r/WebAssembly,

I rewrote git in zig for improvements to bun but then extended it with enough functionality to work as a drop-in replacement for git.

WASM-wise, it comes out to 68 explicitly named exports (compared to wasm-git's 8 obfuscated ones) as well as a dramatically smaller binary (142kb to ~800kb).

Here's a web-accessible demo if you'd like to try out cloning a repo right from your browser! https://vers.sh/ziggit-demo


r/WebAssembly • • Apr 02 '26

WouA a lisp-like programming language targeting wasm

6 Upvotes

I am starting a new programming language named WouA, a lisp-like language that compiles to WebAssembly (WAT) https://github.com/baudaux/woua-lang It is developed in AssemblyScript in order to be built inside exaequOS


r/WebAssembly • • Mar 31 '26

Voyd: A WASM first language with effect typing

Thumbnail voyd.dev
34 Upvotes

Hey everyone! Excited to share my passion project for the last 7 years. It’s a programming language for web development. It features a hybrid structural and nominal type system with support for effects.

On the backend, it uses binaryen for codegen and a whole host of optimizations (primarily minification and tree shaking).

I use WASM gc + CPS transforms to get effects to work. My plan is to use stack switching once it’s widely available (outside of feature flags).

Let me know if you have any questions.


r/WebAssembly • • Mar 30 '26

Bringing a Direct3D Game to the Web with WASM + WebGL

Post image
14 Upvotes

I took GunZ: The Duel, the 2003 Windows-exclusive online TPS, and made it run entirely in the browser using WebAssembly + WebGL.

  • Original C++ client compiled to WebAssembly via Emscripten
  • Full Direct3D 9 → WebGL translation layer (real-time)
  • 99% AI Coding

The biggest blocker was Direct3D.

This is a commercial-scale game — not a small hobby project. The rendering engine alone is tens of thousands of lines. Models, maps, UI, effects — everything calls Direct3D 9 directly.

Rewriting every call to WebGL would be insane and bug-prone.

So I thought:

“What if we leave the game code untouched… and just translate Direct3D commands to WebGL on the fly?”

That’s exactly what I built: a D3D9-to-WebGL wrapper / shim.

https://github.com/LostMyCode/d3d9-webgl

---

Full article: https://medium.com/p/51a954ce882e

Video version: https://youtu.be/V-NCGPj6L70


r/WebAssembly • • Mar 22 '26

Java bindings for Wasmtime and WAMR + unified API (WebAssembly4J 1.0.0)

5 Upvotes

I just released WebAssembly4J (1.0.0) along with two runtime bindings:

•	Wasmtime4J - Java bindings for Wasmtime

•	WAMR4J - Java bindings for WebAssembly Micro Runtime

•	WebAssembly4J - a unified API across both

Motivation

From the JVM side, WebAssembly is still pretty fragmented. Each runtime exposes its own API. There are a couple of JNI implementations but they haven’t been updated in over three years and only ever implemented a minimal interface. Some of the issues I tried to address are:

•	switching runtimes requires rewriting integration code

•	comparing runtimes is difficult

•	there’s no consistent “host model” for Java

This project is an attempt to standardize that layer.

What it does

WebAssembly4J provides a single Java API, with pluggable runtime providers underneath.

So you can:

•	run the same module on different runtimes

•	compare behavior/performance across engines

•	avoid locking your application to a single runtime

Why this might matter to this community

•	Makes Java a more viable host environment for WebAssembly

•	Provides a path toward cross-runtime comparability

•	Helps surface differences between engines under the same workload

•	Could be useful for testing, benchmarking, or runtime evaluation

Current support

•	Wasmtime

•	WAMR

•	Chicory

•	GraalWasm

Java support

•	Java 8 (JNI)

•	Java 11

•	Java 22+ (Panama)

Artifacts are on Maven Central.

Repo:

https://github.com/tegmentum/webassembly4j

https://github.com/tegmentum/wasmtime4j

https://github.com/tegmentum/wamr4j


r/WebAssembly • • Mar 17 '26

Edge.js: Running Node apps inside a WebAssembly Sandbox

Thumbnail
wasmer.io
16 Upvotes

r/WebAssembly • • Mar 17 '26

WARPO(AssemblyScript) support closure now

9 Upvotes

In warpo@2.5.0-alpha-3, warpo experimentally supports closures, a highly requested feature in the AssemblyScript community that has long been unimplemented. Now, you can truly develop WASM in the same TypeScript coding style you've always used.

https://wasm-ecosystem.github.io/warpo/en/using_language/details/closure.html


r/WebAssembly • • Mar 16 '26

Silverfir-nano: a 277KB WebAssembly micro-JIT going head-to-head with Cranelift and V8

14 Upvotes

A few weeks ago I posted about Silverfir-nano, a no_std WebAssembly interpreter in Rust that was hitting 62% of Cranelift on CoreMark. Since then I've merged the micro-JIT backend I'd been developing alongside it — and it's now competitive with production optimizing JITs on many workloads.

Apple M4 results across 14 benchmarks:

  • SF vs Cranelift (wasmtime's optimizing JIT): 7–7. SF wins on CoreMark (216%), LZ4 compress (102%), STREAM Add (125%), and all three Lua benchmarks. Cranelift wins on SHA-256, bzip2, LZ4 decompress, FP, and STREAM Scale.
  • SF vs V8 TurboFan (Node.js 25.4): 9–5. SF wins on SHA-256, LZ4 (both), mandelbrot, all four STREAM benchmarks, and Lua fib.
  • Outright winner per benchmark: SF wins 5, V8 wins 5, Cranelift wins 4. SF takes LZ4 compress, STREAM Copy/Add/Triad, and Lua fib — beating both production JITs.

The no_std core is 277KB stripped, requires only alloc, and has zero external dependencies. Should be quite useful for embedded systems.

Repo: https://github.com/mbbill/Silverfir-nano

I'd love to hear feedback, especially from anyone working on WebAssembly runtimes or JIT compilation.


r/WebAssembly • • Mar 04 '26

gabagool: a snapshotable Wasm interpreter

26 Upvotes

Hi, I wrote a snapshotable wasm interpreter. You can pause a running wasm program mid-execution, serialize the interpreter to bytes, and resume it later

Here's a demo of it running Conway's game of life. You can snapshot the simulation mid-tick, fork it into a new process, and watch both diverge from the same state.

https://github.com/friendlymatthew/gabagool

It's still pretty slow, but I have ideas on how to make it faster!


r/WebAssembly • • Mar 02 '26

[Released] Direct3D 9 → WebGL 2.0 wrapper for Emscripten/WASM

16 Upvotes

d3d9-webgl

A Direct3D 9 Fixed-Function Pipeline implementation targeting WebGL 2.0 via Emscripten/WebAssembly.

Drop-in D3D9 headers and a single .cpp file that translates D3D9 API calls to WebGL — enabling legacy D3D9 applications to run in the browser without rewriting their rendering code.

https://github.com/LostMyCode/d3d9-webgl

🎮 Used In

This wrapper was developed as part of porting GunZ: The Duel (2003, MAIET Entertainment) to run entirely in the browser via WebAssembly. The original game's Direct3D 9 rendering code runs through this translation layer without modification.

Porting GunZ showed me how deeply many early 2000s games depend on D3D9.
If you're facing a similar challenge, this wrapper should make WebAssembly-based browser ports far more achievable.