[rust-dev] embedding Rust?

Patrick Walton pwalton at mozilla.com
Sun Jan 19 10:55:28 PST 2014


Yes, all of the guts of the compiler are in a dynamic library, librustc, for reasons similar to those.

We have some initial support for loading Rust code at runtime (so that the compiler can load syntax extensions), though it's fairly immature at the moment.

Patrick

Josh Haberman <jhaberman at gmail.com> wrote:
>Is it a design goal of the Rust compiler that it (eventually) be
>offered as a library, so that you can compile/link Rust code and
>dynamically load / call into it at runtime?
>
>If so, what do you foresee as far as size/speed profile? I get the
>impression that the Rust compiler is relatively large/slow (both to
>compile rustc itself and to compile Rust code) -- is this inherent or
>do you see it slimming/speeding over time? I guess LLVM is pretty
>heavyweight on its own.
>
>When it comes to embedding I always compare against LuaJIT which
>compiles in ~20 seconds to a  ~500k library and can compile/run "Hello
>World" in 5ms. This is surely an unrealistic goal for Rust which has
>to do far more static checking, but I'm curious to know what a
>realistic ballpark is for where Rust will likely get.
>
>Thanks,
>Josh
>_______________________________________________
>Rust-dev mailing list
>Rust-dev at mozilla.org
>https://mail.mozilla.org/listinfo/rust-dev

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140119/eef6e814/attachment-0001.html>


More information about the Rust-dev mailing list