-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Description
I am evaluating a use case of Rust on an embedded system after playing with it occasionally as hobby. We currently use Go for it and it works great. However, we have to adopt a 'busybox'-like approach to deal with the binary size problem as the number of our small CLI tools growing.
I tried Rust but the outcome regarding binary size was disappointing. A hello-world program with a single dependency (clap) resulted in a 5.x MB executable, which has been already more monstrous than the aforementioned Go application we developed. And the Go executable doesn't even link to any shared library.
I am aware of the 'tricks' found by someone and the blog posts that help with the problem, but it works only for the Nightly, which isn't a good sign for uses in production software. And most importantly, the small binary should be the default for release builds and users only pay for the binary size bloating if the "additional" features are actually utilized.
Not sure If this is a realistic demand to Rust. Hopefully we don't have to stick to C forever when binary size matters.