3 ms·
A safe Rust abstraction layer for native Node.js modules
- indatawetrust 10y agoprevious -> http://calculist.org/blog/2015/12/23/neon-node-rust/ http://calculist.org/blog/2015/12/23/neon-node-rust/
- runarberg 10y agoand the HN discussion -> https://news.ycombinator.com/item?id=10786411 https://news.ycombinator.com/item?id=10786411
- k__ 10y agoWhen should I use this? Like, which sub set of modules are better as a native version and which sub set of these are better written in Rust?
- deleted 10y ago[deleted]
- dietrichepp 10y agoParallel programming in JS is a total nightmare. It's a lot easier in Rust.
- kartD 10y agoAs dietrichepp said parallel programming would be a good fit for Rust. See if this works for you. https://blog.rust-lang.org/2015/04/10/Fearless-Concurrency.html https://blog.rust-lang.org/2015/04/10/Fearless-Concurrency.h... Edit: you could also do safer C/C++ interop with JS through Rust, if you want to use some legacy code.
- kbenson 10y agoFYI (or whoever can make the fix), the link titled "share stack frames" (to http://static.rust-lang.org/doc/master/std/thread/fn.scoped.html http://static.rust-lang.org/doc/master/std/thread/fn.scoped....) on that page is dead.
- dherman 10y agoThere are a few basic use cases I envision being the most common: - When you have a portion of your Node app you really want to optimize (Rust's baseline computational performance is generally much faster than Node's and is easier to optimize predictably). - When you have a part of your algorithm that you want to parallelize. - When you want access to native libraries and need some glue code to expose it to JS. One important caveat: there's a significant cost to calling back and forth between Node and Rust (I hope I can improve the cost over time but it'll never be free), so the use cases that fit the best will be ones where you're doing a lot of work in Rust so the amortized cost of crossing that boundary is small compared to the savings you get from Rust.