4 ms·
Go produces fat binaries, probably not what you expect from this tiny tools. I even believe some linux distributions forbid packages that don't use shared libra
by drsintoma 12y ago
Go produces fat binaries, probably not what you expect from this tiny tools. I even believe some linux distributions forbid packages that don't use shared libraries.
- stefantalpalaru 12y agoYou can use gccgo for dynamic linking.
- hendzen 12y agoThe last time I played around with rust (a few weeks ago), rustc compiled binaries included a statically linked runtime as well.
- simias 12y agoI've just built rust from the latest git and it still seems true (at least with the default compiler flags). The "hello world" from the tutorial compiles to a 1MB executable (dynamically linked with the C library but statically linked with the rust library). The equivalent C program creates a 6.5KB binary with gcc.
- ben0x539 12y agoIt goes a lot smaller with `--codegen prefer-dynamic`, also around 6K for me.
- steveklabnik 12y agoSee also https://github.com/mozilla/rust/issues/13871 https://github.com/mozilla/rust/issues/13871
- mercurial 12y agoBut AFAIK there is a subset of Rust which doesn't require the runtime.
- dbaupp 12y agoThe language itself doesn't need the runtime: it's entirely implemented in libraries, and the libraries are slowly being rearranged to offer as much as possible to clients who wish to avoid the runtime (e.g. "libcore"). High-level description the runtimes: http://doc.rust-lang.org/master/guide-runtime.html http://doc.rust-lang.org/master/guide-runtime.html Avoiding the standard library/runtime: http://doc.rust-lang.org/master/guide-unsafe.html#avoiding-the-standard-library http://doc.rust-lang.org/master/guide-unsafe.html#avoiding-t... (don't miss the "Using libcore" subsection)
- kibwen 12y agoRust gives you the option of either static or dynamic linking, but prefers static linking by default.
- ericfrederich 12y agoMaybe they could design it like BusyBox where there is a single binary and a bunch of symlinks to it.