Skip to content

Tracking issue for high-level compiler overview rework #2116

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
1 of 5 tasks
jieyouxu opened this issue Nov 2, 2024 · 1 comment
Open
1 of 5 tasks

Tracking issue for high-level compiler overview rework #2116

jieyouxu opened this issue Nov 2, 2024 · 1 comment
Labels
A-compiler-architecture Area: high-level compiler architecture C-enhancement Category: enhancement C-tracking-issue Category: issues that track things T-compiler Relevant to compiler team

Comments

@jieyouxu
Copy link
Member

jieyouxu commented Nov 2, 2024

This is a tracking issue for high-level compiler overview chapter rework. This is not a serious r-l/r kind of tracking issue, so discussions/feedback/suggestions totally welcomed (opening issues for specific topics also great)!

TODO: I plan to edit this issue soon, opening now so I don't forgor.

Rationale

TODO

Implementation steps

TODO: fill out this section a bit more

  • Identify the intended audience.
    • Ideally, it should be useful to both new contributors and veteran contributors alike! Even veteran contributors will have areas they don't know well about, and this should equally cater to them.
  • Determine a suitable overall structure for the overview. How do we introduce rustc to an interested contributor who never read rustc's source to help them aboard?
    • Current idea: I plan to describe rustc as a "cute little command-line tool that gradually lowers from one intermediate representation to another, but with a starting input of 'source code' and output of 'machine code'"1
    • How does this compare to the previous idea of information flow between crates sub-systems? It's more faithful to what actually happens and is compatible with query system being not coarse-grained IR-to-IR-in-fullness (i.e. IRs can be gradually lowered, in parts, on demand) and is also compatible with incr comp. It's also less of a spaghetti of arrows if I want to draw some arrows between "nodes" in what I want to describe.
  • Figure out how to talk about cross-cutting subsystems (diagnostics, type checking, traits, lints, error handling, query system)
  • Figure out if we should also have a listing that briefly introduces the intended purpose of each compiler crate 2. For each compiler crate, produce a brief TL;DR:
    • How does it support the lowering and various analyses? What purposes does it serve?
    • How does it fit into the "big picture"?
    • Main entry points? (Link to source code, pinned to specific commit, add a date-check annotation)
  • Actually write the thing.

Related issues

Implementation history

Footnotes

  1. obviously it's more complicated than that, but I personally find significant value in "xxx oversimplified" because having a rough high-level picture makes it easy for you to know what you're getting into, and then to become an expert by knowing all the "but acktually" cases

  2. I'm envisioning a distinction between overview/intro.md versus overview/crates/rustc_middle.md etc. etc. We can also go ask the experts for how they think about each crate (for a smol TL;DR) in (possibly) weekly/monthly dev-guide review sessions!

@jieyouxu jieyouxu added A-compiler-architecture Area: high-level compiler architecture C-enhancement Category: enhancement C-tracking-issue Category: issues that track things T-compiler Relevant to compiler team labels Nov 2, 2024
@jieyouxu jieyouxu self-assigned this Nov 2, 2024
@jieyouxu jieyouxu removed their assignment Jan 20, 2025
@jieyouxu
Copy link
Member Author

(Unfortunately I don't have the bandwidth to pursue this atm, feel free to take over)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-compiler-architecture Area: high-level compiler architecture C-enhancement Category: enhancement C-tracking-issue Category: issues that track things T-compiler Relevant to compiler team
Projects
None yet
Development

No branches or pull requests

1 participant