lightning
[Top][All Lists]
Advanced

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

Re: [Lightning] Lightning Digest, Vol 74, Issue 4


From: Marc Nieper-Wißkirchen
Subject: Re: [Lightning] Lightning Digest, Vol 74, Issue 4
Date: Sat, 10 Jan 2015 08:27:40 +0100


Message: 2
Date: Fri, 09 Jan 2015 14:12:58 -0800
From: Francis McCabe <address@hidden>
To: address@hidden
Subject: [Lightning] Tail calls - a better way
Message-ID: <address@hidden>
Content-Type: text/plain; charset=utf-8

Could not help butting in here.

Paulo suggests the ?classic? way of implementing tail calls - by ?sliding? the new activation over the old one.

It turns out that there is a strictly faster way of implementing tail call optimization: garbage collecting the evaluation stack.

The idea would be to continue processing tail calls in the identical way to regular calls - but, when a GC is required (by stack overflow for example) the evaluation stack can be garbage collected of junk frames.

In terms of support required, it would have to be similar to other GC support schemes; except that there would have to be standard ways of walking the stack - something that is useful for other applications (like debugging).

Are you supposing Cheney's algorithm? Is it really faster than not touching the real stack at all and simply jumping instead of calling into "functions"? It also seems more complicated when GNU lightning will have to expose some stack internals, I guess, than what Paulo suggested.

Marc

reply via email to

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