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: Andy Wingo
Subject: Re: [VM] Tail recursion and multiple values
Date: Tue, 03 Mar 2009 00:15:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Howdy howdy,

On Mon 02 Mar 2009 22:55, address@hidden (Ludovic Courtès) writes:

> Andy Wingo <address@hidden> writes:
>
>> The compiler
>> recognizes both call-with-values and @call-with-values, so we could just
>> not compile call-with-values; less nasty, but still nasty, and penalizes
>> the vm in the (apply call-with-values ...) case.
>
> Yes, but OTOH that's an unusual case, no?

Yes, it is.

>>> As a side note, I think it makes sense to keep the interpreter as the
>>> default when evaluating `.scm' files
>>
>> Sure, for now -- or we could do what python does, and automatically
>> create .go files as needed (and if possible). Then it would certainly
>> pay off over time, and the compilation time would probably be a wash
>> because in that case the .scm probably isn't even in the disk cache.
>
> I prefer having to compile things explicitly, though.

I prefer magic, if magic works ;-)

The compiler is almost to the point that it can replace the interpreter,
semantically. What is needed is to read and compile toplevel definitions
one at a time, so we can e.g. change the reader, or the other dynamic
things that people expect. Then if that's the case, then we can just hit
the user with the one-time cost, for the long-term benefit.

This would also allow us to move closer to having a single codepath,
which has its benefits, broader tail-recursion among them.

>>> if the compiler performs smart optimizations,
>>
>> Hahaahaha!
>
> To put it another way, the compiler may not be designed from the ground
> up to minimize compilation time, whereas the interpreter (supposedly)
> tries to achieve this.

I understand. I wish that we lived in a world in which (timewise)
compilation + running == interpretation, so we could just do the former,
but that is not yet our world. However both Chez and SBCL have the
former model, so in a software engineering sense it might be worth it,
in some future in which the compiler is faster.

So in that sense I'd really like to make sure that the compiler only
gets faster.

> Hey, walking in Dybvig's footsteps?  ;-)

I can only hope to do so ;-) That guy is smart!

Cheers,

Andy
-- 
http://wingolog.org/




reply via email to

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