The https://github.com/johnthagen/min-sized-rust repo has a lot of info about the why, and about the how to tackle that
#Why are rust exe's so huge?
7 messages · Page 1 of 1 (latest)
It's also worth mentioning C and C++ cheat
They get to assume that the standard library exists on the target platform.
So their hello world is often "just assume that this library exists over there, and that it has the functions I need. Call them"
The library is usually much larger than what Rust embeds in programs
Rust has to actually include the print code in your binary
(C++ might to, not sure. C definitely doesn't)
Note that the size of "hello world" has little correlation with the size of real world apps. Rust has some overhead (esp. format machinery) that is pretty much always included but doesn't increase with more complicated apps.