Introducing the XQVM programming language.

I've implemented a new programming language. This is a new language and a new implementation: only one serious application has been built so far. The language is, I think, unusual and perhaps clever.

All currently published information is on one big page. (There are some commercial offers on that page but all of the code is available free of charge under open source licenses.)

XQVM is an XML and XQuery-based programming language. All XQVM source code is written as XML with embedded XQuery programs.

XQVM is lisp-like in that code and data have the same types and co-mingle at run-time. In lisp, code and data are represented as "cons pairs" and "symbols". In XQVM, being XML based, code and data are represented as DOM objects. XQVM's lisp-like nature runs deep: syntactic abstraction (defining new specialized sub-languages for your application) is an effective technique for writing XQVM code.

XQVM is forth-like in that, if an XQuery interpreter is already provided, XQVM's procedural evaluation rule can be implemented in but a few lines of code -- a simple loop. XQVM is also forth-like in that procedural steps do not accept named arguments: arguments to a step are found implicitly in the dynamic environment of the running program. (Unlike forth, XQVM is not "stack based" except in-so-far as applications may choose to define stacks and use them that way.)

XQVM is Scheme-like and Actors-like in the way that flow of control is handled. The lowest levels of "core XQVM" require programs to be written in an explicit (albeit unusual) continuation passing style. Each primitive step is, in part, responsible for computing its own continuation. In practice, XQVM is more Actors-like than Scheme-like: programs frequently construct a continuation rather than forward one that they received as an argument.

XQVM is fully reflective. For example, a program can capture it's entire state as an XML document and return that as a reply to a web request. The recipient could resume the program.

I hope you find it interesting.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

XQuery's syntax, strange.

Clever I don't know, ugly that's for sure..

Do you plan to make it human readable?

XQuery syntax...

Do you plan to make it human readable?

It is already possible to create new syntaxes, purely in XQVM application code. I do it all the time, although I usually keep XQuery as a sub-language.

Perhaps the way to think of it is that you invent the domain specific language you wish you had, then implement an interpreter for or translator from it in "core XQVM" -- and then you have your alternative syntax.

(Also, as it happens, I found XQuery strange, too, but after writing a few 1000 lines of code with it it came to make very good sense. It's pretty concise and clear once you get used to it.)