reference icon indicating copy to clipboard operation
reference copied to clipboard

Consider describing the phases of translation

Open ehuss opened this issue 4 years ago • 0 comments

The reference currently doesn't really make it clear how certain steps of translation happen, how they relate to one another, and the significance. I think it would be useful to have a section that makes this clear. Some rough thoughts on this:

  • Better explain the process of tokenization, parsing, and tie this into crates as the unit of translation.
  • Parsing's relationship with expansion, and maybe name resolution.
  • Attribute behavior, such as inert/active, particularly when cfg pruning is done. (#103, #565, #836)
  • Attribute evaluation order (#692, #578), or maybe just a link to a dedicated chapter on expansion?
  • Validation is performed after parsing/expansion.
  • There have been some discussions of defining the language in terms of translations between different representations (tokens > AST > HIR > MIR > etc.), since some topics may be easier to document in those restricted definitions. I'm not sure how this relates, exactly, but seems relevant.

I am roughly thinking of something like https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure, or C++'s phases of translation.

This I think would also tie in with the rework of the lexical chapter (#567).

ehuss avatar Jan 01 '21 21:01 ehuss