Functional languages lead to use of recursion to solve a lot of problems, and therefore many of them perform Tail Call Optimization (TCO). TCO causes calls to a function fro
TCO can also be compiled in by tweaking a couple variables in vm_opts.h before compiling: https://github.com/ruby/ruby/blob/trunk/vm_opts.h#L21
// vm_opts.h #define OPT_TRACE_INSTRUCTION 0 // default 1 #define OPT_TAILCALL_OPTIMIZATION 1 // default 0