Re: [xsl] XSLT has raised bar for compiler writers (my ponderings ..)

Subject: Re: [xsl] XSLT has raised bar for compiler writers (my ponderings ..)
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 8 Oct 2016 08:10:36 -0000
I don't think there is anything about XSLT that makes writing a
compiler/interpreter (the two terms are becoming increasingly interchangeable
given JIT approaches) significantly easier or harder than any other language.

There's one thing that makes it a little easier: because the syntax is XML,
you don't have to write your own lexical or syntax analyser. After that, it's
all textbook stuff. As Liam says, compiling functional languages has been a
solved problem for many years, although it's true that they only usually merit
a single chapter in books on compiler writing. There are of course a few
"impurities" in the language that complicate matters, like the need to call
extension functions with side-effects, or the wretched "node identity"
problem, or the problem of carrying around static and dynamic context; but
they are all perfectly manageable.

It is significantly easier if you are writing for a single target platform
like the JVM rather than multiple platforms, and it is very significantly
easier if that platform does garbage collection for you. Half the complexity
in C/C++ based XSLT processors that I have seen has been doing the memory
management, which comes for free in a language like Java or C#.

The technical challenge of writing an XSLT processor is probably easier than
the business challenge. There were a dozen XSLT 1.0 processors that were
technically excellent, but which ended development prematurely because the
developers weren't earning enough to feed their families.

Michael Kay
Saxonica


> On 7 Oct 2016, at 05:32, Mukul Gandhi gandhi.mukul@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Dear all,
>     I'm not sure, whether raising the bar is the right word in the title.
XSLT (1.0 upto 3.x inclusive) is a programming language, right? I thought the
process (design and implementation) of writing its compiler (from a source
code to result tree, and serialization) must be similar as for any other
language. But I've finally sort of concluded that this notion is not true.
First of all, XSLT is a functional language which makes the process of writing
its compiler different than procedural languages. XSLT also has procedural
elements, like loops (on the surface they're loops just like loops in C / C++,
but they're functional loops where iterations can happen in parallel and
results of iterations are merged in some order to produced part of the result
tree).
>
> Given this characteristic of XSLT language, I'm amazed that the compiler of
XSLT language can be made for the full XSLT language, and have been made. May
be one day, I'd like to seriously venture into the filed of writing a compiler
for an XSLT language.
>
> I hope this post makes sense (the subject and discussion).
>
>
> with best regards,
> Mukul gandhi
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <-list/293509> (by email <>)

Current Thread