DEV Community

Discussion on: What language or tool are you curious about, but have not found the time to use or learn?

Collapse
 
somedood profile image
Basti Ortiz

Wow. How convenient! I would love to learn more about how this all works under the hood.

Does Parcel compile Rust so that it directly binds with V8, or does it use some fancy foreign function interface (FFI)? Please do correct me if I'm wrong, but I figured that it might be the latter due to the presence of the no_mangle directive in the Rust example. Moreover, does Parcel provide the option to compile Rust into native Node add-ons instead?

Say, if I wanted to write a performance-critical application, this would be critical information for me in my tool belt.

Thread Thread
 
woubuc profile image
Wouter • Edited

Parcel compiles the Rust code to a WASM (WebAssembly) bundle. This is basically the Javascript standard equivalent of FFI, and should work in modern browsers and in Node.

If you specifically want to write native Node add-ons, I've heard pretty good things about neon but I haven't tried it out myself and it seems more involved than loading a WASM bundle with a bundler.

Thread Thread
 
somedood profile image
Basti Ortiz

Nice! Parcel is more attractive now that you mentioned WebAssembly. Thanks for the nod in the right direction. I'll definitely look into it.

Also, I've tried Neon once. It was an overall good experience, but tooling support is desperately lacking. In particular, Rust support in VS Code was a huge pain to deal with. Tooling aside, Neon is a neat alternative to FFI. It's best to give it a few years to mature before a proper judgement can be made.

Thread Thread
 
woubuc profile image
Wouter

Lack of IDE support is definitely one of, if not the biggest obstacle for Rust right now. I haven't used VS Code in a while so I can't compare, but I'm using IntelliJ with the IntelliJ-Rust plugin and it works fairly well (some minor annoyances but no major issues).

You can also check areweideyet.com for an overview of Rust plugins & support in various IDEs.

Thread Thread
 
somedood profile image
Basti Ortiz

It's very unfortunate, too, because Rust is a great language with promising ideas and paradigms to offer. I'll do some further research on IntelliJ's IDE capabilities. With that said, thank you very much for your advice.