Post

This is an Electrobun video game app i vibe coded - 800 lines of typescript in bun - 1 bunny logo, carrots are generated - uses Electrobun's built-in Babylon adapter * wgpu window - no webviews - dmg is 21MB (basically the bun runtime + wgpu compressed) - updates as small as 4KB

YoavCodes@yoav.codes

three.js is nice, but what about a robust adapter for working with Babylon’s WebGPUEngine directly from bun without needing a webview.

Curious how that works. What's it rendering into if not a web view? I may be operating under the false assumption that webgpu only works on the client. In any case, awesome stuff

set bundleWgpu:true in next release it adds the wgpu dynamic library to your bundle. bun api ffi to objc/c++ opens a native window with native surface (on mac it’s a metal layer) Then use bun ffi to wgpu directly. renders to that surface. I provide threejs and babylon adapters. bun->webgpu

0 reposts1 like

My intuition when i started was that there was no way it would just work and that the browser must be doing a bunch of other stuff. What’s cool is because it’s bun->wgpu in theory should be able to non-graphical ML stuff from bun. I feel like the unlock here is bigger than I originally thought.