---
title: "Life of a Zed Extension: Rust, WIT, Wasm"
description: "Zed extensions are written in Rust but never compiled on the user's machine."
url: "https://swe.quest/articles/life-of-a-zed-extension-rust-wit-wasm-ec148b04db708b5a"
canonical: "https://zed.dev/blog/zed-decoded-extensions"
source: "Zed"
published: "2024-10-21"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 21
tags: ["webassembly","rust","developer-tools"]
---

# Life of a Zed Extension: Rust, WIT, Wasm

A post on [Zed](https://swe.quest/sources/zed.md), published 2024-10-21, 21 min read, Deep dive. Original: [https://zed.dev/blog/zed-decoded-extensions](https://zed.dev/blog/zed-decoded-extensions)

## Summary

Zed extensions are written in Rust but never compiled on the user's machine. A CI step in the zed-industries/extensions repository runs a small extensions CLI that compiles each extension's Rust code to a Wasm component targeting wasm32-wasip1 and its Tree-sitter grammars to Wasm. It packages them with Tree-sitter query files into an archive plus a manifest.json, uploads both to S3, and zed.dev mirrors the manifests into a database for the in-editor extension list. The extension API is a hand-written Rust trait layered over types that wit\_bindgen generates at compile time from WIT definitions, so the WebAssembly Component Model can pass strings, records and resources like Worktree between the Wasm module and the Zed host.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [WebAssembly](https://swe.quest/tags/webassembly.md) (Languages)
- [Rust](https://swe.quest/tags/rust.md) (Languages)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)

## Prerequisites

- Rust traits and crates ([easy posts on Rust](https://swe.quest/tags/rust.md?difficulty=easy))
- WebAssembly basics ([easy posts on WebAssembly](https://swe.quest/tags/webassembly.md?difficulty=easy))

## Keywords

Zed, WIT, WebAssembly Component Model, wit-bindgen, Tree-sitter, WASI, Metals

## Related posts

- [Extensible Language Support in Zed - Part 1](https://swe.quest/articles/extensible-language-support-in-zed-part-1-13bc037c6f5096a9.md): Zed · 2024-04-18 · Medium · 7 min read · WebAssembly, Developer tools, Sandboxing & isolation, Compilers, Rust
  Zed loads third-party Tree-sitter grammars as WebAssembly modules using a hybrid design.
- [wasmbuild - Using Rust in Deno and Web Apps](https://swe.quest/articles/wasmbuild-using-rust-in-deno-and-web-apps-ea6b475b6d77519e.md): Deno · 2022-06-30 · Medium · 3 min read · WebAssembly, Rust, JavaScript, Build systems
  wasmbuild is a Deno-run CLI script that compiles Rust crates to WebAssembly via wasm-bindgen, generates JavaScript glue code with multiple loader strategies and lazy instantiation, and optimizes output with wasm-opt.
- [Intro to Wasm in Deno](https://swe.quest/articles/intro-to-wasm-in-deno-e9e470adfcfab289.md): Deno · 2025-01-28 · Medium · 4 min read · WebAssembly, Rust, JavaScript
  Deno 2.1 lets Wasm modules be imported directly like JavaScript modules, with their exports understood and typechecked.
- [Introducing Ruvy](https://swe.quest/articles/introducing-ruvy-a780cb3b4891bef0.md): Shopify Engineering · 2023-10-18 · Medium · 5 min read · WebAssembly, Ruby, Performance engineering, Open source
  Ruvy is an open-source toolchain built on ruby.wasm that compiles Ruby scripts into WebAssembly modules, pre-initializing the Ruby VM and preloaded Ruby files at build time instead of at startup.
- [We Have to Start Over: From Atom to Zed](https://swe.quest/articles/we-have-to-start-over-from-atom-to-zed-8db3be76f03d8a79.md): Zed · 2024-02-12 · Easy · 25 min read · Rust, Developer tools, Performance engineering, Data structures
  Zed's co-founders explain why they abandoned Atom's Electron/JavaScript stack and rebuilt a code editor in Rust: JavaScript's pointer-chasing arrays, uncontrollable GC pauses, and the costly JS/C++ boundary for multithreading made performance work feel like fighting the platform.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
