3 ms·
I think you're missing his point, and I say this as someone who's deployed native Node modules using Rust/Neon in our production environment and advocate that a
by curun1r 8y ago
I think you're missing his point, and I say this as someone who's deployed native Node modules using Rust/Neon in our production environment and advocate that approach whole-heartedly.
Writing my own Node modules in Rust works great. But I can't write a node module in Rust and distribute it via npm the way that C++ authors can. When someone adds their module as a dependency and does an npm install, npm will duly run node-gyp to compile their C++. There's no Rust equivalent of that and, until there is, Rust will always be a second-class citizen when it comes to embedding into those languages.
As you point out, there's nothing technically stopping the ecosystem tools for those languages from supporting Rust, but they just don't--likely because they'd prefer to not have to bundle an entire Rust toolchain with their distribution. But whether the reason is technical or not is immaterial...I still can't push a Rust-implemented module to npm.
If the goal is to create a module that the larger Node community can use to embed wasm in Node, Rust simply isn't an option because distribution via npm is a given.
- TomMarius 8y agoWe are talking about a new technology, of course the support is not that strong. You said the most important bit yourself: > As you point out, there's nothing technically stopping the ecosystem tools for those languages from supporting Rust There of course would be a problem if it was technically impossible, but that's not true, it just might be impractical right now.
- steveklabnik 8y agoWith wasm, you can distribute an npm package that’s pre compiled and doesn’t require rustc. wasm-pack already does this.
- curun1r 8y agoThat is both a) cool and b) proof of what we were dicussing...that web assembly provides a means for embedding into these scripting languages that vanilla Rust does not.