[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xsl-list
Subject:    Re: [xsl] Expand XPath with a few abstractions and use it as a standalone language ... run expanded-
From:       "David Carlisle d.p.carlisle () gmail ! com" <xsl-list-service () lists ! mulberrytech ! com
Date:       2022-06-29 21:03:33
Message-ID: 20220629170302.c21668ac () lists ! mulberrytech ! com
[Download RAW message or body]

On Wed, 29 Jun 2022 at 12:12, Roger L Costello costello@mitre.org <
xsl-list-service@lists.mulberrytech.com> wrote:

> Hi Folks,
>
> Recently I was reading about Ratfor (Rational Fortran). Ratfor is a layer
> on top of Fortran.
>
> Fortran does not provide nice control structures such as the while-loop.


Not that it really changes your point but it is 2022 and Fortran has had
while loops since Fortran 90 (so 1992 or so)
http://www.personal.psu.edu/jhm/f90/statements/do_w.html




> Instead, you have to use labels and gotos. The resulting (spaghetti-like)
> program imposes a large cognitive load on the developer and maintainer.
> Writing Fortran programs is unreasonably difficult and error prone.
>

Hmm we have a lot more Fortran than XSLT (although quite a lot of the
Fortran is written by XSLT:-)

>
> So some clever fellow created Ratfor, which provides abstractions such as
> the while loop. The abstractions make it much easier to write and maintain
> programs. A preprocessor converts the Ratfor into equivalent Fortran. For
> example, the preprocessor converts the while-loop into equivalent labels
> and gotos.
>
> I really like XSLT. In my experience, however, the verbosity of its XML
> syntax imposes a substantial cognitive load on the developer and
> maintainer. This makes implementing large and/or complex programs
> unreasonably difficult and error prone.
>
> In my opinion, XPath, with its concise notation would be a superior
> language for programming large and/or complex programs. If XPath were
> enhanced with a few things, such as apply-templates (as was discussed a
> couple weeks ago), it would make for a programming language that is easier
> to write and maintain programs.
>

that in a nutshell is xquery: xpath extended with some xslt features such
as function definitions and loops, but with a uified syntax not the "wo
languag" modl of xpath-in-xslt


> In the spirit of Ratfor, it seems that it should be possible to write a
> preprocessor that converts "expanded-XPath" into equivalent XSLT/XPath. Has
> anyone done this -- created an expanded-XPath and a preprocessor which
> converts expanded-XPath into equivalent XSLT/XPath?
>


You may find my xq2xml project if you search around, that did exactly that
and re-wrote xquery (v1)  to xslt/xpath (v2)

 David


> /Roger
> 
>
>
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/651070
or by email: xsl-list-unsub@lists.mulberrytech.com
--~--

[Attachment #3 (text/html)]

<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">On Wed, 29 Jun 2022 at 12:12, Roger L Costello <a \
href="mailto:costello@mitre.org">costello@mitre.org</a> &lt;<a \
href="mailto:xsl-list-service@lists.mulberrytech.com">xsl-list-service@lists.mulberrytech.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Folks,<br> <br>
Recently I was reading about Ratfor (Rational Fortran). Ratfor is a layer on top of \
Fortran. <br> <br>
Fortran does not provide nice control structures such as the \
while-loop.</blockquote><div><br></div><div>Not that it really changes your point but \
it is 2022 and Fortran has had while loops since Fortran 90 (so 1992 or \
so)</div><div><a href="http://www.personal.psu.edu/jhm/f90/statements/do_w.html">http: \
//www.personal.psu.edu/jhm/f90/statements/do_w.html</a></div><div><br></div><div><br></div><div> \
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px \
solid rgb(204,204,204);padding-left:1ex"> Instead, you have to use labels and gotos. \
The resulting (spaghetti-like) program imposes a large cognitive load on the \
developer and maintainer. Writing Fortran programs is unreasonably difficult and \
error prone.<br></blockquote><div><br></div><div>Hmm we have a lot more Fortran than \
XSLT (although quite a lot of the Fortran is written by XSLT:-) <br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"> <br>
So some clever fellow created Ratfor, which provides abstractions such as the while \
loop. The abstractions make it much easier to write and maintain programs. A \
preprocessor converts the Ratfor into equivalent Fortran. For example, the \
preprocessor converts the while-loop into equivalent labels and gotos.<br> <br>
I really like XSLT. In my experience, however, the verbosity of its XML syntax \
imposes a substantial cognitive load on the developer and maintainer. This makes \
implementing large and/or complex programs unreasonably difficult and error prone. \
<br> <br>
In my opinion, XPath, with its concise notation would be a superior language for \
programming large and/or complex programs. If XPath were enhanced with a few things, \
such as apply-templates (as was discussed a couple weeks ago), it would make for a \
programming language that is easier to write and maintain programs. \
<br></blockquote><div><br></div><div>that in a nutshell is xquery: xpath extended \
with some xslt features such as function definitions and loops, but with a uified \
syntax not the &quot;wo languag&quot; modl of xpath-in-xslt</div><div>  \
<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> In the spirit of \
Ratfor, it seems that it should be possible to write a preprocessor that converts \
&quot;expanded-XPath&quot; into equivalent XSLT/XPath. Has anyone done this -- \
created an expanded-XPath and a preprocessor which converts expanded-XPath into \
equivalent XSLT/XPath?<br></blockquote><div><br></div><div><br></div><div>You may \
find my xq2xml project if you search around, that did exactly that and re-wrote \
xquery (v1)   to xslt/xpath (v2)<br></div><div><br></div><div>  \
David</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br>
/Roger <br>
<br>
<br>
</blockquote></div></div>
<div><!-- begin bl.html.trailer -->
<div style="border-top:1px solid black; background-color: #dddddd;
color: #888888; font-size: smaller; padding: 5px; text-align: center;
font-family: arial,verdana,arial,sans-serif; margin-top:1em; clear:
both; margin: auto">
<a href="http://www.mulberrytech.com/xsl/xsl-list">
XSL-List info and archive</a>
<div style="text-align:center;">
<a style="color: blue;"
  href="http://lists.mulberrytech.com/unsub/xsl-list/651070"
> EasyUnsubscribe</a>
(<a style="color: blue;"
href="mailto:xsl-list-unsub@lists.mulberrytech.com?subject=remove"
> by email</a>)
</div>
</div>
<!-- end bl.html.trailer --></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic