[xquery-talk] RE: XQuery - Grammar? Implementations?
Michael Kay
mike at saxonica.com
Mon Feb 2 09:29:34 PST 2009
> I am not sure your criticism is justified in its harshness.
> At least if it is the case, as I believe, that implicit
> conversions may indeed interfere with optimization.
Well, for starters, I think that usability is a much more important goal in
language design than optimizability.
And I don't think they are in contradiction. Usability demands consistency
and orthogonality, and these are the very features of a language which help
to make it optimizable.
>
> Declarations, on the other hand, offer a different situation,
> because they are not "called": only one explicit conversion
> per declaration may become necessary, and the expression to
> be converted is a top level expression, which can be
> comfortably wrapped in the appropriate conversion call.
It can be done just as comfortably by the compiler as by the user. I don't
see why making the user do atomization "by hand", rather than having the
compiler do it on the user's behalf, makes for a better language; and I
don't see why variable declarations should be treated differently from any
other context where there is a supplied expression and a required type.
It's interesting to note that Java allows *more* implicit conversions in a
variable declaration than in a function call.
Michael Kay
http://www.saxonica.com/
More information about the talk
mailing list