DEV Community

Benchmark TypeScript Parsers: Demystify Rust Tooling Performance

Herrington Darkholme on November 23, 2023

TL;DR: Native parsers used in JavaScript are not always faster due to extra work across languages. Avoiding these overhead and using multi-core ar...
Collapse
 
artxe2 profile image
Yeom suyun

A few weeks ago, I tried ast-grep, but I ended up deleting it because I didn't think it could replace eslint.
Does ast-grep support linting for complex use cases?
Eslint's rules are based on JavaScript, so I was able to create rules that support auto-fixes for even extreme cases.

Collapse
 
herrington_darkholme profile image
Herrington Darkholme

ast-grep CLI is designed to support quick rule creation and ad-hoc code refactoring. It is not designed to replace eslint, indeed. However, you can create complex rule by using the @ast-grep/napi JS API!

Collapse
 
herrington_darkholme profile image
Herrington Darkholme

I am not sure how complex use cases you are mentioning. But ast-grep.github.io/catalog/ this page has a curated list of ast-grep rules. :)

Collapse
 
rdarrylr profile image
Darryl Ruggles

A great article! Itโ€™s nice to see #Rustlang being used in more and more places.

Collapse
 
conartist6 profile image
Conrad Buck

Check out BABLR! It's a developing alternative to tree-sitter designed to be a natural successor to Babel. No FFI or serde costs and it not only keeps ESLint's power and extensibility but combines it with Babel's. github.com/bablr-lang

It'll probably be another month or two before I have a working Typescript grammar and a stable version of the VM though.