Shlomi Fish wrote:
> Proper Tail Recursion is harder to debug, but consumes less memory and is
> faster to execute ...

It definitely consumes less memory, but performance is the same (until
the memory issue starts dominating...) I don't know what you mean by
debugging -- user code or parrot internals? Users may be confused when
caller() doesn't have the complete list of callers, but that doesn't
make debugging harder.

> For instance, we can have a "ret-with-call" opcode. However, isn't it
> exactly the same as a jump instruction ?

No. The current scope must be destroyed, lexicals destroyed, localized
globals restored, etc. It's basically the clean-up of a return, but the
control flow logic of a sub call.

> What is the current stance on implementing proper tail recursion in perl6?

You'd have to ask perl6-language. IMHO Parrot should have tail-call
ops even if perl6 doesn't specify tail recursion.

- Ken

Reply via email to