5 ms·
In this case, I'm concerned that they're particularly naive to think that writing only parts of ESLint in Rust will be a win. My impression -- no firsthand exp
by rattray 4y ago
In this case, I'm concerned that they're particularly naive to think that writing only parts of ESLint in Rust will be a win.
My impression -- no firsthand experience -- is that the ser/des costs associated with FFI between node and rust when dealing with large objects like ASTs can eliminate most wins, especially if you have to go back and forth multiple times.
Related: https://zaplib.com/docs/blog_post_mortem.html https://zaplib.com/docs/blog_post_mortem.html
I'm also under the impression that most of the gains from rewriting Node into Go or Rust come from getting access to multithreading, which I can't imagine working well in this context if the ESLint plugins themselves are still written in JS (which, IMO, they certainly should be). A single file will still need to run on a single thread.
(Of course, you can run different files on different cores with Workers or just subprocesses, but I assume ESLint does this already)
- JonChesterfield 4y agoThe winning play here is to represent the node structure directly in rust, such that serialisation is a no-op. Which is admittedly tough to implement.
- rafram 4y agoStill comes with the same issues. JS code will need access to the node structure, too, which means serializing it on the Rust side.
- JonChesterfield 4y agoI mean have the same in memory representation in both languages such that no serialisation or deserialisation happens in either direction across the boundary. Fast but difficult to implement.