[stack] What are the advantages and disadvantages in manipulation of the return stack
"blazeski" <[email protected]> Mon, 14 Jun 2010 09:10:53 -0000
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
I've created an interpreter for a stack language in c++: Currently it supports: - data types : int , float, char, void will add later double,enum - operations + - * / abs - define Support for scrips is approaching completion. However I'm little confused about what primitives should I offer beside the above. My implementations runs by using a DEQUE holding parsed but unevaluated syntax tree [ future of computation] and a "STACK" holding evaluated values [past of the computation]. I've ripped of Steven Apter XY (*) because that looked like the easiest to implement. Now I'm confused about what primitives should I have in the core. The ones offered by XY seems far different then classical base (swap, dup, drop, dip, cons, uncons, null, and if). Also XY offers manipulation of the return stack, or queue(**) . So what are the upsides and downsides of allowing programmer to manipulate the return stack? (*)http://www.nsl.com/k/xy/xy.htm (**) Though it looks like a deck to me: <= moves the tail of the queue to the top of the stack: / prepends to the queue the item found at the top of the stack.