I wrote a glob matcher in Rust as a JS native addon
I've been learning Rust for a while and wanted a real project to work onand i noticed that glob matching sits on the hot path of pretty much every JS bundler and file watcher, and picomatch is the go to library for that. It works great but it compiles patterns into regexes and leans on V8, which made me wonder if I could try a different approach in Rust.
So I built zeromatch. Instead of regexes it uses a small bytecode VM with fast paths for common patterns. The API is compatible with picomatch so you can mostly swap it in without changing code. It also supports matching directly against Buffers which avoids string conversion if you're working with raw fs output.
In benchmarks, one shot matching (compile + match once) is roughly 2x faster. For cached single matches picomatch still wins because of the FFI overhead crossing into native code. So it's not a "better in every case" thing, it depends on your workload.
Honestly this was mainly a learning project for me. I wanted to get more comfortable with Rust and napi-rs and this felt like a good excuse. It's at a point where it works and I'm using it, so figured I'd share it in case anyone finds it useful or has feedback.