Justin | 31 Jan 2011 06:10
Picon
Favicon

Re: [stack] Concatenative Research

 


--- In concatenative <at> yahoogroups.com, "William Tanksley, Jr" <wtanksleyjr <at> ...> wrote:
>
> John Carter <john.carter <at> ...> wrote:
> > Justin <zallambo <at> ...> wrote:
>
> That's what I think of, yes -- minus the word "sugar". Not all syntax
> is "syntactic sugar". A language might be defined as "the mapping of
> syntax onto semantics"; thus, language design is concerned with
> defining syntax, semantics, and the mapping between them. Words like
> "syntax sugar" encourage a disregard for one of those crucial three
> components of language design.

I don't understand what you mean. Syntactic sugar is syntax that can be easily explained in terms of other syntax. It says, "rather than give you a mapping from 'for loop' syntax to semantics, I'm going to give you a mapping from 'for loop' syntax to 'while loop' syntax, and then you can use the mapping from 'while loop' syntax to semantics". What's wrong with that?

> Possibly true. I'd love to see this explored; it does seem that the
> "stack" is not _necessary_ to the idea of a concatenative language.

Indeed, my operational semantics does not involve a stack.

> > I would argue that any language where the function definitions are cluttered
> > with stack manipulations OR variable references has NOT yet met the full
> > promise of concatenative languages.
>
> I know what you mean. Forth, Joy, and Factor are all capable of being
> written without clutter; but it's widely admitted that it's easier to
> do in Factor than it is in Forth.

Why would you say that is? I know it allows both stack manipulation and variables; is this a potent combination, or is something else at work?

