Re: using MISC (post 1987 Forth hardware) opcodes




Adam Warner wrote:

We agree I did not provide a good enough example to support my claim. This
one should be bulletproof: You have a reason to trace though a deep
tree-like data structure. Mechanically this involves pushing paths you
still need to travel onto a stack every time you branch within the tree.
Recursion makes this mechanical process invisible.

That's not a problem. All you have to do is to use a threaded tree.

See: http://datastructures.itgo.com/trees/tbt.htm

An environment with six cell stacks cannot traverse this data structure
(without implementing userspace stacks out of heap memory). The stack is
blown around point 7 (earlier if there is already data on the return stack).

Or without altering the data structure and using a threaded tree.

A six cell environmental dependency is simply too low for general purpose
programming tasks. Whoever is willing to concede this (by highlighting a
specialised embedded environment) should beware of claiming that such a
restricted environment is also easier to program.

Regards,
Adam

I fail to see how such an enviornment is "restricted". As Jeff pointed
out
one can always implement "stacks in memory" if that's what someone
REALLY wants/needs to do. He did that on the F21 in order to support
an ANS Forth. But is that how you want your stacks to GENERALLY
be made? If I can have a MUCH faster hardware stack and then on
occassion use an in-memory stack (or be more thoughtfull on my
data structure choice) how am I at a disadvantage from using an
in-memory stack all of the time?

Regards,

John M. Drake

.



Relevant Pages

  • Re: Yet Another Spinoza Challenge
    ... It's obviously a very, very sensible choice, but it is not the only ... Any searchable dynamic data structure will do. ... In what sense are you using the word "stack" in the above paragraph? ... The push operation ...
    (comp.lang.c)
  • Re: CFileDialog: "My Computer" not shows files and dirs
    ... CFileDialog, the dialog and the programm crashes! ... invalid instruction exception caused by a stack clobber, ... the data structure is actually longer and a memory overwrite occurs. ... You can install ...
    (microsoft.public.vc.mfc)
  • Controlled types and exception safety
    ... I can classify the stack's operations by assigning them any of the above four levels, so that I know what can be expected when an exception is thrown for any reason (like inability to allocate more memory, or alike). ... For example, if the Push method of the stack gives me the strong guarantee, then I *know* that by calling this method either the new element will be appended to the stack, or the stack will remain unchanged, so that even if the exception is thrown, I don't have to worry about the stack's internal consistency. ... Since stack can be a dynamic data structure, assigning one stack object to another may involve destroying one existing data structure *and* creating a new one in its place. ...
    (comp.lang.ada)
  • Re: Encrypt/ Decrypt in NdisIM with Ethernet
    ... That again could be because stack gets corrupted. ... write to an array or initialize a data structure? ... when I break the debug to enter some ... >>> A fatal system error has occurred. ...
    (microsoft.public.development.device.drivers)