Ruby: recursion, stack size and tail call optimization

from blog blog.rpanachi.com, | ↗ original
To understand recursion, you must understand recursion. ― Author Unknown TL;DR Recursion is a tricky programming technique. It could be very useful or very harmful, depending of its use. The default Ruby VM (MRI) has a heap size limit to handle recursions. This may cause the catastrophic error SystemStackError for big recursion calls. There are...