plutus
plutus copied to clipboard
Add `fix` to the AST
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
letrecthat 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
fixByas an AST node as well? Or, given the above point, do we even needfixByat all?
I think I personally prefer the second option.