Skip to content

Commit 55d57f0

Browse files
committed
update part intros
1 parent 047443f commit 55d57f0

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

src/part-3-intro.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# Part 3: The Compiler Frontend
1+
# Part 3: Source Code Representations
22

3-
This part of the guide looks at the compiler frontend (with the major exception
4-
of the type system, which is in the next part). This part describes the process
5-
of taking raw source code from the user and transforming it into various forms
6-
that the compiler can work with easily. These are called intermediate
7-
representations.
3+
This part of the guide looks at the various ways the compiler transforms and
4+
represents source code. This part describes the process of taking raw source
5+
code from the user and transforming it into various forms that the compiler can
6+
work with easily. These are called intermediate representations.
7+
8+
This process starts with compiler understanding what the user has asked for:
9+
parsing the command line arguments given and determining what it is to compile.

src/part-4-intro.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Part 4: The Type System
1+
# Part 4: Analysis
22

33
This part discusses the many analyses that the compiler uses to check various
4-
properties of the code and to inform later stages. This includes the
4+
properties of the code and to inform later stages. Typically, this is what people
5+
mean when they talk about "Rust's type system". This includes the
56
representation, inference, and checking of types, the trait system, and the
67
borrow checker. These analyses do not happen as one big pass or set of
78
contiguous passes. Rather, they are spread out throughout various parts of the

src/part-5-intro.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# The Compiler Backend
1+
# From MIR to binaries
22

33
All of the preceding chapters of this guide have one thing in common: we never
44
generated any executable machine code at all! With this chapter, all of that
@@ -7,13 +7,14 @@ changes.
77
It's often useful to think of compilers as being composed of a _frontend_ and a
88
_backend_ (though in rustc, there's not a sharp line between frontend and
99
backend). The _frontend_ is responsible for taking raw source code, checking it
10-
for correctness, and getting it into a format usable by the backend. For rustc,
11-
this format is the MIR. The _backend_ refers to the parts of the compiler that
12-
turn rustc's MIR into actual executable code (e.g. an ELF or EXE binary) that
13-
can run on a processor. All of the previous chapters deal with rustc's
14-
frontend.
15-
16-
rustc's backend does the following:
10+
for correctness, and getting it into a format from which we can generate code.
11+
For rustc, we typically consider MIR to be this format (though arguably, one
12+
could consider LLVM IR to be this format). The _backend_ refers to the parts
13+
of the compiler that produce actual executable code (e.g. an ELF or EXE binary)
14+
that can run on a processor. All of the previous chapters deal with rustc's
15+
"frontend".
16+
17+
rustc's "backend" does the following:
1718

1819
0. First, we need to collect the set of things to generate code for. In
1920
particular, we need to find out which concrete types to substitute for

0 commit comments

Comments
 (0)