Rust on aws lambda via webassembly

I know a little about webassembly in browser and close to nothing about webassembly outside the browser.

I know a little about Rust on Lambda via musl https://aws.amazon.com/blogs/opensource/rust-runtime-for-aws-lambda/
and close to nothing about Rust on Lambda via webassembly https://blog.scottlogic.com/2018/10/18/serverless-rust.html

For those familiar with both approaches -- can you shed light on the pros/cons of Rust on lambda via musl vs via webassembly ?

It may or may not matter for you. It depends on which ecosystem you care more about.

If you have (or will have) existing rust code that you use in a webapplication via wasm, you may want to send the exact same thing to lambda, in that case wasm may be a better choice.

If you rely on some OS-provided api, native app is a better option, because wasm equivalent is WIP (I think, I am not tracking it, but its a new thing).

Maybe there is some performance (startup time/runtime) difference, benchmark it if its important for you.

1 Like

At the time the second post was written, the AWS Lambda didn't support the Rust. But it supported Node.js so we can workaround by shipping Node.js app calling WASM module compiled from the Rust.

Now the AWS Lambda officially supports the Rust. You don't need such workaround anymore.

2 Likes