(no title)
bipson | 2 years ago
If we talk about ultra-low-power platforms, e.g. energy-harvesting IoT devices, 1MB is still quite a lot.
If we are going to argue that Rust can compete with C/C++, it needs to have similar performance, also regarding binary size.
lifthrasiir|2 years ago
tialaramex|2 years ago
C++ just labels a few specific features as available in a "freestanding" C++ standard library if you have one (on an embedded platform presumably you do).
This makes it very easy to know what you're getting in Rust's stdlib in #[no_std] because it's all of core, so e.g.
https://doc.rust-lang.org/core/primitive.slice.html#method.s... vs. https://doc.rust-lang.org/std/primitive.slice.html#method.so...
At first glance those are identical, but no, std is re-exporting every feature core had, but it also gains features, for example the stable sort function family only exist in std because they're using a temporary allocation whereas the unstable (ie equivalent items may be re-ordered) sort provided even in core doesn't do that.
Figuring out what you get in your stdlib with C++ often comes down to suck it and see.