Re: [stack] What does "concatenative" actually mean?
William Tanksley <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <1236295015.32020.5454.camel@tanksley> |
John Nowak wrote: > William Tanksley wrote: > > There are three reasons why I don't recommend using the term > > compositional outside of pedagogy. > > First, it's a very theoretical and pure definition: it requires that > > the ONLY operation be composition. > Really? Does quotation not violate this? That's fair to ask... I'm not sure whether quotation is an "operation" as such. I think it's a very academic question, since I think "compositional" is of only pedagogical value. > > We've since developed definitions of concatenativity that seem to be a > > lot more flexible, allowing us to have a concept of pure versus impure > > concatenative languages. This also implies that we can define a > > concatenative language that's not compositional. > I disagree. According to the Wikipedia definition: > "A concatenative programming language is one in which all terms > denote functions and the juxtaposition of functions denotes > function composition." I think it's a good enough definition :-). Its only problem is that, like the first paragraph of many Wikipedia entries, it's a little absolutist. Perhaps removing "all" might be interesting -- later on we can talk about concatenative purity. Or perhaps we should steal text from the Functional_programming page. "In Computer_science, functional programming is a Programming_paradigm that treats Computation as a series of sequential transformations on a single compound data item, often involving a stack. It emphasizes the composition of operations, in contrast to the Functional_programming style, which emphasises the application of functions to data. There have been many practical programming languages which are now known to be (impurely) concatenative, but which were not designed with any such goal in mind; those languages are known as Stack_languages." Bla bla bla. That was fun, but probably was of little value. One thing I like about it was that I didn't assume that we were discussing a _functional_ compositional language -- I never really noticed we were doing that before. We can then discuss how "operations" can be considered as functions from a world-state to a world-state, and how a purely functional concatenative language operates with pure functions from a stack to a stack, and how those functions are related to the combinators of combinatorial logic. > > and concatenative languages have the huge benefit of token > > associativity that's not present in compositional languages with > > explicit composition operators. > Eh? '(f . g) . h == f . (g . h)'; seems to work to me. Yes, but does '(f . g) . h == (f .) g . h'? The operators are tokens too, now that they're explicit. They're associative _operators_, but the syntax itself is no longer associative. > - John -Wm