Hacker News new | ask | show | jobs
by berkut 4171 days ago
Even if you don't statically link Rust's runtime?

If so I can see that working for very simple code, but what about wanting to use Tasks/Threads or do I/O. Is that converted to native system calls at compile time?

2 comments

After a series of recent changes, Rust's runtime has been radically reduced. I/O goes through system calls, and the threading system is just native OS threads. There's a very small amount of support needed for the "Rust runtime", including things like stack guards, but it's much smaller than it was.

The RFC describing the changes is [^1] and the actual commit that finalized them is [^2].

[^1]: https://github.com/rust-lang/rfcs/pull/230

[^2]: https://github.com/rust-lang/rust/commit/0efafac398ff7f28c5f...

You can create freestanding binaries, but you need to implement more things on your own. Check out this page for some interesting projects: https://github.com/rust-lang/rust/wiki/Operating-system-deve...