explaingit

zed-industries/embedded_gpui

Analysis updated 2026-05-18

21RustAudience · developerComplexity · 5/5LicenseSetup · moderate

TLDR

An experimental Zed spike that runs GPUI plugins inside a WebAssembly sandbox and renders them natively.

Mindmap

mindmap
  root((embedded_gpui))
    What it does
      GPUI plugins in Wasm
      Native rendering of plugins
      Shared object model
    Tech stack
      Rust
      GPUI
      WebAssembly
      wasmtime
    Use cases
      Prototype plugin system
      Study capability security
      Run shared counter demo
      Explore Zed extensions
    Audience
      Rust developers
      Zed contributors
    Setup
      Add wasm32-wasip2 target
      cargo run example_host
    Status
      Experimental spike
      Apache 2.0 licensed

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Prototype a sandboxed UI plugin system for a native Rust GPUI application.

USE CASE 2

Study a capability based object model for safely sharing state across a WebAssembly sandbox.

USE CASE 3

Run the demo host to see two sandboxed plugin views and a native button share one counter.

USE CASE 4

Explore how Zed might support third party editor extensions with real UI.

What is it built with?

RustGPUIWebAssemblywasmtime

How does it compare?

zed-industries/embedded_gpuiavelino/roam-tuidanilaa1/auditkit
Stars212121
LanguageRustRustRust
Setup difficultymoderateeasymoderate
Complexity5/53/53/5
Audiencedeveloperdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires the wasm32-wasip2 Rust target and a custom git branch of GPUI from the Zed repository.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

embedded_gpui is an experimental spike from Zed Industries exploring how the Zed code editor could support UI plugins. GPUI is the Rust UI framework that powers Zed itself, and this project makes it possible to write an ordinary GPUI program, compile it to a WebAssembly component, and have a host application render it as if it were just another element inside its own native window. The plugin has full access to GPUI's normal building blocks: entities, layout elements, flexbox style positioning, input handling, and async tasks, all running inside a sandboxed WebAssembly module. On the guest side, the plugin gets its own miniature GPUI platform inside the sandbox, covering windows, saved lists of what to draw, mouse and keyboard input, timers, async tasks, SVG and image rendering, and text where the actual font rendering happens on the host. The host side loads the compiled plugin with the wasmtime WebAssembly runtime, replays what the plugin wants to draw using real native GPUI drawing calls, and never needs to call back into the plugin just to render a frame. A central design idea is a shared object model that lets the host and the plugin refer to each other's data safely across the sandbox boundary. Each side exposes one root object at a fixed starting point, and everything else is discovered by making typed method calls from there, rather than by name or by direct memory access. Object references are random 64 bit numbers, so a plugin cannot guess or access something it was never explicitly given a reference to. Utility patterns built on top of this include revocable access, allowlisted access, an audit log of calls, and a local read only mirror of remote state. The repository ships a runnable demo. After installing the wasm32-wasip2 Rust compilation target, running the example host builds and loads a demo plugin automatically, showing a window with two plugin rendered views and one native button, all mutating the same shared counter to demonstrate the object model in action. The project depends on a custom branch of the GPUI library from the main Zed repository while a small required change is still waiting to be merged upstream. The authors are explicit that this is an early, unstable experiment, not a supported plugin API yet, and it is released under the Apache 2.0 license, matching GPUI itself.

Copy-paste prompts

Prompt 1
Explain how the shared object model in this project lets host and plugin call each other safely.
Prompt 2
Walk me through the WIT protocol defined in embedded_gpui/wit/plugin.wit.
Prompt 3
Help me set up the wasm32-wasip2 target and run the example_host demo.
Prompt 4
Explain the difference between Revocable, Attenuated, Audited, and Mirror in embedded_gpui_util.
Prompt 5
Show me what a minimal GPUI plugin compiled for this system would look like.

Frequently asked questions

What is embedded_gpui?

An experimental Zed spike that runs GPUI plugins inside a WebAssembly sandbox and renders them natively.

What language is embedded_gpui written in?

Mainly Rust. The stack also includes Rust, GPUI, WebAssembly.

What license does embedded_gpui use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is embedded_gpui to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is embedded_gpui for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.