Message from discussion why forth over lisp?
From: Duane Rettig <du...@franz.com>
Subject: Re: why forth over lisp?
Date: Tue, 24 Aug 2010 09:10:35 -0700 (PDT)
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: posting.google.com 1282666235 7388 127.0.0.1 (24 Aug 2010 16:10:35 GMT)
NNTP-Posting-Date: Tue, 24 Aug 2010 16:10:35 +0000 (UTC)
Injection-Info: s9g2000yqd.googlegroups.com; posting-host=188.8.131.52; posting-account=aGEh5QoAAABuGan_Dwoukh9PssCDiBhh
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-us)
AppleWebKit/533.17.8 (KHTML, like Gecko) Version/5.0.1 Safari/533.17.8,gzip(gfe)
On Aug 23, 1:19=A0pm, Nick <3-nos...@temporary-address.org.uk> wrote:
> George Neuner <gneun...@comcast.net> writes:
> > Lua 5 still is basically a stack machine - it's a variant of what's
> > generally called a "deep access" stack, in which the machine can
> > access "deep" stack elements directly. =A0Lua's variation does away wit=
> > push/pop/etc. top-of-stack instructions.
> I find it hard to attach the term "stack" to something that doesn't have
> "push/pop/etc". That is, to me, what makes it a stack rather than some
> other sort of data structure.
Think of a stack as a LIFO (Last In, First Out) queue. The question
is: what is going in and out? In this day and age of cache
management, a push/pop of a single natural word (4 or 8 bytes) is
ludicrous for performance, especially when the movement of the stack
pointer is sometimes accompanied by extra checks and/or guard page
faults. So think of a higher level program which uses activation
frames as a cached stack, which beef up performance in the area of
stack access. The frames are still layed into memory in LIFO fashion
(with exceptions, of course, like non-local exits and, in some
languages, Continuation Passing Style, but this does not remove the
importance of the stack at the lower level.