Skip to content

Conversation

@vzarytovskii
Copy link
Member

Description

WIP to suport special tailcall members in CEs - ReturnFromFinal & YieldFromFinal. It's just an initial prep work to pass the flag around - when we can and can't tailcall.

Checklist

  • Test cases added
  • Performance benchmarks added in case of performance changes
  • Release notes entry updated
  • RFC added

@github-actions
Copy link
Contributor

❗ Release notes required

@vzarytovskii,

Caution

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:

* <Informative description>. ([PR #XXXXX](https://github.com/dotnet/fsharp/pull/XXXXX))

See examples in the files, listed in the table below or in th full documentation at https://fsharp.github.io/fsharp-compiler-docs/release-notes/About.html.

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

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/8.0.300.md No release notes found or release notes format is not correct

@abelbraaksma
Copy link
Contributor

For posterity:

I think this applies to these suggestions: fsharp/fslang-suggestions#1006 and fsharp/fslang-suggestions#1200 (dupe).
Related discussion in TaskSeq: fsprojects/FSharp.Control.TaskSeq#62

@edgarfgp
Copy link
Contributor

Thanks for tackling this. This will help us in our Fabulous DSL

@majocha
Copy link
Contributor

majocha commented Jul 31, 2025

I'd like to revive this. As I understand, the tree walking / translation part is almost done, just emit the ReturnFromFinal etc. if present in the builder. Then it's up to the builder to do something special with the call.

For example, I'm thinking how can the TaskBuilder utilize this. This is tricky given that it:

  1. can bind an async, or any awaitable, not just another task, in the tailcall position.
  2. returns a naked, already started task.

I have some ideas, I'll try to come up with something this week.

@edgarfgp
Copy link
Contributor

edgarfgp commented Aug 6, 2025

@majocha i believe this PR can be close now right ?

@edgarfgp edgarfgp closed this Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants