Implement iterative workaround for recursion limit with Julia's default stack size.