Hacker News Viewer

Show HN: Mystral Native – Run JavaScript games natively with WebGPU (no browser)

by Flux159 on 1/27/2026, 6:33:05 PM

Hi HN, I&#x27;ve been building Mystral Native — a lightweight native runtime that lets you write games in JavaScript&#x2F;TypeScript using standard Web APIs (WebGPU, Canvas 2D, Web Audio, fetch) and run them as standalone desktop apps. Think &quot;Electron for games&quot; but without Chromium. Or a JS runtime like Node, Deno, or Bun but optimized for WebGPU (and bundling a window &#x2F; event system using SDL3).<p>Why: I originally started by starting a new game engine in WebGPU, and I loved the iteration loop of writing Typescript &amp; instantly seeing the changes in the browser with hot reloading. After getting something working and shipping a demo, I realized that shipping a whole browser doesn&#x27;t really work if I also want the same codebase to work on mobile. Sure, I could use a webview, but that&#x27;s not always a good or consistent experience for users - there are nuances with Safari on iOS supporting WebGPU, but not the same features that Chrome does on desktop. What I really wanted was a WebGPU runtime that is consistent &amp; works on any platform. I was inspired by deno&#x27;s --unsafe-webgpu flag, but I realized that deno probably wouldn&#x27;t be a good fit long term because it doesn&#x27;t support iOS or Android &amp; doesn&#x27;t bundle a window &#x2F; event system (they have &quot;bring your own window&quot;, but that means writing a lot of custom code for events, dealing with windowing, not to mention more specific things like implementing a WebAudio shim, etc.). So that got me down the path of building a native runtime specifically for games &amp; that&#x27;s Mystral Native.<p>So now with Mystral Native, I can have the same developer experience (write JS, use shaders in WGSL, call requestAnimationFrame) but get a real native binary I can ship to players on any platform without requiring a webview or a browser. No 200MB Chromium runtime, no CEF overhead, just the game code and a ~25MB runtime.<p>What it does: - Full WebGPU via Dawn (Chrome&#x27;s implementation) or wgpu-native (Rust) - Native window &amp; events via SDL3 - Canvas 2D support (Skia), Web Audio (SDL3), fetch (file&#x2F;http&#x2F;https) - V8 for JS (same engine as Chrome&#x2F;Node), also supports QuickJS and JSC - ES modules, TypeScript via SWC - Compile to single binary (think &quot;pkg&quot;): `mystral compile game.js --include assets -o my-game` - macOS .app bundles with code signing, Linux&#x2F;Windows standalone executables - Embedding API for iOS and Android (JSC&#x2F;QuickJS + wgpu-native)<p>It&#x27;s early alpha — the core rendering path works well &amp; I&#x27;ve tested on Mac, Linux (Ubuntu 24.04), and Windows 11, and some custom builds for iOS &amp; Android to validate that they can work, but there&#x27;s plenty to improve. Would love to get some feedback and see where it can go!<p>MIT licensed.<p>Repo: <a href="https:&#x2F;&#x2F;github.com&#x2F;mystralengine&#x2F;mystralnative" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mystralengine&#x2F;mystralnative</a><p>Docs: <a href="https:&#x2F;&#x2F;mystralengine.github.io&#x2F;mystralnative&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mystralengine.github.io&#x2F;mystralnative&#x2F;</a>

https://github.com/mystralengine/mystralnative

Comments

by: auyez

Great project! I also had similar thoughts when I saw ability to make WebGPU calls in deno. I wonder how performant could games get on this runtime

1/30/2026, 6:10:06 AM


by: iddan

Cool project and very clear explanation for the motivation kudos!

1/30/2026, 6:03:04 AM