Recursion in Julia — bad idea?

It’s not so much that Julia is the wrong tool, but that recursion in Julia is the wrong tool. You can always rewrite your recursion by pushing and popping from a stack, and you know better than the compiler what data you care about. With the recursive solution, the compiler needs to keep around a bunch of extra information about what functions were called in order for return to go to the right place.

1 Like