DEV Community

loading...

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

Collapse
lambdude profile image
Ian Johnson

I have also been using acloud.guru to learn basic concepts of the cloud and to get my hands dirty building things. I really like the smaller courses and labs that they offer where you actually build (very small) things. Currently, I'm using the lessons I've learned from there and apex to run Rust on lambda. Since Rust has some great WASM targets, this may be something to look into also. You can even package up the wasm and publish it to npm!

Collapse
kayis profile image
K Author

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.