It's worth noting that by default Rust binaries are linked statically to the standard library, which is why the executable file size can be large. There is a way to link dynamically to libstd (and others) using the "-C prefer-dynamic" rustc flag. The built libstd*.so for the target will of course need to be copied into the library path in order for the executable to run, but file sizes will be considerably smaller per executable. For example, using my current nightly rustc, a simple release build of the default "Hello World" binary is 2,402,248 bytes, whereas a build with a dynamically linked libstd is merely 16,984 bytes. Dynamic linking of course means that libraries like libstd could be pushed to the satellite once (preferably on the ground). Then, subsequent executables would require less time to push as they'd have less code. The libstd is very specific to the Rust version used however, so some system for updating the libstd version would also probably be required. C executables are linked dynamically to libc by default which is why they are smaller than Rust executables in the default configuration.
@mikkelens7 ай бұрын
I assume this is a bit different nowadays? You might still have to do some work to make your rust binary comparable to a C executable, but it doesn't sound nearly as bad as you described it here