Introducing vapors: Svelte-style components, drawn by Rust on the GPU

The blog post was written with the assistance of an LLM. If that's not your thing, other blog posts are available.

vapors is a GUI framework for Rust. You write Svelte-style single-file components (a script, an HTML template and scoped CSS) that compile to Rust and are drawn on the GPU, in a desktop window or in the browser. HTML, SVG and 3D share one frame, as the racer on vapors.dev shows.

It is coming up to a month old, and most of it was written by Claude agents in the time I have outside my day job. This is the story of vapors: what it is, and how and why I created it.

In the video a Claude session builds Toad Trip, a small 3D game, from the vapors agent skill. You can play what it built (desktop browser with WebGPU; arrow keys).

Why

In October I listened to Syntax episode 1047, where Wes Bos talked about a company that had clean-room ported the whole Adobe suite to Rust, UI included. He mentioned GPUI, the framework Zed is built on, which I had heard of but not looked at, and the general point landed with me: Rust-native, GPU-accelerated interfaces are a good target for agentic development. He also made the remark that stuck:

The replacement for Photoshop is going to be something that is a little bit different.

When I heard this I thought about what it would take to build a performant, multi-platform, Rust-based photo editor, and I went on to build an early version of it together with the vapors platform underneath it. Around then I also heard episode 1049, about software factories, where agents run as much of the development loop as possible. The first commits to vapors and touché (my in-development photo editing product) were on 22 October, an hour apart, and they set up the factory before any framework code: a pinned toolchain, CI, and a GPU test tier.

I had done quite a bit of agentic development before this, and had been gradually removing myself from the development loop to focus on the executive side: the customer's problem space and the design of the solution. This was the first time I had started a project with an explicit design for its software factory, and had agents build that factory.

Vapors follows two earlier projects aimed at the terminal. Sumi put Svelte-like components on Go, and svelterm renders actual Svelte to a cell grid. While working on those I did wonder whether the same approach could target full GUI rendering, but it seemed a bit preposterous. It is close to building a browser and a web framework at once, even if you move a lot of the work to compile time and accept far less dynamism and far fewer kinds of input than a browser has to handle.

Around 10 November, A Critique of GPUI measured how GPUI's update model scales and argued for components that run once, with signals, an approach that pays off when a compiler does the work. That was the design vapors had taken, and the article pushed me to make performance the priority. The target since has been one scene across HTML, SVG and 3D, all styled with CSS, where changing one thing costs work proportional to that change.

What made it quick

Earlier projects to draw on. svelterm and Sumi had already worked through single-file components with script, template and CSS compiled to something else, and the publishing side was a solved problem: vapors.dev is a SvelteKit and mdsvex site on S3 behind CloudFront, deployed by an OpenTofu pipeline, the same setup as this site.

Good open-source foundations. vapors does not write its own layout engine, text shaping or GPU abstraction. It builds on wgpu and naga for the GPU, winit for windows and input, Taffy for block, flex and grid layout, Parley, fontique and skrifa for text, and lyon for tessellating shapes. Its own work is the component compiler, the CSS engine, the retained element tree and drawing all of it as one scene.

Some foundations were left out on purpose. The closest project to vapors is Blitz, the native renderer behind Dioxus, which pairs Taffy and Parley with Stylo, the CSS engine from Servo that also runs in Firefox. Stylo is a general engine, built to resolve any stylesheet against any document at run time. vapors wants the opposite: CSS worked out as far as possible at build time, where the compiler knows every element a template can create and every class it can carry, and anything it does not support refused with a file and line rather than ignored. That needs a CSS engine of its own. The same reasoning ruled out Yoga (flexbox only, and C++ behind FFI) and Morphorm (its own layout model rather than CSS).

Chromium as the oracle. When an agent implements flex layout or an SVG path, "looks right" is not a test. vapors checks its behaviour against Chromium: a corpus of HTML and CSS rendered both ways and compared, and the accessibility tree and text input held to what Chromium does with the same markup. A developer, human or agent, should get what they would expect from the web, and the comparison catches it when they would not.

The factory first, on purpose. I had done plenty of agentic development before, but this time I built the factory explicitly before the framework, because the work has to keep moving in the hours I am not there. The first commits pin the toolchain and add the CI command, a GPU test tier and a pre-push hook. Since then every change goes the same way: tests first, with each new check proven by breaking the code it guards; an independent review agent reading the pull request; and a local gate that runs every CI step at the exact commit before it merges. So far that adds up to 28 crates, about 300,000 lines of Rust, nearly 6,000 tests and 32,000 lines of design documents and plans.

My time goes on design and taste. With the mechanics handled, the hours I do spend go on the decisions agents should not make alone: the system design, the trade-offs, what the API should feel like and what it should refuse.

What surprised me

Mostly how much progress Claude has made in the time. The factory has not stood still either: I have iterated on it as we went, and one week I rinsed the whole weekly usage limit in a couple of days. Tokens have not always been the bottleneck, though. Quite often it has been build capacity on the mini PC this all runs on, a 35 W Intel i5 with six cores and integrated UHD 630 graphics. Several agents compiling a large Rust workspace at once will fill that machine, and a fair amount of the factory's later tooling exists to queue builds and keep the disk from filling up. The same integrated GPU is what vapors measures its frame times on, so the slow box doubles as the benchmark.

Almost all of it has been driven by remote control from my phone, which fits well into the off hours and around family life. I set direction and answer questions in the gaps of the day, and the factory carries on in between.

That is probably my biggest takeaway. A fixed dev box that does the work, with me connecting to it remotely, has been very good for my productivity: the builds, the GPU, the agents and their state all stay in one place, and I can pick the work up from anywhere without setting anything up. I am also excited about what it opens up for a more collaborative way of developing, when the place the work happens is not one person's laptop.

Status

vapors is an early preview. Browser and desktop apps work today; phones, and a number of HTML elements, do not yet. The status page keeps the details and the numbers current.

If you see all agentic development as a bit of a slop fest, this probably is not for you. If you are curious, the repository is open, issues are very welcome, and a star helps people find it. vapors is a side project, and what limits its progress is tokens rather than time, so sponsorship turns directly into more of it being built.