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

Support tail recursion #97

Open
GoogleCodeExporter opened this issue Jun 21, 2015 · 5 comments
Open

Support tail recursion #97

GoogleCodeExporter opened this issue Jun 21, 2015 · 5 comments
Labels
auto-migrated blocked Issue requires some sort of folow-up action to unblock bug upstream Source of issue is possibly upstream to Unquote (e.g. FSharp.Core)

Comments

@GoogleCodeExporter
Copy link

let tailTest =
  <@   let rec sum a b = if a > 0 then sum(a - 1) (b + 1) else b
       sum (1024*1024*128) 0 @>
tailTest.Eval()

should work without StackOverflowException

Original issue reported on code.google.com by [email protected] on 28 May 2012 at 2:08

@enricosada
Copy link

I think the F# team would have to build support for tail recursion into their F# reflection API for this
to work. Indeed, this might be consider a bug in FSharpValue.MakeFunction,
which is what we use to make F# functions from Lambda expressions

@dsyme @eiriktsarpalis do you know is that's still an issue in quotation?

@dsyme
Copy link

dsyme commented Mar 30, 2017

@stephen-swensen

A couple of things - first, Unquote is amazing and I should have been helping with issues like this.

Second, substantively:

I think the F# team would have to build support for tail recursion into their F# reflection API for this
to work. Indeed, this might be consider a bug in FSharpValue.MakeFunction,
which is what we use to make F# functions from Lambda expressions

Yes, I can see what you mean. Could you add this issue to http://github.com/fsharp/fslang-suggestions and we can iterate towards a concrete design suggestion here?

thanks!
don

p.s. please feel free to contact me directly if you want to discuss any technical issues

@stephen-swensen
Copy link
Contributor

@dsyme three years later, thanks for kind words and sentiments :) I'll yet follow up with a support issue when I'm able to focus on this issue again.

Stephen

@stephen-swensen stephen-swensen added the blocked Issue requires some sort of folow-up action to unblock label Oct 27, 2020
@stephen-swensen stephen-swensen added the upstream Source of issue is possibly upstream to Unquote (e.g. FSharp.Core) label Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-migrated blocked Issue requires some sort of folow-up action to unblock bug upstream Source of issue is possibly upstream to Unquote (e.g. FSharp.Core)
Projects
None yet
Development

No branches or pull requests

4 participants