On Wed, Sep 08, 2004 at 11:25:53PM -0400, T. Onoma wrote:
| On Wednesday 08 September 2004 10:57 pm, David Hopwood wrote:
| > It is simply incorrect to say that equality does not need to be defined.
| > Mathematical sets, functions, relations, multisets, multirelations,
| > sequences, graphs, etc. all use equality in their definitions.
| That's not what I'm saying. I'm saying thats equality is an issue of the
| application's, ONLY.
The YAML model is quite simple. Objects in YAML can be essentially two
core types, (a) scalars or unicode strings, and (b) functions. We have
two forms of functions, the sequence which takes whole numbers onto YAML
objects, and the more general mapping, which maps YAML objects onto YAML
objects. There is lots of power that come from a simple model.
There are also lots of alternative models based solely on S-Expressions
(lists) and generalized N-Relations (SQL, etc.). However, these are
different models, with different tradeoffs. XML is a strange hybrid
based on an attributed tree, it's model is brutally complicated by
comparison. There are lots of projects which use S-Expressions for a
base model, and this is probably the simplest. If you don't think
equality is needed, you're probably left with defining all of your
application data in terms of S-Expressions. Not that it's bad; but
you've moved a ton of complexity into the application; complexity that
righly belongs in the languages and tools the application uses.
By using a functional model, we have alot of expressive power, and also
the ability to prove things about our model. About 90% of mathematics
is about functions since they are so useful, they allow you to say f(x)
and know you are getting _exactly_ one value. This is both a huge
restriction, but it also allows for much more complicated abstractions
to be expressed easily. If you were to remove this restriction, lots of
things which _were_ easy become hard.
There are two core reasons why we have chosen this model:
- most modern scripting languages chose it as well, and this reduces the
"impedence-mismatch"; that is, 'classes' 'hashtables', 'records', etc.
all fit directly into our model without any games
- we can specify with quite clean semantics schema languages, transform
languages, complex types, and other goodies with a very powerful
mechanism that has been proven (a large portion of math is all
combinations of functions)
So, with this power and expressiveness, we have to pay a price. That
price is defining and enforcing equality at the lowest levels of YAML.
It is not an application-only issue.
In short, if some user writes,
a: is a dupe
it is bad form, it doesn't work, and it is such a fundamental
problem that there isn't any point in arguing about it. It
is just wrong.