You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we use the Z combinator for singly recursive functions and this for mutually recursive functions, but this is really inefficient. Adding fix to the AST to handle at least singly recursive functions should improve performance substantially. But what about mutual recursion?
Do we add PIR-style letrec that can handle both singly recursive and mutually recursive functions? This would significantly complicate the AST.
Do we just give up on supporting efficient mutual recursion and tell people to encode it using single recursion like this?
Do we add fixBy as an AST node as well? Or, given the above point, do we even need fixBy at all?
I think I personally prefer the second option.
The text was updated successfully, but these errors were encountered:
Implemented in #6793. The numbers are rather disappointing:
Yet, even with such a performance-focused design the results are very underwhelming: nofibisn't detectably faster (do we have other benchmarks that get recompiled every time?). The lists benchmarks are faster by up to 14.5%, which is normally a very welcome improvement, but given that we're adding an entire new AST node (with very non-trivial evaluation rules), is it worth it?
I no longer think this is a good idea to do this and I don't know anyone who does, so I'm closing the PR and this issue.
Currently we use the Z combinator for singly recursive functions and this for mutually recursive functions, but this is really inefficient. Adding
fix
to the AST to handle at least singly recursive functions should improve performance substantially. But what about mutual recursion?letrec
that can handle both singly recursive and mutually recursive functions? This would significantly complicate the AST.fixBy
as an AST node as well? Or, given the above point, do we even needfixBy
at all?I think I personally prefer the second option.
The text was updated successfully, but these errors were encountered: