as an embedded c/c++ developer I tried Rust briefly a few times over the years, don't feel it's the right fit, due to the way it's static build by default the binary size is just too large, plus the library pool is still much small, and there is no equivalent to c++'s STL for speedy coding when I need it.
yes I can trick for size etc, but overall it just did not fit well so far, for the embedded space that is, but, 'system-programming language' has many use cases in embedded field.
But that's just the default, you can tell it to use dynamic linking. What libraries were you missing? I find the rust standard library is better in many ways, and it doesn't have the same performance footguns.
I don't feel Rust has any performance advantage to c and c++ per my own tests.
yes I can dynamically link to stdlib in Rust but I don't think Rust has a versioned dynamic library released for multiple architectures(still many embedded archs are not fully supported in Rust), that leads to problems in the field at depolyment and upgrade phases. Plus the dynamic library after strip is still close to 6MB, I can have a full libstdc++ around 2MB for the embedded system(with musl it is about 1MB), for many low-range embedded systems(there are a _lot_ of them), 6MB is still quite large.
Yes I tried all those 'minimize rust' approaches including the above one.
they worked fine if you're statically link to its stdlib.
but if you have a few complex rust binaries, static link for each of them is not going to help on the overall combined size.
I did use a released library and build everything for release(per those minimize projects), I can easily cut a small program from 3M to 290KB but again, it is either static link, or you need a 6MB dynamic library to go with it.
the key question is, what's the smallest size for Rust shared library? so far my finding is around 6MB(after strip, otherwise it's about 11~12MB)
Oh so your problem is that when attempting to dynamically link to the standard library, you're missing out on the dead code elimination you'd get when statically linking. Rust doesn't have a stable ABI anyways, so you can't really share the standard library between programs unless you're really careful.
I'm not sure what embedded space you're referring to, but microcontrollers, in my experience, generally use monolithic binaries. I'm unsure why you'd wish to use dynamic linking in those cases.
yes I can trick for size etc, but overall it just did not fit well so far, for the embedded space that is, but, 'system-programming language' has many use cases in embedded field.