Re:Rust once, run everywhere
by madez on Friday April 24, 2015 @02:16PM
(#9435080)
Has the call from C to Rust also zero overhead?
[ Parent
| on HN ]
Re:Rust once, run everywhere
by alexcrichton on Friday April 24, 2015 @02:23PM
(#9435130)
It does indeed! Due to Rust's lack of a garbage collector or runtime altogether, when C calls into Rust there is no overhead. In the example in the blog post [1] you can see that the Rust function has no extra syntactic burden, and the compiler also will not add any form of conversion one way or another. The C code then just emits a direct call to the symbol, so everything is totally free!
[1]: http://blog.rust-lang.org/2015/04/24/Rust-Once-Run-Everywher...