This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Tail recursion and hobbit (was: finite state machines in guile)



Bernard, tell me if I've got this right:

Hobbit does turn some tail calls into jumps, if it is able to figure
out how.  However, tail calls to other top-level functions, and some
tail calls within a single top-level function, are not optimized, and
allocate additional stack space.

I don't see how Hobbit could do better, given that it has decided to
match the SCM calling conventions.  It has the same problems GCC
does: if it could know the nature of the callee ahead of time, it
could use a better calling convention, but failing that, it can't do
tail calls.