At 03:07 PM 07-09-2001 -0400, Adam Turoff wrote:
>On Mon, Jul 09, 2001 at 02:36:17PM -0400, Sam Tregar wrote:
> > On Mon, 9 Jul 2001, Adam Turoff wrote:
> > > Don't laugh.  It's here now.  It's called XSLT.  :-)
> >
> > Um, that's not what the article was talking about  The proposal is to use
> > an XML syntax to program in existing "VHLL" languages, including Perl.
>
>...and we have a working example of what a bad idea that is with XSLT.

XSLT has, as a major failing, it's XML-based, lisp-like syntax which takes 
the "Lots of Insideous Silly Parenthesis" problem and makes it even 
worse.  The scheme code:

(define (addone x)
   (+ x 1))
...
(addone 3)

becomes in XSLT

<xsl:template name="addone">
    <xsl:param name='x'/>
    <xsl:value-of select="$x+1"/>
</xsl:template>
...
<xsl:call-template name="addone">
    <xsl:with-param name="x" select="3"/>
<xsl:call-template>

That is obviously horrid syntax, but it fits XSLT's goals of being embedded 
in XML and able to co-exist with other XML schemata.

But that doesn't have to be how a programming language and XML can interact:

<section>
Procedure <i>prime_the_change_buffer</i> sets <i>change_buffer</i> in 
preparation for the next matching operation.
<code>
void
prime_the_change_buffer()
{
   change_limit = change_buffer; /* this value is used if the change file 
ends */
   <insert section="Skip over comment lines in the change file; |return| if 
end of file"/>
   <insert section="Skip to the next nonblank line; |return| if end of file"/>
   <insert section="Move |buffer| and |limit| to |change_buffer| and 
|change_limit|"/>
}
</code>
</section>

(code gotten from CWEB 3.0 by Donald Knuth and Silvio Levy)

Running that though the proper processor (probably written in XSLT) could 
generate the same results as cweb (although rewriting cweb in XSLT seems a 
not-so-good proposition.

>XSLT is a good idea in *it's* domain, but very bad for a general purpose
>programming language.

True, agreed, and admitted.  So why can't a general purpose programming 
language be designed with XML-based syntax?  Why can't a general-purpose 
programming language be augmented with XML for internal documentation purposes?

>What's your question?  XML Editors are not the limiting factor
>preventing XML-based programming languages; that argument doesn't
>stand up in the face of XSLT adoption.  The dubious value of those
>beneifits (and the re-engineering cost) are the true limiting factors.

As has been admitted, XSLT sucks.  On the otherhand, take a look at a 
decent Smalltalk environment sometime.
The "browsers" which are use to examine and modify code completely isolate 
the programmer from the underlying representation.  Although the technology 
used in Smalltalk is older than XML, I could easily see it being done 
-today- using XML, and the programmer never being the wiser.

>Z.

Reply via email to