mlscript
mlscript copied to clipboard
Tail Recursion Optimization in the Block IR
In this PR:
- [x] Improve annotation system (supporting multiple annotation on terms, improved reporting system)
- [ ] Tail recursion optimization on tail recursive functions
- [ ] Tail recursion optimization for mutually tail-recursive functions
Note that functions containing a mix of tail-calls and non-tail-calls will also be supported, and you can assert that a particular call does not consume additional stack space by using the @tailcall annotation.
The logic will be the same as what is implemented https://github.com/hkust-taco/mlscript/pull/218.
This PR does not implement tail-rec mod cons.