New Modules? Promise Module, Async Module

Skip to first unread message

Christian Grün

Feb 29, 2016, 10:24:58 AM2/29/16
to EXPath, EXPath, James Wright
Dear all,

James Wright has recently presented his XQuery Promise Module in
Prague (Proceedings, 139ff [1]). His code is available at GitHub [2],
and we were wondering if people in the community were interested in
seeing the ideas behind this module standardized?

The result could be two specifications:

1. The Promise Module

* This module is inspired by the Promise Pattern as it is available in
e.g. jQuery and AngularJS.

* It includes functions like defer(), then(), fail() and others (see
the links for more details)

* It seems to be possible to implement 90% or even 100% of the module
in pure XQuery.

2. The Async Module

* In its initial version, the module contains a single async:fork-join
function, which can be used to process a sequence of XQuery functions
in parallel [3].

* The module could be enhanced with an extension of the FLWOR
expressions and an 'async' keyword in for clauses [4].

* It could further be extended with two functions async:fork and
async:join. The first function would trigger the evaluation of a query
(supplied as string) as a separate process; the second function could
be called to fetch the result of the first function.

Thoughts are welcome; thanks in advance,


Christian Grün

Mar 3, 2016, 11:30:53 AM3/3/16
to EXPath, EXPath one? ;)

Jonathan Robie

Mar 3, 2016, 12:05:04 PM3/3/16
to, EXPath
I'm trying to wrap my head around Promise and Async in a language designed to allow lazy evaluation.

In general, XQuery tries very hard to avoid saying when things happen or in what order.  I was just beginning to explore whether other functional languages provide these features and why ...

Jonathan one? ;)

You received this message because you are subscribed to the Google Groups "EXPath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

Reply all
Reply to author
0 new messages