__._,_.___
Recent Activity:
    .

    __,_._,___
    William Tanksley, Jr | 31 Jan 2011 17:34
    Picon

    Re: [stack] Concatenative Research

     

    Justin <zallambo <at> yahoo.com> wrote:
    >"William Tanksley, Jr" <wtanksleyjr <at> ...> wrote:
    >> John Carter <john.carter <at> ...> wrote:
    >> > Justin <zallambo <at> ...> wrote:
    >> That's what I think of, yes -- minus the word "sugar". Not all syntax
    >> is "syntactic sugar". A language might be defined as "the mapping of
    >> syntax onto semantics"; thus, language design is concerned with
    >> defining syntax, semantics, and the mapping between them. Words like
    >> "syntax sugar" encourage a disregard for one of those crucial three
    >> components of language design.

    > I don't understand what you mean. Syntactic sugar is syntax that can be easily explained in terms of other syntax. [...] What's wrong with that?

    I didn't mean to imply that "syntactic sugar" should never be used,
    sorry. I meant that it's entirely inappropriate in the use to which I
    was replying. A concatenative language is, by definition, a language
    in which syntactic concatenation is the primary means of expressing
    composition. If there are other means (and there need not be), they
    are the syntactic sugar;concatenation is not.

    >> Possibly true. I'd love to see this explored; it does seem that the
    >> "stack" is not _necessary_ to the idea of a concatenative language.
    > Indeed, my operational semantics does not involve a stack.

    There's no profound reason why it needs to; my friend wrote a very
    simple code generator that used registers for the top stack items.
    However, using something other than a stack means that the behavior of
    the language is different; your operational semantics would be
    different.

    >> I know what you mean. Forth, Joy, and Factor are all capable of being
    >> written without clutter; but it's widely admitted that it's easier to
    >> do in Factor than it is in Forth.
    > Why would you say that is? I know it allows both stack manipulation and variables; is this a potent combination, or is something else at work?

    Something else. (Forth also has both.)

    Factor also has the cleave/spread combinators. From
    http://factor-language.blogspot.com/2008/03/inheritance-tuple-reshaping-cleavers.html:

    "These combinators help structure your data flow by grouping parts of
    computations into one-to-many, many-to-many and many-to-one designs."
    ... "For example, I recently converted our serialization library to
    use these combinators. The result is extremely straightforward: there
    is almost no stack manipulation, except for the occasional dup and
    drop, but it doesn't use named locals either. Thanks to the cleave
    combinators, all values just happen to be in the right place at the
    right time, and everything composes together very nicely, like lego
    bricks."

    -Wm

    __._,_.___
    Recent Activity:
      .

      __,_._,___
      Justin | 1 Feb 2011 00:36
      Picon
      Favicon

      [stack] Re: Concatenative Research

       


      --- In concatenative <at> yahoogroups.com, "William Tanksley, Jr" <wtanksleyjr <at> ...> wrote:
      >
      > Justin <zallambo <at> ...> wrote:
      > >"William Tanksley, Jr" <wtanksleyjr <at> > wrote:
      > I didn't mean to imply that "syntactic sugar" should never be used,
      > sorry. I meant that it's entirely inappropriate in the use to which I
      > was replying. A concatenative language is, by definition, a language
      > in which syntactic concatenation is the primary means of expressing
      > composition. If there are other means (and there need not be), they
      > are the syntactic sugar;concatenation is not.

      I see now; you are certainly right.

      > >> Possibly true. I'd love to see this explored; it does seem that the
      > >> "stack" is not _necessary_ to the idea of a concatenative language.
      > > Indeed, my operational semantics does not involve a stack.
      >
      > There's no profound reason why it needs to; my friend wrote a very
      > simple code generator that used registers for the top stack items.
      > However, using something other than a stack means that the behavior of
      > the language is different; your operational semantics would be
      > different.

      All I mean to say is that my operational semantics is general enough that it's completely ambivalent as to what kind of states a language's programs act on. There is no mention of stacks -- only states, which could be anything.

      http://dl.dropbox.com/u/17328602/concat/theory/concat.pdf

      > >> I know what you mean. Forth, Joy, and Factor are all capable of being
      > >> written without clutter; but it's widely admitted that it's easier to
      > >> do in Factor than it is in Forth.
      > > Why would you say that is? I know it allows both stack manipulation and variables; is this a potent combination, or is something else at work?
      >
      > Something else. (Forth also has both.)
      >
      > Factor also has the cleave/spread combinators. From
      > http://factor-language.blogspot.com/2008/03/inheritance-tuple-reshaping-cleavers.html:
      >
      > "These combinators help structure your data flow by grouping parts of
      > computations into one-to-many, many-to-many and many-to-one designs."
      > ... "For example, I recently converted our serialization library to
      > use these combinators. The result is extremely straightforward: there
      > is almost no stack manipulation, except for the occasional dup and
      > drop, but it doesn't use named locals either. Thanks to the cleave
      > combinators, all values just happen to be in the right place at the
      > right time, and everything composes together very nicely, like lego
      > bricks."

      I remember seeing references to 'cleave' and 'spread' but never knew what they were. They seem to be elegant tools; thanks for pointing them out.

      __._,_.___
      Recent Activity:
        .

        __,_._,___
        William Tanksley, Jr | 1 Feb 2011 01:31
        Picon

        Re: [stack] Re: Concatenative Research

         

        Justin <zallambo <at> yahoo.com> wrote:
        > "William Tanksley, Jr" <wtanksleyjr <at> ...> wrote:
        >> Justin <zallambo <at> ...> wrote:
        >> >> Possibly true. I'd love to see this explored; it does seem that the
        >> >> "stack" is not _necessary_ to the idea of a concatenative language.
        >> > Indeed, my operational semantics does not involve a stack.
        >> There's no profound reason why it needs to; my friend wrote a very
        >> simple code generator that used registers for the top stack items.
        >> However, using something other than a stack means that the behavior of
        >> the language is different; your operational semantics would be
        >> different.

        > All I mean to say is that my operational semantics is general enough that it's
        > completely ambivalent as to what kind of states a language's programs act
        > on. There is no mention of stacks -- only states, which could be anything.

        Yes, you're right. I don't know whether your study makes any
        stack-oriented assumptions later, but it doesn't make them in its
        opening sections.

        It may be that there's something special about a stack when it comes
        to the primary data transfer mechanism for a Turing-complete
        concatenative model. I don't know, and I'd like to.

        >> Factor also has the cleave/spread combinators. From
        >> http://factor-language.blogspot.com/2008/03/inheritance-tuple-reshaping-cleavers.html:
        >> "These combinators help structure your data flow by grouping parts of
        >> computations into one-to-many, many-to-many and many-to-one designs."
        > I remember seeing references to 'cleave' and 'spread' but never knew what they were. They seem to be elegant tools; thanks for pointing them out.

        Indeed, and like all elegant tools, they are from a more civilized
        age. They were invented by Backus for FP and FL, the languages that
        gave us the term "functional languages", although none of their
        immediate successors met their definition of being functional
        languages.

        -Wm

        __._,_.___
        Recent Activity:
          .

          __,_._,___
          Justin | 2 Feb 2011 03:25
          Picon
          Favicon

          [stack] Re: Concatenative Research

           


          --- In concatenative <at> yahoogroups.com, "William Tanksley, Jr" <wtanksleyjr <at> ...> wrote:
          > Indeed, and like all elegant tools, they are from a more civilized
          > age. They were invented by Backus for FP and FL, the languages that
          > gave us the term "functional languages", although none of their
          > immediate successors met their definition of being functional
          > languages.

          I never fail to be surprised by how much computer science theory was developed before I was born.

          __._,_.___
          Recent Activity:
            .

            __,_._,___
            Don Groves | 2 Feb 2011 05:17
            Picon

            Re: [stack] Re: Concatenative Research

            "It's been a long, strange trip" applies to both The Grateful Dead and Computer Science theory.
            --
            don
            
            On 1 Feb 2011, at 18:25, Justin wrote:
            
            > 
            > --- In concatenative <at> yahoogroups.com, "William Tanksley, Jr" <wtanksleyjr <at> ...> wrote:
            > > Indeed, and like all elegant tools, they are from a more civilized
            > > age. They were invented by Backus for FP and FL, the languages that
            > > gave us the term "functional languages", although none of their
            > > immediate successors met their definition of being functional
            > > languages.
            > 
            > I never fail to be surprised by how much computer science theory was developed before I was born.
            > 
            > 
            
            [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:
                concatenative-digest <at> yahoogroups.com 
                concatenative-fullfeatured <at> yahoogroups.com
            
            <*> To unsubscribe from this group, send an email to:
                concatenative-unsubscribe <at> yahoogroups.com
            
            <*> Your use of Yahoo! Groups is subject to:
                http://docs.yahoo.com/info/terms/
            
            

            Gmane