Challenge my assumptions!
Thu, 8 Jul 1999 10:58:58 -0700 (PDT)
> > I'm afraid you are going to have to be dependent on some syntax, if you're
> > going to store any information.
> Well, yes, I just don't want to favor any one external syntax (or type
> of syntax) over another. I.e., I want to leave room open for visual or
> multimedia languages.
yes.. that seems like a good idea...
> [everyone check out ToonTalk]
hmm maybe i'll have to check it out sometime.
> > > I'd also be interested in seeing an example of a metamodel which used
> > > binary trees for its atoms. As a simple example, how about a metamodel
> > > for integers? My solution to the same problem is at
> > > http://www.teleport.com/~sphere/documents/002a/2/index.html, and is
> > > fairly intuitive, I think.
> > all right, this is a good example. Here's one way to do it: you'll have
> > two words, a word for zero ('0'), and a word for a successor function
> > ('succ'). You'd represent zero using simply one word, '0'. You'd represent
> > one as the application of 'succ' to '0' ('succ 0'), two by 'succ (succ 0)',
> > and so on. If you want negative numbers, then you add a negation
> > function ('neg'). Negative two could then be represented as
> > 'neg (succ (succ 0))'.
> That definitely works. But how is it better than my approach? I would
> argue that my approach, a stream of bits, is more intuitive. Also,
well, maybe it does to you, but to me 'succ (succ (succ 0))' seems like a
more intuitive representation of three than, say,
However, a binary tree language is no more powerful than your current
system. In particular, you could represent binary tree sentences in
your current system using _Streams of size 2 to represent application
(the binary construct) and streams of bits to represent the words.
But, on the other hand, all sentences in your system could be written
in a binary tree language also.
So, both kinds of system are equivalent in power. However, I find
that a binary tree language, based solely on one constuct (along with
an arbitary number of words; just one will technically suffice, but
additional words can aid interpretation of the language; if you use
two words ("FOO" and "BAR") you'll end up with a system quite similar
to your current one), has a much simpler syntax than your current
system, which even in its most purified form (without syntactic sugar)
has a least two constructs: a list construct (instances of _Stream)
and a mapping construct. Actually, you could get rid of the mapping
construct (as I think Tril mentioned). A map could be represented
as a list ("stream") of pairs; there is no need for an additional
_Bag construct either (you can simply represent unordered sets using
ordered ones, or if it needs to be clear, have a header at the front
("FOO" or "BAR") that tells whether it is ordered or not). Still,
you'd have a list construct, which could be replaced by the much
nicer binary pair construct. Then, if you tossed out your "GUID" system
(:-)) and your arbitrary assignment of certain bit streams to meaning
(instead, adding new words for new ideas; this works out the same in
the end; instead of having streams of bits, you'd have streams of
english characters (much more intuitive), although this "streaming"
construct wouldn't be mentioned in any but the most rigorously formal
systems; i.e., most systems would take words simply to be abstract
atomic symbols (or sets of symbols; after all, there is more than
one way to write your characters)), you'd have a system much
like I suggest (sorry if these long, drawn-out parenthetical comments
have made things confusing :-)).
> where do the words come from? Are we just allowed to define whichever
> words we want? (That's fine if we are.)
Well, yes, part of a language definition would tell what words are
used in the language and what they mean.
> I don't have anything against binary or non-binary trees, I'm just not
> sure why using them is better than using _Bit, _Map, and _Stream.
> Although I'd rather not change my meta-metamodel (I've already written
> code to support it), I will if you can convince me your way is better.
> Better to fix the problem now than regret it later! :)
I think if you use binary trees as your syntax (rather than listing
constructs and maps), you'll tend to end up with much cleaner and more
intuitive languages ("metamodels").
Let me know what you think...