[xquery-talk] Is it possible to maintain a list of value in XQuery

David Lee dlee at calldei.com
Wed May 15 17:22:57 PDT 2013

I still am unconvinced that the theory that a purely functional language would enable vastly better optimizations
has yet to be realized in the real world and may never be.   It sounds good, and looks good on paper ... 
And maybe someday a genius will make it so ... and teach us peons how to do it Gods Way.
But in practice using non-functional semantics can produce vastly faster or simplier code sometimes  (or both	)....
Or why would every XQuery vendor put them in ?  They got tired of telling customers they were wrong.
And keeping a straight face ....

Of course this was the same argument for "register" and _asm in C ... and later had the back door "volatile" snuck in where
the assumptions of nothing sneaky happening in the back door were violated .... who knows what "volatile" really means nowadays in a multi-core multi layered cache line system ... The Compiler Knows :)

And yes adding scripting frameworks on top of XQuery is very powerful ... And Good. (why I wrote xmlsh ... ) ...
combining them is a very good mix.  But when your "stuck" with pure XQuery ... or XSLT for that matter no matter how many times the gurus tell you that its for your own good ... it seems more religion then fact ...
Thats my opinion and I'm sticking with it no matter how many facts you want to throw at me :)

David A. Lee
dlee at calldei.com

-----Original Message-----
From: Liam R E Quin [mailto:liam at w3.org] 
Sent: Wednesday, May 15, 2013 7:25 PM
To: David Lee
Cc: talk at x-query.com
Subject: Re: [xquery-talk] Is it possible to maintain a list of value in XQuery

On Wed, 2013-05-15 at 23:10 +0000, David Lee wrote:
> I boldly propose that perhaps as a group we step back and get off our
> high horse and admit that some procedural  aspects to XML processing
> be embraced instead of hidden in the dark corners of "vendor
> implementations"  that every single vendor has had to provide because
> pure functional programming  has simply not lived up to its promise.

I don't think it's about a high horse. The XQuery WG spent multiple
years trying to wrestle with adding procedural hooks to XQuery. Part of
the difficulty was that it was a group of people who did not share a
common goal. For example, some people thought it would be nice to offer
a sort of bait-and-switch language where the easy stuff was procedural
but anything hard was functional, a sort of gentle slope learning curve
followed by a cliff, instead of a very steep hill at the start. Others
needed synchronization and orchestration.

My own feeling is still that the scripting extensions would work better
as a framework rather like XProc, orchestrating functional chunks of
XQuery (and/or XSLT) at a higher level, with clearly-defined boundaries
for optimization & transactions. One problem with them as written today
is that it's easy to put a semicolon instead of a comma in places where
it's still legal, but has a different meaning, one which has the
side-effect (!) of effectively disabling a lot of optimization.

At any rate we ended up delaying XQuery 3 for a year or more while
working on the scripting extensions, without really coming to a good

Maybe the long term answer is XQuery extensions to JavaScript.


Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

More information about the talk mailing list