guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [VM] Tail recursion and multiple values


From: Ludovic Courtès
Subject: Re: [VM] Tail recursion and multiple values
Date: Mon, 02 Mar 2009 00:48:22 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux)

Hello!

Andy Wingo <address@hidden> writes:

> On Sat 28 Feb 2009 15:45, address@hidden (Ludovic Courtès) writes:

>> Actually no: it works with VM-compiled code, but it breaks when using
>> Guile-VM with `,o interp #t' (which appears to be the default, except at
>> the REPL).
>
> This is a misunderstanding.
>
> Last things first: code is not run through the VM unless it is compiled.
> The REPL in the vm branch compiles expressions by default, though it has
> an option to use the interpreter instead (,option interp #t).

Understood.

> So what I really mean to say is:
>
>   1) It is expected that you don't have tail recursion between
>      interpreted and VM code.
>
>   2) This particular problem manifests itself in that call-with-values
>      is VM code (when r5rs.scm is compiled).

(The latter is what I meant to say in my message.)

As for (1), I'm unsure.  The issue is that as long as running code with
the interpreter is the default, people may hit this kind of problem,
which is, well, problematic.  Now, I have no idea how this could be
solved without resorting to dirty hacks such as the one you suggested.

As a side note, I think it makes sense to keep the interpreter as the
default when evaluating `.scm' files since compilation can be costly and
may not pay off (e.g., if the compiler performs smart optimizations,
and/or the program is short-lived).

Thanks,
Ludo'.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]