Skip to content

feat(dart): add Async runtime and Future interop for dart - #4978

Merged
MangelMaxime merged 11 commits into
fable-compiler:mainfrom
Tseing:feat/async
Sep 20, 2026
Merged

MangelMaxime merged 11 commits into
fable-compiler:mainfrom
Tseing:feat/async

Conversation

@Tseing

@Tseing Tseing commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Hi! I'm using Fable in one of my Dart applications, and I need F# Async bindings there, so I added initial Async support to the Dart backend.

The implementation is based on the existing TypeScript version and adapted to Dart's Future.

Changes

  • Add Async runtime and AsyncBuilder support for core computation-expression operations.
  • Add cancellation support, including registrations, CancelAfter, and Async.CancellationToken.
  • Add Dart Future interoperability with Async.StartAsFuture and Async.AwaitFuture.
  • Add the required Dart type/member replacements.
  • Add async test support and coverage for core Async behavior, cancellation, suspension, and Future interoperability.

The implementation follows the structure and semantics of the existing TypeScript Async runtime where applicable, with Dart-specific handling for Future.

Would this be something you'd be open to adding to the Dart backend? I'm happy to adjust the implementation or scope if needed.

@MangelMaxime
MangelMaxime marked this pull request as ready for review September 20, 2026 13:49
@MangelMaxime

Copy link
Copy Markdown
Member

Thank you for the PR

@MangelMaxime
MangelMaxime merged commit b5a337d into fable-compiler:main Sep 20, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants