November 5, 2025
This tree started a language fight
Intervaltree with Rust Back End
Rust turbocharges range lookups; Python cheers, TS side‑eyes
TLDR: A Rust-built interval tree now plugs into Python, promising faster overlap searches and an easy install. Commenters split between Rust speed hype, TypeScript devs sharing their own libs and considering a move, and a C++ old‑guard nod to Boost—making it a cross‑language performance face‑off worth watching.
A new Rust-powered “interval tree” just landed in Python, promising faster searches for overlapping ranges—think calendar time slots or DNA segments—with a simple install and a drop‑in feel. The dev behind it is flexing hard, calling it “significantly faster” than Python’s version and teasing classic balancing tricks (AVL and red‑black trees) to push speed even more. Cue the comment section turning into a language family reunion—with side‑eye. TypeScript fans dropped receipts, like this TS library, while admitting they might “move some functionality from TS -> Rust” if the hype checks out. Python folks are vibing with the easy setup—pip it, import it, search overlaps—and the ability to add and delete ranges like it’s nothing. Meanwhile, a C++ veteran calmly slid in with a link to Boost’s interval library, praising its “excellent API” and reminding everyone that C++ had a seat at this table long before Rust was cool: Boost ICL. The mood? Equal parts speed-chasing and toolbox bragging. The jokes write themselves: Rust as the gym bro, TS as the influencer plugging their own product, and C++ as the wise uncle clutching decades of benchmarks. Drama level: civil, but spicy enough to click.
Key Points
- •intervaltree_rs provides a Rust-implemented interval tree accessible in Python via PyO3.
- •Requirements include a Rust toolchain, Python 3.8+, and maturin for building and installation.
- •Installation can be done via pip or by using maturin develop to build and install in a virtual environment.
- •The API supports building from tuples, inserting intervals, searching overlaps (inclusive/exclusive), and deleting by (left, right) key.
- •A distributable wheel can be built with maturin build --release, and tests are run using cargo test.