Skip to content
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

Fix 996 - resource usage of infinite sequence expression containing "let rec" #3536

Merged
merged 1 commit into from
Sep 1, 2017

Conversation

dsyme
Copy link
Contributor

@dsyme dsyme commented Sep 1, 2017

This fixes #996 by adding a "let rec" case to the compilation of sequence expressions to state machines

As noted in #996, compiling to these sequence expressions to state machines ensures that even infinite "tailcalling" sequences can execute with finite resources

From the user perspective this means that the introduction of an innocuous "let rec" doesn't change observed resource usage

As noted in the tests, this doesn't cover the case where a let rec is used to define a non-function value such as a memoization table.

Copy link
Member

@KevinRansom KevinRansom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

@KevinRansom KevinRansom merged commit 8917d88 into dotnet:master Sep 1, 2017
dsyme pushed a commit to dsyme/fsharp that referenced this pull request Oct 13, 2017
@dsyme dsyme mentioned this pull request Oct 13, 2017
dsyme pushed a commit to dsyme/fsharp that referenced this pull request Oct 13, 2017
KevinRansom pushed a commit that referenced this pull request Oct 13, 2017
@brettfo brettfo mentioned this pull request Oct 13, 2017
brettfo added a commit that referenced this pull request Oct 13, 2017
KevinRansom pushed a commit to KevinRansom/fsharp that referenced this pull request Oct 18, 2017
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.

Recursive sequence expression containing recursive definition doesn't run in finite space
3 participants