rustup target add wasm32-unknown-unknown
cargo build --target wasm32-unknown-unknown
rustup target add x86_64-unknown-linux-musl
cargo build --target x86_64-unknown-linux-musl
rustup target add x86_64-pc-windows-gnu
cargo build --target x86_64-pc-windows-gnu
Boom, killer feature right there.c++ uses shared libraries, smaller in size for the whole system, and, you can upgrade a library separately too.
on embedded systems where storage space is restricted, rust is simply a no-go.
there are lots of embedded systems that run with glibc or musl shared libraries, if rust is used there, it will blow up the storage space with just a few executables due to the static stdlibs.
If you don’t have the budget for the standard library, don’t use it. If you somehow have the budget for glibc and not the rust standard library, call into glibc instead of the rust standard library.
rust stdlib will be bundled with those 20 rust executables, they blow up quickly.
mcu does not use stdlib of rust, it uses no-std, c++ has its own nonstdlib as well, on mcu they're similar.
[profile.release] # A profile to try to minimize the size
panic = "abort" # Abort on Panic
strip = true
opt-level = "z" # Optimize For Size
lto = true # Enable Link Time Optimization (LTO)
codegen-units = 1 # Reduce Parallel Code Generation Units to Increase OptimizationLinux has proven for a very long time that if you have 100 programs, and they each have 100 dependencies, you'll probably see an occasional issue related to incompatibility.
It seems like it's suited to the mindset of unique systems maintained by sysadmins, with every app being a part of the system, quite possibly built locally just for your task.
The modern way seems to be disposable installs that cab be recreated automatically if some probably-not-worth-fixing thing happens, made of reusable multipurpose software made by people who have never heard of your application, and a bit of local code, which might be intended to someday become one of those mega-frameworks.
Even windows used to always have hassles with some visual C++ runtime or other.
Although the standard library of C isn't a big issue since it's not in the habit of breaking things, but I'd imagine Rust might want to make bigger changes since it's so new.
Shared libraries are also possible.
I started in my own time and even back then it was superior...
People like c++ for the language features... I dislike it because of all the defensive programming one must do....