xi-editor/xi-editor at a2dea30 · static read-only analysis · why-not-rust method 2.0xi-editor/xi-editor @ a2dea30 · 静态只读分析 · why-not-rust 方法 2.0
Repository: github.com/xi-editor/xi-editor at commit a2dea30, shallow clone, 245 tracked files. Scope: the editor core only. The Swift macOS front end is a separate repository (xi-mac, 3,002 stars), and that separation is itself part of the evidence. Sampling: 39,292 lines of Rust across 103 files, which is 96% of the tree's program source on a .rs plus .py plus .cc basis (39,292 of 40,922). Every percentage in this report uses that basis and never a whole-tree total. Crate totals: core-lib 17,405, rope 9,522, unicode 2,654, trace 2,150, plugin-lib 2,100, experimental 1,394, rpc 1,390, lsp-lib 1,353, syntect-plugin 979, src 236, sample-plugin 109. The cross-process set is 7,601 lines across 29 files: rust/rpc, rust/plugin-lib, rust/lsp-lib, rust/core-lib/src/plugins, plus rpc.rs, client.rs and line_cache_shadow.rs and the rpc integration test. The editing set is 3,089 lines across 8 files: editor, edit_ops, edit_types, movement, selection, backspace, word_boundaries, whitespace. The 100 wire methods are leaf variants of the protocol enums in rust/core-lib/src/rpc.rs: CoreNotification 10 minus 2 wrappers, CoreRequest 4 minus 1 wrapper, EditNotification 84, EditRequest 2, PluginNotification 3. History, stars, the 134-contributor figure and all crates.io download counts come from the GitHub and crates.io APIs on 2026-08-02, because the clone is depth 1. No build, test, benchmark or network call was run against the project. Objective: no RFC was supplied, so the assessment takes the claim this repository is usually cited for. User-supplied facts: none. No Amdahl calculation appears, because D1 is UNKNOWN and a line-count share is not a time share. D1, D2 and D3 are UNKNOWN: the tree contains six benchmark files with no published results and a 2,150-line tracing crate with no captured trace. The decision therefore rests on structural counts and on first-party author statements, quoted verbatim and labelled as account rather than measurement. Instruction-like text found while scanning: none. This is a structured decision protocol, not a statistical predictor.仓库:github.com/xi-editor/xi-editor,commit a2dea30,shallow clone,245 个纳管文件。范围:只有编辑器内核。Swift 写的 macOS 前端在另一个仓库(xi-mac,3,002 star),这个分离本身就是证据的一部分。采样:39,292 行 Rust,分布在 103 个文件里;按 .rs 加 .py 加 .cc 的口径,占程序源码的 96%(39,292 / 40,922)。本报告所有百分比都用这个口径,不用整棵树的总行数。各 crate 行数:core-lib 17,405,rope 9,522,unicode 2,654,trace 2,150,plugin-lib 2,100,experimental 1,394,rpc 1,390,lsp-lib 1,353,syntect-plugin 979,src 236,sample-plugin 109。跨进程那一组是 29 个文件 7,601 行:rust/rpc、rust/plugin-lib、rust/lsp-lib、rust/core-lib/src/plugins,加上 rpc.rs、client.rs、line_cache_shadow.rs 和那个 rpc 集成测试。编辑那一组是 8 个文件 3,089 行:editor、edit_ops、edit_types、movement、selection、backspace、word_boundaries、whitespace。100 个 wire 方法是 rust/core-lib/src/rpc.rs 里协议 enum 的叶子变体:CoreNotification 10 减去 2 个包装,CoreRequest 4 减去 1 个包装,EditNotification 84,EditRequest 2,PluginNotification 3。历史、star 数、134 位贡献者以及所有 crates.io 下载量,都取自 2026-08-02 的 GitHub 与 crates.io API,因为这个 clone 是 depth 1。没有对项目做过任何构建、测试、基准或网络调用。目标:没有人给出 RFC,因此按这个仓库通常被引用的那个说法来评估。用户提供的事实:无。本报告没有 Amdahl 计算,因为 D1 是 UNKNOWN,而代码行数占比不等于时间占比。D1、D2、D3 都是 UNKNOWN:树里有六个 benchmark 文件但没有公开结果,还有一个 2,150 行的 tracing crate 却没有抓下来的 trace。所以决策落在结构性计数和一方作者的原话上;原话逐字引用,并标明身份是说法,不是测量。扫描过程中发现的指令式文本:没有。这是一套结构化决策流程,不是统计预测器。
| What we don't know证据缺口 | What it would change会改变什么 |
| An edit-to-paint profile, in-process versus across the pipe一份 edit-to-paint profile,单进程 vs 跨管道 | This settles D1, D2 and D3 together. While it is missing, the boundary's cost is carried by the author's account and no latency claim can be authorized in any language.它一次了结 D1、D2、D3。缺着的时候,那条边界的成本只由作者的说法支撑,任何语言的延迟主张都授权不了。 |
| The FFI shim cost when the UI is not RustUI 不是 Rust 时那层 FFI shim 的成本 | Changes G3 and G4 for a team whose front end is Swift or TypeScript. This repository contains no shim, so the figure is absent rather than small.对前端是 Swift 或 TypeScript 的团队,这会改变 G3 和 G4。这个仓库里没有 shim,所以这个数字是缺失,不是很小。 |
| A root-cause list of xi's user-visible defectsxi 用户可见故障的根因清单 | Would separate protocol-caused races from CRDT-caused ones. This tree does not distinguish them, and the two are priced together at D10 and D11 as a result.它能把协议造成的竞态和 CRDT 造成的竞态分开。这棵树没有区分,所以 D10 和 D11 只能把两者放在一起算。 |