On 06/01/2011 05:02 PM, Timothy Baldridge wrote:
We don't particularly care about fibonacci (which is the worst-case

    scenario here, recursion works better in cases where functions are
    bigger). However there is a plan how to go about it (without
    reimplementing the JIT). It's even relatively simple. It's just that
    fibonacci wasn't our major goal, but it does pop up every now and then
    :-) And yes, it'll be reusable in other interpreters without trouble.

What's the problem with recursive functions? I'm writing a interpreter
that uses trampolining internally to implement tail-calls, and I'm
wondering if I'll hit similar performance issues.

No, you won't. The trampoline function is the main loop of the interpreter, and the tail calls look like loops to the JIT then. Both Pyrolog and other experiments are implemented that way and it works fine (after some twiddling).

As I'm working on a
functional language my functions will tend to be quite small, and
tail-calls quite common.

Sounds exciting! What language are you implementing? I've been playing with Haskell the past three days actually.

Carl Friedrich
_______________________________________________
pypy-dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to