Mutual tail call optimisation doesn't work in C++ either.

Because it's not a language feature in C++ or D. It is not required by the standards of either language. It's an optimisation which compilers apply. I am guessing you are using DMD, which might not offer the best optimisations for runtime code, but has other benefits.

You might want to try GDC or LDC. I am not certain if they implement tail call optimisations, but they might do, and it seems like a good optimisation to have. I'm sure this has been discussed before.

Reply via email to