|
|
|
|
|
by gavinray
1514 days ago
|
|
Thanks for posting that link to Java tail recursion library, super handy + didn't know about it. You need tail recursion for writing expression evaluators/visitors frequently. I've been using an IntelliJ extension that can do magic by rewriting recursive functions to stateful stack-based code for performance, but it spits out very ugly code: https://github.com/andreisilviudragnea/remove-recursion-insp... > "This inspection detects methods containing recursive calls (not just tail recursive calls) and removes the recursion from the method body, while preserving the original semantics of the code. However, the resulting code becomes rather obfuscated if the control flow in the recursive method is complex."
It was this guy's whole Bachelor thesis I guess:https://github.com/andreisilviudragnea/remove-recursion-insp... |
|