Re: [stack] Concatenative Research
"Justin" <[email protected]> Mon, 31 Jan 2011 05:11:06 -0000
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
--- In [email protected], "William Tanksley, Jr" <wtanksleyjr@...> wrote: > Others have suggested using "compositional language", and there's > nothing wrong with that; but historically, it's already been used in a > number of fields to describe other languages. In cognitive science, > it's the ability for the brain to form languages out of multiple > parts; in software engineering, a compositional language is a language > designed to help components interoperate. I like "concatenative > language" not only because it's not previously used in this field, but > also because it nicely describes the syntax of the language, and > syntax is a crucial part of a language's description. Alright, 'concatenative' it is. > I'm currently working on exploring a useless nook of concatenative > languages that I called "completely flat languages". A completely flat > concatenative language is defined not only by being concatenative > (that is, any two valid programs can be concatenated to form a valid > program), but also by being completely flat -- there is no discernible > syntactic structure. This means that every bitstring is a valid > program, and a program can be cut at any location to produce two valid > programs the composition of whose semantics is the original program's > semantics. > > Naturally, I reduced this to the single-bit case: a language with only > two words, "0" and "1". "0" pushes some quotations on the stack, and > "1" pops and executes things from the stack. I'm currently using the > "k" combinator for "1", and usually "0" is something like "[], [cake], > [k]". (See Kerby's definitions of common combinators on > http://tunes.org/~iepos/joy.html#cakek for explanations.) If "1" executes things from the stack, then it's undefined on an empty stack. And if it behaves differently on an empty stack than it does otherwise, you'll lose the concatenative property. How do you get around this? > Your typechecker may well be useful, and your theory looks in line > with what little I know. What license is your code under? Merely copyrighted, till I decide between a BSD-style and GPL-style licence. Recommendations? > My code's at https://bitbucket.org/wtanksleyjr/tworing, under GPL. > Python, just like yours. I was using Haskell at first, but my type inferencer is conspicuously stateful, and I couldn't figure out how to type it.