[Push] Input stack (from Psh)

Lee Spector lspector at hampshire.edu
Fri Jun 25 17:41:07 EDT 2010


As far as I remember (others correct me) the input stack is roughly this: Since Push1 a lot of runs/experiments have been done with a variety of techniques for accessing inputs. The idea of pushing them onto the stacks before you run the program has always been there, but people have also often added instructions that push the inputs in various ways (e.g. quoted to the code stack or pushed onto other stacks). If I recall correctly Alan Robinson described a bunch of this in his undergraduate thesis. 

In my old Lisp implementation I implemented instructions using global variables -- I'd define an input instruction that pushes the current value of the global(s) onto the stack(s), and set the globals to the relevant input(s) before running the program. When I wrote the Scheme implementation I wanted to avoid the use of globals so I created an "auxiliary" stack to store the data locally. I didn't provide stack manipulation instructions for the auxiliary stack, since it wasn't supposed to be manipulated by programs, just accessed using input instructions (which I wrote on a per-problem basis, not knowing what kinds of inputs or input-accessing instructions would make sense for new problems). I called it "auxiliary" rather than "input" because I thought that the local storage might be useful for other things as well.

While working up Psh Tom thought it'd be useful to firm this up as a fully-supported way to get input into Push programs and so he has renamed it "input" -- which is fine because I don't think anybody used "auxiliary" for anything other than input anyway, and besides we can always make another stack anyway.

So I guess the answers to your question are:

> Is there a description of the Input stack anywhere?

Not really, but it should be in the new documentation Tom is starting to put together.

> Is it implemented only in Psh?

The Psh version is implemented only in Psh, although there are auxiliary stacks and problem-specific input functions that use them in Schush and Clojush. And ways to accomplish the same thing in other implementations. If Tom's scheme works well we should try to spread it.

 -Lee

On Jun 25, 2010, at 5:16 PM, PerPlex Ed wrote:

> Another question related to Psh:
> 
> Is there a description of the Input stack anywhere?
> Is it implemented only in Psh?
> 
> Thomas said:
> > As far as I can tell, there is a name stack implemented, but no non-generic instructions defined for it. Generic instructions such as "push" and "dup" are defined. In addition, if a string is in a program and is not recognized as a Psh instruction, that string will be pushed onto the Name stack. But, no Define instructions are implemented at this time. I'm not sure if that was a design choice or just an omission that should be added. I'll look into it.
> 
> 
> _______________________________________________
> Push mailing list
> Push at lists.hampshire.edu
> https://lists.hampshire.edu/mailman/listinfo/push

--
Lee Spector, Professor of Computer Science
School of Cognitive Science, Hampshire College
893 West Street, Amherst, MA 01002-3359
lspector at hampshire.edu, http://hampshire.edu/lspector/
Phone: 413-559-5352, Fax: 413-559-5438

Check out Genetic Programming and Evolvable Machines:
http://www.springer.com/10710 - http://gpemjournal.blogspot.com/



More information about the Push mailing list