Xref.rs - Erlang static analysis in Rust
summary
Reimplements xref analysis in Rust to drop end-to-end check from ~30 minutes to about 200 ms on a large codebase by reading .beam imports/exports tables instead of parsing full debug ASTs, loading expensive debug info only for modules with detected problems, and using string interning plus rayon parallelism. Prototype still misses rebar ignore handling and precise release parsing, spends most time loading beams, and plans optimizations like lazy loading, bespoke beam parsers and smaller per-module allocations.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 0:25Erlang Rust Beam integration
- 1:11Undead error problem
- 2:17Early vs late binding
- 5:06Late binding benefits
- 7:14Xref tool overview
- 9:21Xref limitations
- 10:03Release analysis challenges
- 13:25Optimizing analysis
- 15:31BEAM file structure
- 18:43Naive analysis approach
- 20:51Import and export tables
- 22:43Separating detection and reporting
- 24:50Why Rust for xref.rs
- 28:49Data loading vs analysis
- 31:58Performance results
- 33:26Developer experience impact
- 35:53Future improvements
- 40:15Key takeaways
- 41:20Q&A session
related talks
22mFearless Refactoring
27mParsing Rust code considered harmful
21mExtending the horizons of R with Rust
29mREVIS: An Error Visualization Tool for Rust
34mInfERL: Scalable and Extensible Erlang Static Analysis
28mC2Rust: Migrating Legacy Code to Rust
11mEasy analysis of Rust code with Charon
52mRefactorErl supports your Daily Work!
