The Standard Library as Architecture
Arc<T>makes configuration, workspace data, strings, syntax trees, and query outputs cheap snapshot values.Mutex/RwLockare confined to caches and VFS views that genuinely cross worker boundaries.PathBufexists in project/VFS layers; semanticbase-dbuses opaqueFileId, preventing filesystem leakage.Option<T>is fundamental because incomplete Rust syntax is ordinary IDE input.Result<T, E>represents operational failure; parser APIs instead return a tree plus an error list.Box<dyn FnOnce()>type-erases heterogeneous worker jobs.- atomics count extant tasks and make lightweight revision/lifecycle observations.
Commandand child handles separate Cargo, rustfmt, flycheck, and proc macros from the analysis process.
The best lesson is negative capability: types make some dependencies impossible. The parser cannot query Salsa; semantic crates cannot discover paths; IDE return values do not leak syntax/HIR objects; only the binary crate serializes LSP.