-
Notifications
You must be signed in to change notification settings - Fork 831
WIP Async2 #18873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
WIP Async2 #18873
Conversation
❗ Release notes requiredCaution No release notes found for the changed paths (see table below). Please make sure to add an entry with an informative description of the change as well as link to this pull request, issue and language suggestion if applicable. Release notes for this repository are based on Keep A Changelog format. The following format is recommended for this repository:
If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request. You can open this PR in browser to add release notes: open in github.dev
|
|
To avoid confusion - it's not the same "async2" as in runtime-supported async. It's just different re-implementation of async, right? |
Nope, no. I wasn't even aware this was a thing until now :) The goal is to possibly replace all the internal use of async and cancellable with one reasonably efficient resumable CE. I went with async2 name after the example in resumable code RFC. LOL, probably before I ever finish this, the runtime async model will switch to https://github.com/dotnet/runtimelab/blob/feature/async2-experiment/docs/design/features/runtime-handled-tasks.md I guess this is the fate, always catching up :) |
|
I updated more places where previously |
| <Compile Include="..\..\src\Compiler\Utilities\Async2.fs"> | ||
| <Link>CompilerService\Async2.fs</Link> | ||
| </Compile> | ||
| <Compile Include="..\..\src\Compiler\Facilities\AsyncMemoize.fs"> | ||
| <Link>CompilerService\AsyncMemoImpl.fs</Link> | ||
| </Compile> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linked sources like these seem to bring down VS to a crawl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably related to in memory cross proj references. Project options manager goes into a loop of invalidating projects and type checks everything endlessly.
|
I made the accessibility public for the whole thing for now, dealing with inline internal stuff across test projects is pita. One usability advantage over the normal |
|
Implementing fast tail call with One possible solution is to thread a |
|
I went simply with TaskCompletionSource as a tail-call context. With |
Currently just replaces cancellable.
Features: cold start, multi-start, cancellable, trampolined binds for safe non-tail recursion, fast tail-recursion with
ReturnFromFinal, exceptions cached in ExceptionDispatchInfo for fast recovery from deep call stacks.Synchronous executions should be quite fast and low alloc when it's done, but there are some fixes needed:
Currently complex mut rec expressions are not statically compiled, see the nowarn in
CheckDeclarations.fs.Very initial work.