Skip to content

Commit 492791f

Browse files
committed
Polishing
1 parent 4ab1667 commit 492791f

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

docs/dotc-internals/overall-structure.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ this
5555

5656
f(/*normal args*/)(ctx.withPhase(phase))
5757

58-
This assumes that `f` is defined in way most compiler functions are:
58+
This assumes that `f` is defined in the way most compiler functions are:
5959

6060
def f(/*normal parameters*/)(implicit ctx: Context) ...
6161

@@ -77,15 +77,16 @@ not implicit, so we can track where it is used, and that it has a name
7777
different from `ctx`. Commonly used is `ictx` for "initialization
7878
context".
7979

80-
With these two conventions is has turned out that the use of implicit
81-
contexts as an dependency injection and bulk parameterization device
82-
worked exceptionally well. There were not very many bugs related to
83-
passing the wrong context by accident.
80+
With these two conventions in place, it has turned out that implicit
81+
contexts work amazingly well as a device for dependency injection and
82+
bulk parameterization. There is of course always the danger that
83+
an unexpected implicit will be passed, but in practice this has not turned out to
84+
be much of a problem.
8485

8586
## Compiler Phases
8687

8788
Seen from a temporal perspective, the `dotc` compiler consists of a list of phases.
88-
The current list of phases is specified in class [Compiler] as follows:
89+
The current list of phases is specified in class [Compiler](https://github.com/lampepfl/dotty/blob/master/src/dotty/tools/dotc/Compiler.scala) as follows:
8990

9091
```scala
9192
def phases: List[List[Phase]] = List(
@@ -141,14 +142,14 @@ The current list of phases is specified in class [Compiler] as follows:
141142
)
142143
```
143144

144-
Note that phases are grouped, so the `phases` value is a
145-
`List[List[Phase]]`. The idea is that all phases in a group are be
145+
Note that phases are grouped, so the `phases` method is of type
146+
`List[List[Phase]]`. The idea is that all phases in a group are
146147
*fused* into a single tree traversal. That way, phases can be kept
147148
small (most phases perform a single function) without requiring an
148149
excessive number of tree traversals (which are costly, because they
149150
have generally bad cache locality).
150151

151-
Phases fall into 4 categories:
152+
Phases fall into four categories:
152153

153154
- Frontend phases: `Frontend`, `PostTyper` and `Pickler`. `FrontEnd` parses the source programs and generates
154155
untyped abstract syntax trees, which are then typechecked and transformed into typed abstract syntax trees.
@@ -166,7 +167,7 @@ Phases fall into 4 categories:
166167
pass, but using the rules of the JVM's type system instead of Scala's.
167168

168169
- Low-level transformations: All phases from `ElimErasedValueType` to `LabelDefs`. These
169-
further transform trees until they are just a structured version of Java bytecode.
170+
further transform trees until they are essentially a structured version of Java bytecode.
170171

171172
- Code generators: These map the transformed trees to Java classfiles or Javascript files.
172173

0 commit comments

Comments
 (0)