Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is Rust good for embedded? I thought the binaries they produced were too fat?


The extra fat in Rust binaries compiled with default settings is things like:

- the standard library

- jemalloc (this is no longer the default, but is still a factor in people's perception about binary size because it used to be)

- debug symbols

- unwinding support for panics

All of these can be turned off for use cases like embedded where binary size is important and you'll then get binaries of comparable size to those produced by C compilers.


You just have to pay attention. I work in Rust on embedded, it’s not a problem. The smallest x86_64 binary rustc has ever produced is like, 145 bytes. I’m on Arm, we have space for a lot more, but still actively try to keep sizes down. Some tasks in our system are ~500 bytes, the larger ones are on the order of 10k.

You can’t just use the broader ecosystem willy nilly, and if you want truly small stuff, you have to know how to coax the compiler from time to time. But that’s just always going to be the case.


It statically links. But bare-metal embedded generally doesn't support dynamic linking at all, so that's not a real problem there.

A lot of the rest of the fat is from things like debugging symbols bounds checks that aren't included when building in release mode.


Embedded is a wide field. It's young but has promise.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: