Could we use multiple stacks?
Eric W. Biederman
ebiederm@cse.unl.edu
Tue, 14 May 1996 23:32:43 -0500
Sorry for not posting sooner, I had lots of thinking to do.
As part of that I have implemented a rough approximation of my ideas.
I've written enough code now that it mostly works. More then has gone
before but I still think not quite enough to use as the lll.
On Mon, 29 Apr 1996, Eric W. Biederman wrote:
> That is could we have (at least logically) 4 stacks.
> One for pointers
> One for ints
> One for floats
> One for return values
You forgot the return address stack. ;-)
Not really, My intention was to list the major stacks of ANS forth,
with an extra one for pointers.
> Or something along those lines.
>
> That way we would be implementing a more traditional forth, varying in
> only where values are put.
^^^^ That's a pretty significant variation!
You're right. But it's not noticeable if you simply use words that
take and consume the arguments. I was thinking of doing something
analogous to what ANS forth does with floating point words, either on
the data stack, or on a special floating point stack.
Besides, it really doesn't help with typing things in memory. If we can
get this to be done the same way as on the stack, we gain an enormous
simplification.
Right the object system ( What provides the types ), and how it is
implemented is what is important. What we really need to provide is a
reflexive (how objects are implemented should be totally up to the
user) interface to the garbage collector.
My current leanings are toward a forth type system that has root
pointer stack. Basically anything you aren't sure is referenced to
from somewhere else would have to be passed on it. But otherwise you
can do as you please. Since ANS forth is all explicit memory
management we could handle it with no trouble.
I strongly suspece that Garbage collection is not the right solution
for every memory management task.
Eric