Skip to content

Latest commit

 

History

History
72 lines (41 loc) · 3.09 KB

Presentation.md

File metadata and controls

72 lines (41 loc) · 3.09 KB

Rust on Lambda

  • Why consider Rust?
  • How to use Rust on Lambda
    • Some small examples
  • Useful links and resources

Why consider Rust?

Rust is a systems programming language, which compiles to native code with really good performance.

It has some great guarantees that it can provide out of the box, if your code compiles there's a high chance that your code executes correctly as well.

It has a small std-library, which is compiled in as default, but this can also be opted out of, allowing you to create really small binaries that fits well for IoT-devices and such.

It's also a good choice for targeting WASM, as there is good tooling around that available, which can be used to target more computationally intensive tasks when running in the browser, or for developing native extensions/modules for node.

It's also a good alternative when needing to interface with C or C++, and you can build a good interface between your safe Rust code and the unsafe land of dangling pointers and segfaults that those languages comes with.

Rust's Homepage

Why Rust on AWS?

OBS! Not a primary language at Polestar currently!

Rust as a language has been used within AWS for years, but it has taken time for them to give support for developers using Rust on their platform.

Example: Firecracker

The SDK has been in experimental status for ever, and now it's in alpha, but it works well enough to start using it, and it gives you about the same capabilities in general as the SDKs available for other languages.

It's also very easy to cross-compile Rust code, so you can build for the optimal target in e.g. AWS Lambda.

Why Rust instead of lang X?

For both JS/TS and .Net you have quite the runtime to load when running your code, and the garbage collection can cause hiccups.

Rust have no need for a runtime or garbage collector, and can achieve speeds in comparison to C or C++.

In particular the native compiled Rust code produces small binaries with a bit of optimizations, and have super low cold start times on AWS Lambda.

Lambda Cold Starts benchmark

Useful Links and Resources

Rust at Polestar

Rust in general

Learning Rust

Rust & AWS

Fun Rust-related links