Hacker News new | ask | show | jobs
by marijn 4693 days ago
Look at https://github.com/pcwalton/zero.rs . It's not very far yet, but it proves that it is viable to run Rust without a runtime.
1 comments

I actually don't think we even need zero.rs anymore. Its purpose was to provide noop implementations for all the "lang items" that the compiler expects to find in the stdlib. However, post-0.7 the compiler no longer requires a lang item to be provided unless you actually use a feature that requires it.

For an example, see the code at https://github.com/doublec/rust-from-c-example , which is fully runtimeless.

zero.rs (or something like it) is still required, because there's certain lang items that are required/useful (e.g. #[start], destructors, failure, vector bounds checks).

(e.g. https://github.com/huonw/rust-malloc/blob/master/zero.rs)