> Among other reasons to consider it: if you want to run on a FaaS platorm or container setup, Rust has much faster cold start time and makes for smaller container sizes.
Faster start time maybe, but I’m not sure about smaller containers. Rust is terrible with binary sizes in my admittedly limited experience.
Exactly, 14Mb for a simple API server like zero2prod is rather large. That's with stripping, if you want the ability to debug and get pretty panics it'll be even larger.
You can download a pre-compiled sqlite tools package includes four binary CLI tools in only 6.5 MB vs that one sqlx binary which is 5.4 MB. Of course they're not the same, but the general trend I've seen is that Rust is as large or often larger than bloated C++ projects.
For example I worked with Rust on a Yocto project where you can't use Rust's stripping config because it breaks (broke?) the hashing Yocto does. A very small IoT API project ended up being 50+ MBs. It was larger than the rest of the entire Linux system. I've written IoT projects of similar complexity in Go and Nim which come in under 3-4MB with full debugging no stripping needed.
It's 14Mb with 400+ libraries included. `cargo bloat` shows that top function by size is from rustls (SSL support). For a container with a single binary, it's huge space saver. Moreover, I can easily optimize binary by size to 7.9Mb binary (20kb per crate on average).
> because it breaks (broke?) the hashing Yocto does.
It's problem with Yocto. In my case (few years ago, before the war), I just build RPM packages by my own build system and then install them on top of pure Yocto system. I optimize my binaries for embedded by size.
In theory, debug symbols can be separated to a separate debuginfo rpm, and installed only when needed or mounted remotely from a host system. In practice, I just install the binary enhanced for debugging (with debugging and tracing features enabled) directly to Yocto device, then add test case to reproduce the problem on host, because I hate debuggers.
Faster start time maybe, but I’m not sure about smaller containers. Rust is terrible with binary sizes in my admittedly limited experience.