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 Rust Runtime for AWS Lambda | AWS Open Source Blog
and close to nothing about Rust on Lambda via webassembly Serverless Rust with AWS Lambda and WebAssembly

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

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.