Finally, the first pre-release of XSH2 is out. This
next-generation version of XSH is backward incompatible with
1.x releases, since the language evolved (for the better, I
presume) in many aspects. I may still do some minor polishing
before I call the language final, but most things are already
there. The interpreter should be fairly stable.
Currently, only source packages are available.
PPM distribution for Windows/ActivState will follow.
Of course, it is still possible to use both XSH and XSH2 installations
simultaneously as they use different namespaces.
You only have to rename one of the
interpreters (e.g. xsh 1.x to xsh1 - recommended - or
xsh 2.x to xsh2).
Besides being based on the XSH2 language, this release also introduces
some new commands such as edit which allows
opening a part of an XML document in an external editor
and put the results back into the document.
List of most fundamental differences between XSH2
and XSH1 languages can be found here.
Complete documentation can be found in the
documentation section.
Beside syntax changes, the most remarkable changes in
XSH2 could be summarized as follows:
- unified XPath and Perl data model
- only one kind of variables
- better integration with Perl: any argument can be specified either
as an XPath or Perl expression
- commands and user-defined subroutines can return arbitrary objects
- commands have flags and named-parameters (instead of many optional positional arguments as in XSH1):
--flag or :f and --param val or :p val
- various commands provide better functionality
based on new options and flags introduced in XSH2
- true lexical variables (a.k.a. my)
- several new commands introduced:
edit,
edit-string
canonical,
index,
my,
set-dtd
expr,
do
-
several new XPath extension functions added:
xsh:id2,
xsh:lcfirst,
xsh:lc,
xsh:ucfirst,
xsh:uc.
- new eval command
evaluates given string as XSH2 (previously, in XSH1, 'eval' was
an alias for 'perl')
- faster XSH-parser, faster evaluation engine