DEV Community

Discussion on: Going full-stack with AWS & A Cloud Guru

Collapse
 
kayis profile image
K

Sounds nice.

I played around with Rust on Lambda via Neon

Question is, what would be better/faster?

Does the AWS version of Node.js support WASM? Could it be run directly without a JavaScript wrapper? Is a non-WASM native Rust binary wrapped via Node.js faster? Could Lambda run *.node files directly?

Collapse
 
lambdude profile image
Ian Johnson

The approach with Neon is interesting. I've been using apex to package up my Rust binary, which is invoked from a node handler.

I've been using the lambda image to build my Rust binary and then node takes care of calling it. As I understand it, there is overhead to call the Rust code from node, but once the function is warmed, that overhead is dramatically reduced.

As far as WASM goes, I'm not sure if lambda supports it or not. But to me, WASM seems to be more front-end focused and lambda doesn't appear to be the best fit for it. Instead, I would use WASM for any front-end stuff and straight Rust for the back-end. I feel this way mostly because of Rust's strengths, like strong static typing and memory safety.