Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

michaelwoerister
Copy link
Member

This RFC proposes an incremental compilation strategy for rustc that allows for translation, codegen, and parts of static analysis to be done in an incremental fashion, without precluding the option of later expanding incrementality to parsing, macro expansion, and resolution.

This RFC is purely about the architecture and implementation of the Rust compiler. It does not propose any changes to the language. I also don't expect it to be acted on any time before 1.0 is out of the door, but I wanted to get this out into the open, so that it can discussed as part of the RustC Architecture Improvement Initiative (that's right, RAII) that I invented just now and that will begin to discuss how the Rust compiler can get as good as possible once the language has become a more stable target.

Rendered

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hash the relevant flags for the subdir name? I'd expect a lot of -C options affect the cache, and only storing one set wouldn't help at all for some usage patterns.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, something like that. I'd like to see how big such a cache gets.

@nrc
Copy link
Member

nrc commented Jan 18, 2015

cc @epdtry who implemented most of a very similar scheme last summer.

We talked about this as incremental codegen (as opposed to proper incremental compilation). He only kept around object files, not llvm ir too.

It would be great if @epdtry could link to his WIP branch and explain the concepts, etc. here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already can do codegen in parallel, although there is a bug preventing most use atm.

@dhardy
Copy link
Contributor

dhardy commented Jan 19, 2015

Please don't make the acronym RAII more confusing by adding a competing definition. Arguably Resource Allocation Is Initialisation is the wrong name anyway, but that's no reason to make the term more difficult to explain to new-comers.

@bstrie
Copy link
Contributor

bstrie commented Jan 19, 2015

I agree with @dhardy. As an alternative, may I propose "So Far, Incrementalism Necessitates An Exegesis"?

@michaelwoerister
Copy link
Member Author

@dhardy Sorry for the confusion :) That suggestion was not meant entirely serious.

@bstrie I am in awe. Now do TANSTAAFL !

@Diggsey
Copy link
Contributor

Diggsey commented Jan 20, 2015

@dhardy
You're right that is the wrong name :P, it's "Resource Acquisition Is Initialisation"
(also we have the same first name...)

@nrc nrc self-assigned this Jan 22, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the subject of monomorphized identifiers: you'll probably need to do something about symbol naming for monomorphizations of functions. Right now the name includes the hash of the pointers to the Tys representing the type arguments (which is random, thanks to ASLR). This does fine at preventing collisions, but it means you'll need to either record the mapping of (polymorphic function, type arguments) -> (symbol name) for use in later incremental builds, or fix symbol naming to produce something consistent. I tried to do the latter, but it wound up being a little more complicated than I expected (ADT Tys reference the struct/enum definition by its DefId, which is not stable) and I don't remember if I ever got it working.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's a problem. I'd probably try to find a more stable symbol naming scheme.

@nrc nrc added the T-compiler Relevant to the compiler team, which will review and decide on the RFC. label May 15, 2015
@nikomatsakis
Copy link
Contributor

I am expanding and adapting this RFC. After some discussion with @michaelwoerister we decided to close this existing PR for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-compiler Relevant to the compiler team, which will review and decide on the RFC.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.