Re: [stack] language hierarchy
"William Tanksley, Jr" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
William Tanksley, Jr <[email protected]> wrote: > My definition, however, is now *very* specific to syntax. Perhaps I'd > better phrase it as: "A language's syntax is concatenative if the > language it accepts is its own Kleene closure." Then, your definition > rephrased to be parallel to mine would be: "A language's semantics is > concatenative if every term denotes a function, and every > concatenation of terms denotes an associative operation on those > functions." (Hmm, is the word "semantics" plural?) Okay, I just realized, thanks to http://en.wikipedia.org/wiki/Kleene_closure, that the Kleene closure of a language forms an associative monoid. If only I'd read http://www.latrobe.edu.au/philosophy/phimvt/joy/j02maf.html closely enough, I would have seen (in the first paragraph) that "The denotation of Joy programs maps a syntactic monoid of program concatenation to a semantic monoid of function composition." How about I condense (using the frigid temperatures of mathematical language) the two definitions I proposed above into a single one: "A concatenative language consists of a mapping from a syntactic monoid over program concatenation to a semantic monoid over an associative operation on functions." Now, the question is whether function composition is the only possible function operation that maintains concatenativity. I would claim it's not: the trivial counterexample would be the null operation, which discards both functions. I think 'nip' is also an associative operation (discard the result of the first function). Is there some reason why these -- admittedly uninteresting -- operations produce a non-concatenative language? -Wm