Hacker News new | ask | show | jobs
by hongbo_zhang 3585 days ago
yes, we will have this warning when upgraded into OCaml 4.04 Note that optimizing mutual recursive call is a very hard problem it needs VM level support
1 comments

Mutual tail call optimization requires VM level support in general but can be accomplished within a compiliation unit (module) via inlining.
Seems like it should also be possible to have the compiler employ JavaScript generator functions (i.e. `yield`) and iteration as a substitute for growing the stack, which might be a bit more flexible than rewriting in terms of loops+thunks, though the concept is the same.