-
Notifications
You must be signed in to change notification settings - Fork 547
Reorganize the guide #651
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
Merged
Merged
Reorganize the guide #651
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
fb6938c
start on guide reorg
mark-i-m 4d68c8a
backend intro
mark-i-m 7d4a8e0
part 2, 3, 4 intros
mark-i-m 1606814
some missing files
mark-i-m 1f7cc53
Fix typos
mark-i-m 72a7022
add links from intro
mark-i-m 8e3fcaf
rename compiler source chapter and add placeholder for overview
mark-i-m 047443f
rename parts, mv rustc_driver to part 3, make syntax chapter
mark-i-m 55d57f0
update part intros
mark-i-m 96265e8
add syntax ch intro
mark-i-m 2041af5
address review comments
mark-i-m c74f695
Better overview chapter placeholder
mark-i-m de10abc
fix link
mark-i-m File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# AST Validation | ||
|
||
AST validation is the process of checking various correctness properties about | ||
the AST after macro expansion. | ||
|
||
**TODO**: write this chapter. | ||
mark-i-m marked this conversation as resolved.
Show resolved
Hide resolved
|
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Feature Gate Checking | ||
|
||
**TODO**: this chapter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Overview of the Compiler | ||
|
||
Coming soon! Work is in progress on this chapter. See https://github.com/rust-lang/rustc-dev-guide/pull/633 for the source and the [project README](https://github.com/rust-lang/rustc-dev-guide) for local build instructions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
# Part 2: How rustc works | ||
|
||
This part of the guide describes how the compiler works. It goes through | ||
everything from high-level structure of the compiler to how each stage of | ||
compilation works. | ||
The remaining parts of this guide discuss how the compiler works. They go | ||
through everything from high-level structure of the compiler to how each stage | ||
of compilation works. They should be friendly to both readers interested in the | ||
end-to-end process of compilation _and_ readers interested in learning about a | ||
specific system they wish to contribute to. If anything is unclear, feel free | ||
to file an issue on the [rustc-dev-guide | ||
repo](https://github.com/rust-lang/rustc-dev-guide/issues) or contact the compiler | ||
team, as detailed in [this chapter from Part 1](./compiler-team.md). | ||
|
||
This section should be friendly to both readers interested in the end-to-end | ||
process of compilation _and_ readers interested in learning about a specific | ||
system they wish to contribute to. If anything is unclear, feel free to file | ||
an issue on the [rustc-dev-guide repo](https://github.com/rust-lang/rustc-dev-guide) | ||
or contact the compiler team, as detailed in [this chapter from Part | ||
1](./compiler-team.md). | ||
In this part, we will specifically look at the high-level architecture of the | ||
compiler. Specifically, will look at the query system, incremental compilation, | ||
and interning. These are three overarching design choices that impact the whole | ||
compiler. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Part 3: Source Code Representations | ||
mark-i-m marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
This part describes the process of taking raw source code from the user and | ||
transforming it into various forms that the compiler can work with easily. | ||
These are called intermediate representations. | ||
|
||
This process starts with compiler understanding what the user has asked for: | ||
parsing the command line arguments given and determining what it is to compile. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Part 4: Analysis | ||
|
||
This part discusses the many analyses that the compiler uses to check various | ||
properties of the code and to inform later stages. Typically, this is what people | ||
mean when they talk about "Rust's type system". This includes the | ||
representation, inference, and checking of types, the trait system, and the | ||
borrow checker. These analyses do not happen as one big pass or set of | ||
spastorino marked this conversation as resolved.
Show resolved
Hide resolved
|
||
contiguous passes. Rather, they are spread out throughout various parts of the | ||
compilation process and use different intermediate representations. For example, | ||
type checking happens on the HIR, while borrow checking happens on the MIR. | ||
Nonetheless, for the sake of presentation, we will discuss all of these | ||
analyses in this part of the guide. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Pattern and Exhaustiveness Checking | ||
|
||
In Rust, pattern matching and bindings have a few very helpful properties. The | ||
compiler will check that bindings are irrefutable when made and that match arms | ||
are exhaustive. | ||
|
||
**TODO**: write this chapter. | ||
mark-i-m marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Syntax and the AST | ||
|
||
Working directly with source code is very inconvenient and error-prone. Thus, | ||
mark-i-m marked this conversation as resolved.
Show resolved
Hide resolved
|
||
before we do anything else, we convert raw source code into an AST. It turns | ||
out that doing even this involves a lot of work, including lexing, parsing, | ||
macro expansion, name resolution, conditional compilation, feature-gate | ||
checking, and validation of the AST. In this chapter, we take a look at all | ||
of these steps. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.