You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -77,15 +77,16 @@ not implicit, so we can track where it is used, and that it has a name
77
77
different from `ctx`. Commonly used is `ictx` for "initialization
78
78
context".
79
79
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.
84
85
85
86
## Compiler Phases
86
87
87
88
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:
89
90
90
91
```scala
91
92
defphases:List[List[Phase]] =List(
@@ -141,14 +142,14 @@ The current list of phases is specified in class [Compiler] as follows:
141
142
)
142
143
```
143
144
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
146
147
*fused* into a single tree traversal. That way, phases can be kept
147
148
small (most phases perform a single function) without requiring an
148
149
excessive number of tree traversals (which are costly, because they
149
150
have generally bad cache locality).
150
151
151
-
Phases fall into 4 categories:
152
+
Phases fall into four categories:
152
153
153
154
- Frontend phases: `Frontend`, `PostTyper` and `Pickler`. `FrontEnd` parses the source programs and generates
154
155
untyped abstract syntax trees, which are then typechecked and transformed into typed abstract syntax trees.
@@ -166,7 +167,7 @@ Phases fall into 4 categories:
166
167
pass, but using the rules of the JVM's type system instead of Scala's.
167
168
168
169
- 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.
170
171
171
172
- Code generators: These map the transformed trees to Java classfiles or Javascript files.
0 commit comments