Gleam-inspired typed configuration language (POC)
0

Configure Feed

Select the types of activity you want to include in your feed.

Document why editors/zed still has Rust.

Explain that Zed Install Dev Extension always cargo-builds a Rust guest, so
src/glint.rs is temporary; pure Gleam remains the target via the wasm fork.

+68 -7
+26
README.md
··· 89 89 90 90 **Zed** (dev extension in this repo — see also [`editors/zed/README.md`](editors/zed/README.md)): 91 91 92 + #### Why is there Rust under `editors/zed/`? 93 + 94 + Not because we want the extension authored in Rust. **Zed forces it today.** 95 + 96 + On **Install Dev Extension**, when `extension.toml` has `[lib] kind = "Rust"` 97 + (the only allowed kind), Zed always runs roughly: 98 + 99 + ```text 100 + cargo build --target wasm32-wasip2 101 + ``` 102 + 103 + and writes `extension.wasm` from that crate. There is **no** install path that 104 + only loads a prebuilt component from `gleam export zed-extension`. Without 105 + `Cargo.toml` + `src/*.rs` you get `failed to compile Rust extension`. 106 + 107 + So `editors/zed/src/glint.rs` is a **thin temporary guest** (same behaviour as 108 + `zed_glint.gleam`: resolve `glint`, start LSP). Direction of travel is pure 109 + Gleam via our [wasm fork](https://tangled.org/nandi.uk/gleam); the `.rs` crate 110 + can go once Zed accepts prebuilt guests (or we use another install path). 111 + 112 + | Path | Role | 113 + |------|------| 114 + | `editors/zed/src/glint.rs` | What Zed can compile and install **now** | 115 + | `editors/zed/src/zed_glint.gleam` | Target authoring surface (pure Gleam) | 116 + | [nandi.uk/gleam](https://tangled.org/nandi.uk/gleam) `wasm` | Compiler that builds a real `zed:extension` component | 117 + 92 118 ### 1. Build the glint binary 93 119 94 120 ```sh
+42 -7
editors/zed/README.md
··· 3 3 Zed extension for Glint — language config, tree-sitter highlighting (via 4 4 tree-sitter-gleam), and the glint language server. 5 5 6 + ## Why is there Rust code here? 7 + 8 + Not because we want the extension authored in Rust. **Zed forces it today.** 9 + 10 + On **Install Dev Extension**, when `extension.toml` has: 11 + 12 + ```toml 13 + [lib] 14 + kind = "Rust" 15 + ``` 16 + 17 + (`"Rust"` is the only allowed `kind`.) Zed always runs roughly: 18 + 19 + ```text 20 + cargo build --target wasm32-wasip2 21 + ``` 22 + 23 + and writes `extension.wasm` from that crate. There is **no** install path that 24 + only loads a prebuilt Wasm from `gleam export zed-extension`. 25 + 26 + Without `Cargo.toml` + `src/*.rs` you get: 27 + 28 + - `failed to compile Rust extension` (no Cargo.toml), or 29 + - invalid `kind` if you try anything other than `"Rust"`. 30 + 31 + So `src/glint.rs` is a **thin temporary guest** that implements the same idea 32 + as `src/zed_glint.gleam` (resolve `glint` on PATH / fallback, start the LSP). 33 + It is a **host/toolchain constraint**, not the product direction. 34 + 35 + | Path | Role | 36 + |------|------| 37 + | `src/glint.rs` | What Zed can compile and install **now** | 38 + | `src/zed_glint.gleam` | Target authoring surface (pure Gleam) | 39 + | [nandi.uk/gleam](https://tangled.org/nandi.uk/gleam) (`wasm` branch) | Compiler that builds a real `zed:extension` component | 40 + 41 + Once Zed accepts a prebuilt component (or we stop using Install Dev’s cargo 42 + path), the `.rs` crate can go away and the Gleam export path can own the guest. 43 + 6 44 ## Compile 7 45 8 46 ### Glint binary (LSP) ··· 12 50 nix build # → result/bin/glint 13 51 ``` 14 52 15 - ### Zed guest (Rust — what Install Dev Extension builds) 16 - 17 - Zed always runs `cargo build --target wasm32-wasip2` when 18 - `[lib] kind = "Rust"`. Local check: 53 + ### Zed guest (Rust — required for Install Dev Extension today) 19 54 20 55 ```sh 21 56 cd /home/nandi/code/glint/editors/zed ··· 42 77 ``` 43 78 44 79 See `docs/compiler/wasm-zed-extensions.md` in that repo. Until Zed can load a 45 - prebuilt guest without cargo, **Install Dev Extension still uses the Rust 46 - crate** (`src/glint.rs`). `src/zed_glint.gleam` is the pure-Gleam sketch. 80 + prebuilt guest without cargo, **Install Dev Extension still overwrites with the 81 + Rust build**. 47 82 48 83 ## Install in Zed 49 84 ··· 80 115 | Path | Role | 81 116 |------|------| 82 117 | `extension.toml` | Zed manifest | 83 - | `src/glint.rs` | Installable guest (`zed_extension_api`) | 118 + | `src/glint.rs` | Temporary installable guest (Zed cargo path) | 84 119 | `src/zed_glint.gleam` | Pure-Gleam authoring sketch | 85 120 | `languages/glint/` | Tree-sitter queries + language config | 86 121 | `extension.wasm` | Built component (Zed / cargo) |