3 ms·
I'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
by simias 12y ago
I'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)