Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Updates was Re: [xml-dev] XML-aware programming language?

From: Burak Emir <Burak.Emir@----.-->
To: Daniela Florescu <dflorescu@---.--->
Date: 12/2/2004 4:23:00 PM
<snip/>

I'll take the cue for the lack of updates in XML programming languages.

Daniela Florescu wrote:

>
> This "three legs animal" as someone called it is a technical aberration.
> There are no technical reasons for things to be that way.
> I don't think the situation can continue like this for a long time.
>
There are worse things that persist (and he even got margins of 3 million:-)

I agree with you, and it reminds of Bjarne Stroustrup's infamous 
interview which claims C++ is just there to raise programmer salaries 
(IT WAS A JOKE). 
http://www.just2good.co.uk/index.php?funStuffFrameSet.php?stroustrup.htm

I think some time has to pass in order for the right balance to be found 
between expressivity and convenience. IMHO languages without static 
typing are less convenient. They also offer a lot less potential for 
automatic optimization.

But the question is how can you combine static typing with updates?

Suppose you have declarations like (in an notation that lets you express 
the same things as in XML Schema)

element zoo:ZooType
type ZooType = animal:AnimalType*

abstract element animal:AnimalType
type AnimalType = ()

element dog:DogBreed substitutes for animal:AnimalType
type DogBreed = name:Name breed:Dogs

element cat:CatBreed substitutes for animal:AnimalType
type CatBreed = name:Name breed:Cats

Now I have a

let $z = zoo(
  dog(name(Efes) breed(borderCollie))
  cat(name(Mia) breed(persian))
)

I want to replace the dog Efes with Cleo, a mixed breed dog.

let $efes = $z / dog[ name(Efes) ]
let $cleo = dog(name(cleo( )) breed(mixedBreed( )))
$z.replace($efes,$cleo)

Alternative syntax could be $z / $efes := $cleo or whatever.

How can a compiler find out whether $efes is actually a child of $z? One 
may restrict assignments to situations where this is possible. Then the 
compiler can actually see that the type of $cleo is the same as the type 
of $efes.

But what if $cleo was a cat?

The compiler has to clever and find out that the content of $z are nodes 
animal:AnimalType, that cat:CatType is in the substitution group of 
animal. Fine.

But what if the type of zoos was different?

type ZooType = dog:DogType* cat:CatType*

Then the replacement would only be well-typed if $efes was the LAST dog 
that appears in the list. That is beyond the powers of typechecking, and 
one can only do with reasonable approximations.

For the same reasons, updates like z.child[3] = $cleo etc. are not 
really viable.

The problems do not really appear with objects, because these do not use 
regular expressions to type their members of a class.

I'd appreciate any helping comments on this. I am only interested in 
static type checking. All I know is that for some regular word 
transformations can be modeled with finite state word transducers, and 
undecidability of type checking results from undecidability properties 
there.

kind regards,
Burak Emir

http://lamp.epfl.ch/~buraq


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent