Skip to content

Commit e2d04b6

Browse files
committed
add minutes from 2019-12-06 meeting
1 parent 89dbd36 commit e2d04b6

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Design Meeting 2019-12-06 -- librustc_interface queries
2+
3+
## Links
4+
5+
* [Zulip topic of the discussion](https://zulip-archive.rust-lang.org/131828tcompiler/75795designmeeting20191206.html)
6+
* [Compiler team issue](https://github.com/rust-lang/compiler-team/issues/175)
7+
* [Pre-design meeting Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/pre-design.20meeting.202019-12-05)
8+
* [Internals thread](https://internals.rust-lang.org/t/migrating-rustc-interface-queries-to-proper-librustc-queries/10433) with descriptions of PRs
9+
10+
## Background
11+
12+
* Goal is **end-to-end queries**
13+
* Benefits: Simpler overall model
14+
* Incremental extending back to parsing
15+
* mw has done measurements suggesting that on larger crates some 40% of the compilation time comes from
16+
* Parallel compilation would be more effective, if done on the basis of queries
17+
* Agenda
18+
* Tough to frame:)
19+
* Most important question to settle is what overall stategy we plan to take
20+
* Do we want to try and land / rebase these PRs?
21+
* Try a different tack?
22+
* Hold off and let other things progess?
23+
24+
## Commentary on the meeting
25+
26+
This is written after the fact, and is an attempt by nikomatsakis to capture some of the key considerations.
27+
28+
* The PRs were written with the goal of moving rust immediately to an end-to-end query system
29+
* the queries that get created here are not, however, as clean as one might expect
30+
* as an example, instead of creating fine-grained queries for handling HIR, we would create a single HIR Map query and retain today's special case code that tries to track which bits of the data the methods on the HIR map access
31+
* An alternative approach would be to move more slowly but work more on the actual design of each piece
32+
* We might start with the HIR, decide on the actual representation that we want, and refactor into that
33+
* And then move backwards to name resolution
34+
* This overlaps somewhat with rust-analyzer, which has been built "from the ground up" with queries in mind, and thus has been figuring out some of what is needed here
35+
* For context, there are definitely benefits from changing the line around the "set of things captured in the query system"
36+
* e.g. big parts of the webrender-check compilation takes place before incremental even starts
37+
* The concerns with the PRs are that
38+
* we are kind of creating more tech debt before we start to pay it off
39+
* since the designs are not the designs that we ultimately want
40+
* there isn't really a precise enough consensus around the end state that we want
41+
* and thus trying to move incrementally means we are kind of ambling without a clear goal
42+
* and likely to wind up with something incoherent
43+
* the PRs introduce more special cases into the query system, not fewer
44+
* On the other hand
45+
* moving quickly to create queries might unlock other improvements, help us eliminate shared state
46+
* maybe you see this as an "obvious first step whatever we do", in which case there isn't a lot of room to block
47+
* counterargument is that these PRs are each quite complex and take a lot of reviewing load to manage etc
48+
* We discussed a fair amount what a desirable design for HIR might look like, [starting around here](https://zulip-archive.rust-lang.org/131828tcompiler/75795designmeeting20191206.html#182771577)
49+
* it seemed like there was general consensus around a "vague sketch" where you had `tcx.hir(def_id)` give you back some kind of `ItemData` that contained the data for a particular item
50+
* no 'special cases' needed in the query system
51+
* [Alternative proposal](https://zulip-archive.rust-lang.org/131828tcompiler/75795designmeeting20191206.html#182772402)
52+
* close the PRs
53+
* encourage creation of a WG to work out a design for HIR, HIR-ID and the like and bring that design forward
54+
* land new PRs working in that direction
55+
* this overlaps heavily with rust-analyzer and could even take place in that context
56+
* Towards the end, some topics were raised that were not fleshed out
57+
* such as whether a `DefId` could be a "interned" DefPath (or whether it already is)
58+
* the need for 'queries that depend on queries' and what that means

0 commit comments

Comments
 (0)