Rope Optimizations, Part 1
Zed's Rope, a SumTree of 128-byte chunks, sped up offset-to-point translation by storing u128 bitmasks per chunk marking newlines, char boundaries and UTF-16 widths, replacing a per-character loop.
Zed's Rope, a SumTree of 128-byte chunks, sped up offset-to-point translation by storing u128 bitmasks per chunk marking newlines, char boundaries and UTF-16 widths, replacing a per-character loop.
Zed represents text positions with several coordinate types, each suited to a different job.
Zed represents buffer text with a rope rather than a string, because contiguous strings make mid-file inserts and deletes, line navigation and very large files expensive.
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.
Zed's weekly update covers a reworked search UI with semantic search, the start of WebAssembly extensions for custom language servers, and near-complete collaboration channels.
Zed builds its syntax-aware features on Tree-sitter, a GLR-based incremental parsing framework with error recovery that produces concrete syntax trees.
Zed grew out of Xray, the experimental editor Nathan Sobo and Antonio worked on at GitHub in 2018, and this weekly update recaps the path from there to a company and a private alpha.