Hacker News new | ask | show | jobs
by gampleman 1575 days ago
I’m wondering in the Elm context if the compiler implemented this technique could it make a non stack safe recursion a compile time error?

And if it did, how restrictive would that be in practice?

1 comments

I think it could yes if you had a keyword for adding the guarantee.

If you didn't have a keyword, then all functions would have to be made stack-safe, which is I think a lot to ask the users in some cases, especially when the language doesn't give you all the tools for it (I think CPS does not work for instance in Elm, currently investigating that a bit).

If you have a keyword, then it would be as restrictive as you'd want it to be I imagine?