Skip to content

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

Draft
Tseing wants to merge 5 commits into
fable-compiler:mainfrom
Tseing:feat/async
Draft

Tseing wants to merge 5 commits into
fable-compiler:mainfrom
Tseing:feat/async

Conversation

@Tseing

@Tseing Tseing commented Sep 16, 2026

Copy link
Copy Markdown

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.

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.

1 participant