Photon

An agent-native app runtime and rendering engine written in Zig. Custom HTML, CSS, layout, and paint — no WebView, no Blink, no WebKit.

VS Code on Photon vs Electron

VS Code rendered by Photon
Photon 387 MB · 1 process · 2.6s boot
VS Code on Electron
Electron 1,326 MB · 17 processes
3.4×
less memory at boot
17×
fewer processes
480 MB
peak RSS (Photon)
2.6s
boot to ready
VS Code syntax highlighting rendered by Photon

Photon's rendering pipeline: HTML → CSS → style resolution → layout → display list → paint. 137 text commands, correct syntax colors, font shaping via HarfBuzz + FreeType.

The rendering pipeline

HTML CSS Style Resolution Layout Display List Paint Metal

Layout engine

Block, inline, flexbox, grid, absolute/fixed positioning, margin collapsing, box-sizing.

CSS resolver

Selectors, specificity, cascade, inheritance, var() custom properties, viewport units.

Text shaping

HarfBuzz + FreeType cross-platform. @font-face, icon fonts, glyph atlas caching.

JavaScript runtime

JavaScriptCore with DOM stubs. VS Code's 35MB bundle evaluates and produces live DOM.

Metal rendering

Native macOS window with CAMetalLayer. Software renderer for headless and testing.

Written in Zig

Zero-cost C interop, no GC, comptime generics. The entire pipeline from HTML to pixels.

Current status

VS Code workbench renderingWorking
Live JS evaluation + DOMWorking
Keyboard/mouse input → JSWorking
Writable editor demoWorking
Explorer tree populationIn progress
Pixel fidelity vs Electron15% SSIM
Headless control planePlanned
Agent-native semanticsPlanned