Thanks guys. I guess it just shows that I've never written any large C++
programs either :) So for now I'll stick to recompiling everything at once
and if it slows down too much I'll see where it makes sense to split it up
then.

Urban


On Mon, May 5, 2014 at 7:14 PM, Daniel Micay <[email protected]> wrote:

> On 05/05/14 03:36 AM, Urban Hafner wrote:
> > Hey all,
> >
> > a question from a Rust newbie here. From languages like C or C++ I'm
> > used to being able to compile each file separately into object files to
> > speed up the compilation process. In Rust that doesn't seem to be easily
> > possible. I tried to simulate it by compiling each module into a
> > separate library, but it has been pointed out to me that it's not
> > idiomatic but may not even improve performance [1]. As this stack
> > overflow question is quite hidden away I'd love to get everyone's input.
> > And even though writing the automatic Makefile [2] for it was fun I
> > wouldn't mind having an easier solution.
>
> Crates are Rust's compilation unit, so splitting into many crates is
> equivalent to splitting into many object files in C++. It's true that
> splitting will often not improve compile time, but that applies just as
> much to C++. If your goal is to improve compile-time, then you need to
> think carefully about how you organize the crates. Keep in mind that
> generic / inline code will be recompiled for each crate using the code.
>
>
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev
>
>


-- 
Freelancer

Available for hire for Ruby, Ruby on Rails, and JavaScript projects

More at http://urbanhafner.com
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to