fslaborg / flips

Fsharp LInear Programming System
https://flipslibrary.com/#/
MIT License
251 stars 32 forks source link

Add tests that ensure recursion uses tail calls #163

Open TysonMN opened 3 years ago

smoothdeveloper commented 3 years ago

I feel the pain, not too far ago, hitting those crashes...

On the language side, https://github.com/fsharp/fslang-suggestions/issues/721 would come very handy for this kind of stuff (if you haven't upvoted), also, given how F# lean on that, it would definitely be nice feature to have.

Is there a plan to put those asserts in place in terms of implementing such tests? Or is it having tests that exercise code with models that are large enough as to produce such issues?

TysonMN commented 3 years ago

I knew that such an F# language suggestion existed, but I hadn't upvoted it. Thanks for the link.

Since that attribute or language feature doesn't exist yet, I was planning on creating tests that exercise the code using sufficiently large instances of the relevant types. It is certainly more work than using that attribute but also not hard.

smoothdeveloper commented 11 months ago

@TysonMN, the suggestion for [] has been implemented; on next release of FSharp.Core, it can be adorned in the library, and next release of compiler will have it as static check, maybe only in preview version initially.

TysonMN commented 11 months ago

Nice. Can you share a link to that?