Coding standards and idioms
The F# compiler code base is slowly being updated to better coding standards. There is a long way to go.
The future work includes
- [ ] Consistent use of fantomas formatting across as much of the codebase as feasible
- [ ] Consistent naming conventions
- [ ] Reduction in line length
- [ ] Reduction in single-character identifiers
- [ ] XML documentation for all types, members and cross-module functions
Abbreviations
The compiler codebase uses various abbreviations. Here are some of the most common ones.
Abbreviation |
Meaning |
---|---|
|
Accessor domain, meaning the permissions the accessing code has to access other constructs |
|
Assembly map, saying how to map IL references to F# CCUs |
|
Argument (parameter) |
|
Argument (parameter) type |
|
Argument (parameter) metadata |
|
Reference to an F# compilation unit = an F# DLL (possibly including the DLL being compiled) |
|
Custom attribute element |
|
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. |
|
Compilation path, meaning A.B.C for the overall names containing a type or module definition |
|
Constraint solver state. |
|
Display Environment. Parameters guiding the formatting of types |
|
An info object for an event (whether a .NET event, an F# event or a provided event) |
|
Expression |
|
Environment. Means different things in different contexts, but usually immutable state being passed and adjusted through a set of related functions in a single phase. |
|
An info object for a field (whether a .NET field or a provided field) |
|
A reference to an ILFieldRef Abstract IL node for a field reference. Would normally be modernized to |
|
The TcGlobals value |
|
Identifier |
|
Long Identifier |
|
A source code range marker |
|
IL interface method implementation |
|
An info object for a method (whether a .NET method, an F# method or a provided method) |
|
Means make in old fashioned F#/OCaml coding style |
|
a Typed Tree structure for a namespace or F# module |
|
Pattern, a syntactic AST node representing part of a pattern in a pattern match |
|
An info object for a property (whether a .NET property, an F# property or a provided property) |
|
Record or class field reference, a reference to a Typed Tree node for a record or class field |
|
The scope of a reference in IL metadata, either assembly, |
|
Sequence points or debug points |
|
Simple Pattern, a syntactic AST node representing part of a pattern in a pattern match |
|
A type with the "forall" nodes stripped off (i.e. the nodes which represent generic type parameters). Comes from the notation 𝛕 used in type theory |
|
Type constructor reference (an |
|
Type instantiation |
|
Type parameter environment, tracks the type parameters in scope during type checking |
|
Type, usually a Typed Tree type |
|
List of types, usually Typed Tree types |
|
Type Parameter |
|
Type Variable, usually referring to an IL type variable, the compiled form of an F# type parameter |
|
Union case reference, a reference to a Typed Tree node for a union case |
|
Value reference, a reference to a Typed Tree node for a value |
Phase Abbreviation |
Meaning |
---|---|
|
Abstract Syntax Tree |
|
Type-checker |
|
Abstract IL = F# representation of .NET IL |
|
Extended Abstract IL = .NET IL plus a couple of constructs that get erased |