Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Draft] Rework the "Overview of the Compiler" chapter #1955

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jieyouxu
Copy link
Contributor

@jieyouxu jieyouxu commented Apr 1, 2024

Context: #674

Reworking the "Overview of the Compiler" chapter

I've noticed that the current Overview chapter seems to have several issues that make it difficult for new contributors to understand the compiler's structure and architecture at a high-level:

  • Mixed detail levels.
  • Some areas are very briefly mentioned or omitted.
  • Still very hard to actually get a reasonably full high-level picture of the compiler.

See also discussion during a rustc-dev-guide reading club session (cf. https://rust-lang.zulipchat.com/#narrow/stream/196385-t-compiler.2Fwg-rustc-dev-guide/topic/.5Breading.20club.5D.202023.2E02.2E26.20chapters.2022.20to.2030/near/423423778).

This PR aims to rework the Overview of the Compiler chapter to make it more friendly for new contributors and be more comprehensive and to address some of these shortcomings.

The R0 draft here is intentionally incomplete: I worked on this draft in a separate HackMD document, but it's at a point where it has sufficient content to allow people to start giving feedback, suggestions and contributions (and I also want to start fixing the links and reworking diagrams so they can be embedded in a mdBook-compatible fashion).

Some inline remarks (presented as quote blocks) are left in during draft phase, will be removed when ready.

Rendered text

Revision History

Revision history is maintained through individual commits, so they are not repeated here.

Comment on lines 377 to 379
> 🚧 **TODO** 🚧 (Remove the cat meme when complete with draft)

![](https://hackmd.io/_uploads/ry2CM6gAa.jpg)
Copy link
Member

@Nadrieril Nadrieril Apr 1, 2024

Choose a reason for hiding this comment

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

🤣 plz don't remove the cat meme

Copy link
Contributor Author

Choose a reason for hiding this comment

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

something something retaining the cat meme might require an FCP in the final version /jk

> trait system here?** AFAIK, it's both dependent and and provides information
> to multiple areas. Link: <https://github.com/rust-lang/rust/pull/121848>

#### Static-Single Assignment (SSA) Code Generation
Copy link
Member

Choose a reason for hiding this comment

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

You're missing a section about codegen. Idk if it's querified or not

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't talk about codegen Yeah I'm not completely sure about codegen atm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Stubbed out a section on the 3 codegen backends

src/overview/overview.md Outdated Show resolved Hide resolved
src/overview/overview.md Outdated Show resolved Hide resolved
- Transfer everything from HackMD into a PR.
- Change querified area summary order to correspond to "normal"
  code->codegen direction.
- Add SVGs generated based on the graphviz sources.
- Remove some editorial remarks.
…en backends

- Extend HIR wfcheck to cover not only type wfcheck, but other HIR
  wfchecks like object safety.
- Stub out rustc driver/interface as the high-level entry point and
  orchestrator of the compilation process.
- Stub out codegen backends.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants