Hacker News new | ask | show | jobs
by theseoafs 3672 days ago
> Huge body of problems can be handled by simple recursion but I've yet to see non-functional programmers use it. I don't know why.

Stack overflows.

2 comments

"Functional" languages typically have tail-call optimization and heap-allocated frames. Maybe OOP is a workaround for these missing features...
Why doesn't your language have TCO?

"Nobody uses recursion."

Why doesn't anybody use recursion?

"No TCO."

Tail-call optimization eliminates those. Assuming your language provides it, and assuming you trigger it correctly. ;)

http://stackoverflow.com/questions/32164370/does-elixir-infi...

TCO eliminates some types of recursion. Not all of them.
Eliminates some types of stack usage, not "recursion".