Is the async / await conversion process specified?

In C #, the process of converting LINQ query syntax to actual code that is executed is described in detail in section 7.16 of the language specification, which makes it easier for the language designer to use it to implement a similar query syntax to the new CLR language.

Is there a similar detailed specification of the async / await syntax added in C # version 5? One of Eric Lippert's blog posts on this subject shows a presentation before conversion in a specific scenario, but it’s not really revealing the basic rules at any useful level of detail. Is there a specification for this?

EDIT: I see that there is a section on wait expressions and asynchronous functions in the C # language specification. However, it is not anywhere near the same level of detail as in the LINQ section. Essentially, I'm looking for a description of the process that says: “Follow these steps to convert the code at the top of Eric's message to the state machine at the bottom of the message” so that the language designer can implement this function in another CLR language and end up having the same semantics.

+7
c # asynchronous specifications
source share
1 answer

This seems to be an implementation detail since it tends to change. For example. C # 6 will present the expectation in catch / finally outputs (the idea is generally described here ).

However, there is some detailed information on how expectations are met in C # 5. Look at the links, especially this: Async Codegen (ppt).

Thus, a language developer can implement this function in another CLR language and end up having the same semantics

I would recommend looking at the AsyncRewriter code .

+1
source share

All Articles