"In fact, what makes you say that recursion is difficult to analyze? Inductive proofs over recursive algorithms are generally much nicer than proofs over iterative algorithms."
For static analysis purposes, it is not great.
Particularly if it is inside conditionals.
Either you eat exponential path blowup (assuming bounded recursion and context-sensitivity) and fix-point it, or collapse the whole call graph cycle starting at the recursion into a single result (which generates false positives).
This assumes a single-thread.
Concurrent javascript code, with recursion, does not even have a decidable reachability problem, which makes it very difficult to get good answers.
Suffice to say, what is easy/hard for humans to prove is not the same as computers.
You would have a much harder time getting good static analysis results from a recursive fibonacci function than an iterative one (and this is simple tail recursion)
For static analysis purposes, it is not great. Particularly if it is inside conditionals. Either you eat exponential path blowup (assuming bounded recursion and context-sensitivity) and fix-point it, or collapse the whole call graph cycle starting at the recursion into a single result (which generates false positives).
This assumes a single-thread.
Concurrent javascript code, with recursion, does not even have a decidable reachability problem, which makes it very difficult to get good answers.
Suffice to say, what is easy/hard for humans to prove is not the same as computers.
You would have a much harder time getting good static analysis results from a recursive fibonacci function than an iterative one (and this is simple tail recursion)