Re: [stack] What are the advantages and disadvantages in manipulation of the return stack

stevan apter <[email protected]> Mon, 14 Jun 2010 09:42:02 -0400
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
the core words of XY are:
        ->      queue           [X^z Y] -> [X z]
        <-      stack           [X^z Y] -> [z Y]

        =>      cache           [X^z Y] -> [X Y^z]
        <=      uncache         [X Y^z] -> [X^z Y]

        /       use             [X^z Y] -> [X z,Y]
        \       mention         [X z^Y] -> [X^z Y]

        `       enclose         [X^z Y] -> [X^{z} Y]
                disclose        [X^{z} Y] -> [X^z Y]
in XY 0 i offered an alternative to => and <=:
        (       stack*          [X Y] -> [X^[X] Y]
        )       queue*          [X Y] -> [X^[Y] Y]
the familiar base can then be defined using the XY core words.

here's the overview i wrote up on manfred's request:

	http://www.nsl.com/k/xy/xy.txt

i don't know what the practical advantages and disadvantages are to
allowing the programmer access to the return stack.  my reasons for
designing XY as i did were mainly aesthetic.  (and for those reasons
i strongly prefer XY 0 to the initial version of the language.)

i think chris double (on this list) has had a go at a "serious"
implementation of some of the ideas in XY, by which i mean that he
actually intends to use the result in some applications.  so he's
probably the guy whose opinions you should seek on this matter.
On Jun 14, 2010, at 5:10 AM, blazeski wrote:

> 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.
> 
> 



[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/concatenative/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/concatenative/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/