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
Copy file name to clipboardExpand all lines: docs/coding-standards.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ The F# compiler code base is slowly being updated to better coding standards. Th
10
10
11
11
The future work includes
12
12
13
-
*[ ] Consistent use of fantomas formatting acrossas much of the codebase as feasible
13
+
*[ ] Consistent use of fantomas formatting across as much of the codebase as feasible
14
14
*[ ] Consistent naming conventions
15
15
*[ ] Reduction in line length
16
16
*[ ] Reduction in single-character identifiers
@@ -29,7 +29,7 @@ The compiler codebase uses various abbreviations. Here are some of the most comm
29
29
|`arginfo`| Argument (parameter) metadata |
30
30
|`ccu`| Reference to an F# compilation unit = an F# DLL (possibly including the DLL being compiled) |
31
31
|`celem`| Custom attribute element |
32
-
|`cenv`| Compilation environment. Means different things in different contexts, but usually a parameter for a singlecompilation state object being passed through a set of related functions in a single phase. The compilation state is often mutable. |
32
+
|`cenv`| Compilation environment. Means different things in different contexts, but usually a parameter for a single compilation state object being passed through a set of related functions in a single phase. The compilation state is often mutable. |
33
33
|`cpath`| Compilation path, meaning A.B.C for the overall names containing a type or module definition |
34
34
|`css`| Constraint solver state. |
35
35
|`denv`| Display Environment. Parameters guiding the formatting of types |
@@ -43,7 +43,7 @@ The compiler codebase uses various abbreviations. Here are some of the most comm
43
43
|`lid`| Long Identifier |
44
44
|`m`| A source code range marker |
45
45
|`mimpl`| IL interface method implementation |
46
-
|`minfo`| An info object for a method (whet a .NET method, an F# method or a provided method) |
46
+
|`minfo`| An info object for a method (whether a .NET method, an F# method or a provided method) |
47
47
|`modul`| a Typed Tree structure for a namespace or F# module |
48
48
|`pat`| Pattern, a syntactic AST node representing part of a pattern in a pattern match |
49
49
|`pinfo`| An info object for a property (whether a .NET property, an F# property or a provided property) |
Copy file name to clipboardExpand all lines: docs/compiler-startup-performance.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ On all platforms, the following factors affect startup performance:
14
14
15
15
* Time to open referenced assemblies (for example, `mscorlib.dll`, `FSharp.Core.dll`) and analyze them for the types and namespaces defined. This depends particularly on whether this is correctly done in an on-demand way.
16
16
17
-
* Time to process "open" declarations are the top of each file. Processing these declarations have been observed to take time in some cases of F# compilation.
17
+
* Time to process "open" declarations at the top of each file. Processing these declarations have been observed to take time in some cases of F# compilation.
18
18
19
19
* Factors specific to the specific files being compiled.
Copy file name to clipboardExpand all lines: docs/debug-emit.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ Emitted debug information includes:
40
40
* The PDB file/information (embedded or in PDB file) which contains
41
41
* Debug "sequence" points for IL code
42
42
* Names of locals and the IL code scopes over which those names are active
43
-
* The attributes on IL methods such as `CompilerGeneratedAttribute` and `DebuggerNonUserCodeAttribute`, wee below
43
+
* The attributes on IL methods such as `CompilerGeneratedAttribute` and `DebuggerNonUserCodeAttribute`, see below
44
44
* We add some codegen to give better debug experiences, see below.
45
45
46
46
We almost always now emit the [Portable PDB](https://github.com/dotnet/runtime/blob/main/docs/design/specs/PortablePdb-Metadata.md) format.
@@ -73,7 +73,7 @@ We use the terms "sequence point" and "debug point" interchangeably. The word "s
73
73
74
74
Breakpoints have two existences which must give matching behavior:
75
75
76
-
* At design-time, before debugging is launched, `ValidateBreakpointLocation` is called to validate every breakpoint. This operators on the SyntaxTree and forms a kind of "gold-standard" about the exact places where break points are valid.
76
+
* At design-time, before debugging is launched, `ValidateBreakpointLocation` is called to validate every breakpoint. This operates on the SyntaxTree and forms a kind of "gold-standard" about the exact places where break points are valid.
77
77
78
78
* At run-time, breakpoints are "mapped" by the .NET runtime to actual sequence points found in the PDB data for .NET methods. The runtime searches all methods with debug points for the relevant document and determines where to "bind" the actual breakpoint to. A typical debugger can bind a breakpoint to multiple locations.
79
79
@@ -201,14 +201,14 @@ Other computation expressions such as `async { .. }` or `builder { ... }` get de
201
201
202
202
* For every `builder.TryFinally` call, a debug point covering the `try` keyword is added immediately within the body lambda expression. A debug point covering the `finally` keyword is added immediately within the finally lambda expression. No debug point is added for the `builder.TryFinally` call itself even if used in statement position.
203
203
204
-
* For every `builder.Yield`, `builder.Return`, `builder.YieldFrom` or `builder.ReturnFrom` call, debug points are placed on the expression as if it were control flow. For example `yield 1` will place a debug point on `1`and `yield! printfn "hello"; [2]` will place two debug points.
204
+
* For every `builder.Yield`, `builder.Return`, `builder.YieldFrom` or `builder.ReturnFrom` call, debug points are placed on the expression as if it were control flow. For example `yield 1` will place a debug point on `1`and `yield! printfn "hello"; [2]` will place two debug points.
205
205
206
206
* No debug point is added for the `builder.Run`, `builder.Run` or `builder.Delay` calls at the entrance to the computation expression, nor the `builder.Delay` calls implied by `try/with` or `try/finally` or sequential `Combine` calls.
207
207
208
208
The computations are often "cold-start" anyway, leading to a two-phase debug problem.
209
209
210
210
The "step-into" and "step-over" behaviour for computation expressions is often buggy because it is performed with respect to the de-sugaring and inlining rather than the original source.
211
-
For example, a "step over" on a "while" with a non-inlined `builder.While` will step over the whole call, when the used expects it to step the loop.
211
+
For example, a "step over" on a "while" with a non-inlined `builder.While` will step over the whole call, when the user expects it to step the loop.
212
212
One approach is to inline the `builder.While` method, and apply `[<InlineIfLambda>]` to the body function. This however has only limited success
213
213
as at some points inlining fails to fully flatten. Builders implemented with resumable code tend to be much better in this regards as
214
214
more complete inlining and code-flattening is applied.
@@ -298,7 +298,7 @@ Debug points for `task { .. }` poses much harder problems. We use "while" loops
298
298
299
299
As mentioned above, other computation expressions such as `async { .. }` have significant problems with their debug points.
300
300
301
-
The main problem is stepping: even after inlining the code for computation expressions is rarely "flattened" enough, so, for example, a "step-into" is required to get into the second part of an `expr1; expr2` construct (i.e. an `async.Combine(..., async.Delay(fun () -> ...)))`) where the user expects to press "step-over".
301
+
The main problem is stepping: even after inlining the code for computation expressions is rarely "flattened" enough, so, for example, a "step-into" is required to get into the second part of an `expr1; expr2` construct (i.e. an `async.Combine(..., async.Delay(fun () -> ...))`) where the user expects to press "step-over".
302
302
303
303
Breakpoints tend to be less problematic.
304
304
@@ -336,7 +336,7 @@ These methods also get `CompilerGeneratedAttribute`, and `DebuggerNonUserCodeAtt
336
336
337
337
> TODO: we should also consider emitting `ExcludeFromCodeCoverageAttribute`, being assessed at time of writing, however the absence of debug points should be sufficient to exclude these.
338
338
339
-
> TODO: the `NewABC` methods are missing `CompilerGeneratedAttribute`, and `DebuggerNonUserCodeAttribute`. However the absence of debug points should be sufficient to exclude these from code coverage and profiling.
339
+
> TODO: the `NewABC` methods are missing `CompilerGeneratedAttribute`, and `DebuggerNonUserCodeAttribute`. However, the absence of debug points should be sufficient to exclude these from code coverage and profiling.
340
340
341
341
### Generated closures for lambdas
342
342
@@ -464,7 +464,7 @@ We do some "extra" code gen to improve debugging. It is likely much of this coul
464
464
465
465
### 'this' value
466
466
467
-
For `member x.Foo() = ...` the implementation of the member adds a local variable `x` containing the `this` pointer from `ldarg.0`. THis means hovering over `x` in the method produces the right value, as does `x.Property` etc.
467
+
For `member x.Foo() = ...` the implementation of the member adds a local variable `x` containing the `this` pointer from `ldarg.0`. This means hovering over `x` in the method produces the right value, as does `x.Property` etc.
Copy file name to clipboardExpand all lines: docs/diagnostics.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ and functions
21
21
22
22
## Diagnostic messages
23
23
24
-
For the compiler, a key file is `FSComp.txt`olding most of the messages. There are also a few other similar files including some old error messages in `FSStrings.resx`.
24
+
For the compiler, a key file is `FSComp.txt`holding most of the messages. There are also a few other similar files including some old error messages in `FSStrings.resx`.
Copy file name to clipboardExpand all lines: docs/large-inputs-and-stack-overflows.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ The compiler accepts large inputs such as:
19
19
20
20
The compiler performs constant folding for large constants so there are no costs to using them at runtime. However, this is subject to a machine's stack size when compiling, leading to `StackOverflow` exceptions if those constants are very large. The same can be observed for certain kinds of array, list, or sequence expressions. This appears to be more prominent when compiling on macOS because macOS has a smaller stack size.
21
21
22
-
Many sources of `StackOverflow` exceptions prior to F# 4.7 when processing these kinds of constructs were resolved by processing them on the heap via continuation passing techniques. This avoids filling data on the stack and appears to have negligible effects on overall throughout or memory usage of the compiler.
22
+
Many sources of `StackOverflow` exceptions prior to F# 4.7 when processing these kinds of constructs were resolved by processing them on the heap via continuation passing techniques. This avoids filling data on the stack and appears to have negligible effects on overall throughput or memory usage of the compiler.
Copy file name to clipboardExpand all lines: docs/optimizations.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ let sumBy f xs =
65
65
loop xs 0
66
66
```
67
67
68
-
The inner `loop` function is emitted as a separate static method named `loop@2` and incurs no overhead involved with allocatin an `FSharpFunc` at runtime.
68
+
The inner `loop` function is emitted as a separate static method named `loop@2` and incurs no overhead involved with allocating an `FSharpFunc` at runtime.
69
69
70
70
In [`LowerCallsAndSeqs.fs`](https://github.com/dotnet/fsharp/blob/main/src/fsharp/LowerCallsAndSeqs.fs), a few optimizations are performed:
@@ -81,7 +81,7 @@ The following are the key phases and high-level logical operations of the F# com
81
81
82
82
*_Pattern match compilation_, see [PatternMatchCompilation.fsi](https://github.com/dotnet/fsharp/blob/main/src/fsharp/PatternMatchCompilation.fsi)/[PatternMatchCompilation.fs](https://github.com/dotnet/fsharp/blob/main/src/fsharp/PatternMatchCompilation.fs). Accepts a subset of checked Typed Tree nodes representing F# pattern matching and produces Typed Tree expressions implementing the pattern matching. Called during type checking as each construct involving pattern matching is processed.
83
83
84
-
*_Constraint solving_, see [ConstraintSolver.fsi](https://github.com/dotnet/fsharp/blob/main/src/fsharp/ConstraintSolver.fsi)/[ConstraintSolver.fs](https://github.com/dotnet/fsharp/blob/main/src/fsharp/ConstraintSolver.fs).A constraint solver state is maintained during type checking of a single file, and constraints are progressively asserted (i.e. added to this state). Fresh inference variables are generated and variables are eliminated (solved). Variables are also generalized at various language constructs, or explicitly declared, making them "rigid". Called during type checking as each construct is processed.
84
+
*_Constraint solving_, see [ConstraintSolver.fsi](https://github.com/dotnet/fsharp/blob/main/src/fsharp/ConstraintSolver.fsi)/[ConstraintSolver.fs](https://github.com/dotnet/fsharp/blob/main/src/fsharp/ConstraintSolver.fs).A constraint solver state is maintained during type checking of a single file, and constraints are progressively asserted (i.e. added to this state). Fresh inference variables are generated and variables are eliminated (solved). Variables are also generalized at various language constructs, or explicitly declared, making them "rigid". Called during type checking as each construct is processed.
85
85
86
86
*_Post-inference type checks_, see [PostInferenceChecks.fsi](https://github.com/dotnet/fsharp/blob/main/src/fsharp/PostInferenceChecks.fsi)/[PostInferenceChecks.fs](https://github.com/dotnet/fsharp/blob/main/src/fsharp/PostInferenceChecks.fs). Called at the end of type checking/inference for each file. A range of checks that can only be enforced after type checking on a file is complete, such as analysis when using `byref<'T>` or other `IsByRefLike` structs.
87
87
@@ -112,4 +112,4 @@ The F# compiler is bootstrapped. That is, an existing F# compiler is used to bui
112
112
113
113
## FSharp.Build
114
114
115
-
`FSharp.Build.dll` and `Microsoft.FSharp.targets` give MSBuild support for F# projects (`.fsproj`) and contain the. Although not strictly part of the F# compiler, they are essential for using F# in all contexts for .NET, aside from some more targeted scripting scenarios. The targets expose things like the `CoreCompile` and `Fsc` tasks called by MSBuild.
115
+
`FSharp.Build.dll` and `Microsoft.FSharp.targets` give MSBuild support for F# projects (`.fsproj`) and contain the targets. Although not strictly part of the F# compiler, they are essential for using F# in all contexts for .NET, aside from some more targeted scripting scenarios. The targets expose things like the `CoreCompile` and `Fsc` tasks called by MSBuild.
0 commit comments