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
{{ message }}
This repository has been archived by the owner on Feb 3, 2019. It is now read-only.
Tail calls of F can be famously rewritten into a GOTO as mentioned in #11. Another property of the tail call structure is that for f and g mutually tail recursive f and g can be rewritten into a finite state machine h such that when f returns (apply g x) this is simply a bytecode jump with no stack operations rather than being a stack call.
Such FSM transformation is valid if and only f and g (and potentially more functions) form a call graph clique where mutual calls occur only from the tail position. Mutually recursive calls not in the tail position cannot be rewritten as such.
Honestly I don't think a whole lot of Clojure code is structured such that this would be a valuable transform, but it would be interesting to build the requisite call graph clique analysis and see if that is in fact the case.
The text was updated successfully, but these errors were encountered:
Tail calls of F can be famously rewritten into a GOTO as mentioned in #11. Another property of the tail call structure is that for
f
andg
mutually tail recursivef
andg
can be rewritten into a finite state machineh
such that whenf
returns(apply g x)
this is simply a bytecode jump with no stack operations rather than being a stack call.Such FSM transformation is valid if and only
f
andg
(and potentially more functions) form a call graph clique where mutual calls occur only from the tail position. Mutually recursive calls not in the tail position cannot be rewritten as such.Honestly I don't think a whole lot of Clojure code is structured such that this would be a valuable transform, but it would be interesting to build the requisite call graph clique analysis and see if that is in fact the case.
The text was updated successfully, but these errors were encountered: