Re: [stack] sweetening concatenative syntax
John Nowak <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
On Mar 6, 2008, at 5:00 PM, William Tanksley, Jr wrote: > John Nowak <[email protected]> wrote: > >> William Tanksley, Jr wrote: >> >>> Sure it does! The referential transparency alone is worth the >>> price of >>> admission -- the famous "extract method" refactoring (considered by >>> many to be the first indication of "true" refactoring support in a >>> tool) is merely a cut-and-paste in any editor. >> >> Indeed, although this partially breaks down in the presence of >> modules. > > I don't see why... Unless you're also talking about moving the > resulting function out of the current module, which isn't something I > intended to imply. In fact, is that what you're talking about? Yes. It isn't a particularly interesting observation. >> Types also complicate things. For example, you can't factor >> out the 'dup i' in '[swap] dup i' unless your system has higher-rank >> polymorphism or equi-recursive types. > > Well, technically if your typesystem was "concatenative" you could > factor it out. This is true. The original type system I had was concatenative (well, really "compositional" is the correct term). Unfortunately, this property gets lost quite quickly as you expand the power of the type system. The only reason the original system was compositional was because it would refuse to accept things like "[swap] dup i" as all variables were non-generic and you'd hit an occurs check no matter what order you attempted it in. At the moment, it seems that a truly compositional type system imposes too many limitations. If there are ways around this I've not discovered them yet. > If your typesystem isn't concatenative, then the resulting language > is no longer strictly concatenative This all depends on your definition of concatenative. The language is still expressed in terms of the functional forms of composition and quotation. Concatenation still denotes composition. The limitation is that you cannot compose functions in any order. This doesn't seem to be a problem in practice, although it certainly is unfortunate. > I can't criticise anyone for failing to have a concatenative type > system, since I don't know what such a thing would look like -- I've been meaning to write up how to perform inference for a compositional type system. If anyone is interested I'll bump this up in my priority queue. - John