hn.today

Why not rewrite ESLint in Rust?

github.com246 points221 comments
Screenshot of Why not rewrite ESLint in Rust?

A complete Rust rewrite of ESLint is not a practical way to make it faster, argues maintainer Nicholas Zakas. ESLint is maintained by volunteers, often with only a few hours a week to spare, so a rewrite would compete with essential ongoing work. It would also require current JavaScript-focused contributors to learn Rust, likely reducing participation and making it harder for JavaScript developers to contribute fixes and features. The change could weaken ESLint’s “dogfooding”: maintaining ESLint with ESLint helps the team encounter users’ problems firsthand and generates internal bug reports and feature ideas.

A rewrite would also have to preserve ESLint’s JavaScript ecosystem of custom rules, parsers, plugins, and processors; running existing npm packages from Rust would be technically difficult, while dropping compatibility would leave the tool far from usable. Rather than treating Rust as the answer to performance, Zakas points to inefficiencies in JavaScript execution, including garbage collection, deoptimizations, and slow coding patterns. Optimizing those areas has already produced a reported 9-10% speedup in AST traversal on large codebases, with further improvements planned. Rust remains an option for targeted native Node.js modules: a TypeScript parser written in both TypeScript and Rust can test whether that approach helps without replacing ESLint’s core. A wholly new Rust project could avoid inherited constraints, but Zakas says he lacks the health, time, and financial support to lead one.

Read on github.com221 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.