Live data from Hacker News

Incremental Compilation

blog.rust-lang.org

1–10 of 74 posts

Re: Incremental Compilation

#3
Nice to see it. Incremental compilation is one of those things that production compilers have but research languages usually don't have. You only need it when you have a lot of code, but then you really need it.

Re: Incremental Compilation

#5
post #4
post #2

Up to 15% faster or more?! =)

There's still a bunch of compiler phases they're not caching yet, so it's a very very early result.

If you click on the asterisk next to that heading, you'll see that the 15% figure is a joke reference to an XKCD. :P In practice, it wouldn't make sense for us to say "incremental compilation makes us X% faster" because the benefit will vary wildly by workload.

Re: Incremental Compilation

#6
post #3

Nice to see it. Incremental compilation is one of those things that production compilers have but research languages usually don't have. You only need it when you have a lot of code, but then you really need it.

Production compilers often don't have it either.

(Having to split up your code manually into separate .cpp [or what have you] files doesn't qualify as incremental compilation—that's just separate compilation. Incremental compilation is when the compiler automatically figures out what needs to be recompiled, even when all you hand it is a big blob of code that hasn't been manually split up by a human in any way.)

Re: Incremental Compilation

#7
From an uninformed distance this looks a bit underwhelming: initial builds are slower, incremental builds are not _that_ much faster, and build outputs are no longer deterministic functions of just the build inputs (which is useful for example for distributed build systems).

Re: Incremental Compilation

#9
post #8

How does this differ from what make files have been doing for decades?

Seems to be finer grained. Make knows I only changed foo.c and only rebuilds what depends on that. This sees that foo.rs changed and reparsed it. Sees the AST didn't change, maybe we added comments or reformatted it, and stops.

Re: Incremental Compilation

#10
post #8

How does this differ from what make files have been doing for decades?

You don't have to split up your code manually. You just write one Rust crate, splitting your code into files on whatever granularity you like (with mutual recursion fully supported), and the Rust compiler automatically does the rest. You don't have to write tedious header files; the compiler figures out all the dependencies automatically.
Post reply on HN