Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



It goes a lot smaller with `--codegen prefer-dynamic`, also around 6K for me.



But AFAIK there is a subset of Rust which doesn't require the runtime.


The 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

Avoiding the standard library/runtime: http://doc.rust-lang.org/master/guide-unsafe.html#avoiding-t... (don't miss the "Using libcore" subsection)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: