Why not rewrite ESLint in Rust?

(github.com)

32 points | by ksec 33 minutes ago

10 comments

  • david_p 4 minutes ago
    In case some people here are unaware, this project seems relevant to the conversation: https://oxc.rs/docs/guide/usage/linter

      Oxlint is a high-performance linter for JavaScript and TypeScript built on the Oxc compiler stack. 
      Oxc: The Oxidation Compiler is a collection of high-performance tools for JavaScript and TypeScript written in Rust.
  • geraldwhen 10 minutes ago
    ESLint is so slow and an absolute dog on memory on large codebases.

    Everyone will move on if they don’t move with the times.

    • etatester 0 minutes ago
      That's a what's going to happen. Eslint will make snail-paced improvements while drop-in replacements will show up every other month.
  • thimabi 7 minutes ago
    > When someone asks, “why don’t you rewrite ESLint in Rust?” what they’re really asking is, “why can’t ESLint be faster?” […] People have equated Rust with fast executables, so instead of asking the real question, they jump directly to what they believe is the solution. Rust is fast, ESLint is not, therefore ESLint built on Rust is the answer.

    I’ve never heard this framed in this way and this is, in fact, a very powerful argument. Rust code benefits from memory safety, from the compile-time guarantees that make it easier for AI agents to write and maintain it… but at the end of the day many people like Rust mostly because it facilitates building more performant software.

    I wonder if the vast majority of that performance boost could be obtained if efforts were directed towards improving programs in their own language, like the ESLint team is doing, rather than going straight for a full-on rewrite in Rust. My nagging suspicion is that this is very much possible, as seen for instance in VS Code pushing the boundaries of Electron apps. But that does require some effort.

    • insanitybit 0 minutes ago
      > I wonder if the vast majority of that performance boost could be obtained if efforts were directed towards improving programs in their own language, like the ESLint team is doing, rather than going straight for a full-on rewrite in Rust. My nagging suspicion is that this is very much possible, as seen for instance in VS Code pushing the boundaries of Electron apps. But that does require some effort.

      I just don't think so, personally. You just really don't have to try when it comes to things like 0 allocation in Rust, and when you do put in effort it's for things like explicit SIMD. For something like typescript you have to put in a lot of effort for 0 allocations and then something like explicit SIMD just isn't really on the table.

      In Rust I have real threads, I can manage IO, etc.

      I'm sure you can push these languages and runtimes very far but there just are limits.

      I've seen this so many times. Even with binaries or services that people say spend 90% of time in IO, I've sped them up with naive ports to Rust. Why? Because IO in Rust is going to be faster - freeing up your event loop by reducing contention will reduce latency, reducing allocations will reduce latency, control over task allocation will reduce latency, etc. I've just seen it too many times where "it's just a dumb pipe between services, language doesn't matter" turns out to be "language bound".

  • ch4s3 9 minutes ago
    I think the idea that dogfooding is a core reason to stay in js is very reasonable given the nature of the tool.
    • NuclearPM 7 minutes ago
      I’m not sure where your missing comma is supposed to go.
      • minitech 3 minutes ago
        There’s no missing comma. Of the two valid bracketings, only one makes sense, so it’s not that hard to find. Here you go anyway:

        > I think ([the idea that {dogfooding is a core reason to stay in js}] is very reasonable given the nature of the tool).

      • nhinck3 6 minutes ago
        parenthetical commas around "that dogfooding is a core reason to stay in js"
  • eterm 17 minutes ago
    This is a decent enough explanation, it's not dogmatic or anti-AI, just a calm explanation of where they stand.
  • etatester 8 minutes ago
    Sure, nobody has time, everyone is a volunteer, nevermind the $100k/year being donated to eslint.

    The rest reads like a bunch of excuses. It's clear that linting via rust is very much possible, you're only lacking intent. Which is perfectly fine, but at least be honest.

    A good way forward would be for oxlint to reach 100% and for it to be merged into eslint's repo. But of course that would hurt OP's feelings.

    • throw-the-towel 6 minutes ago
      100k/year would barely cover one full-time dev.
      • etatester 4 minutes ago
        Still very far from "everyone is a volunteer." $100k should go a very long way with AI
  • fwlr 5 minutes ago
    Rewriting ESLint in Rust will produce up to 1 Rust-based JavaScript linters.

    Not rewriting ESLint in Rust has already produced >1 Rust-based JavaScript linters and that number will likely continue to increase.

    Therefore both parties’ needs are best served by not rewriting.

  • chpatrick 15 minutes ago
    There's oxlint for that.
  • sherburt3 22 minutes ago
    The worst part about rust is rust evangelists
    • sevenzero 16 minutes ago
      Idk considering we get like 1 once a decade CVE every week now, mostly due to using tech that doesn't have secure memory access, it kinda makes sense to switch shit to Rust.
      • eterm 8 minutes ago
        It makes sense to switch from non-memory safe languages to memory safe languages.

        If ESLint were written in C that'd be a compelling (ish) argument.

        But ESLint is written in Javascript, and doesn't suffer from memory access issues at this layer.

        Now if you'd said, "Let's re-write V8 in rust", then you'd have a reason to argue for memory safety.

        • sevenzero 6 minutes ago
          Well OPs comment wasnt about ESLint was it?
    • Ygg2 18 minutes ago
      Categorically false.

      Worst part about Rust is vibe coders using Rust, while hating the language.

      • _tardigrade_ 10 minutes ago
        we rewrote most our internal apps to rust and we dont even have one rust developer
        • carlos-menezes 5 minutes ago
          "we" is doing a lot of heavy lifting there.
      • orbital-decay 8 minutes ago
        Actual vibecoders are probably ambivalent since they don't read the code anyway.
  • morkalork 11 minutes ago
    Very reasonable take