<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto">On Apr 9, 2021, 1:45 PM -0400, Stewart C. Russell via talk <talk@gtalug.org>, wrote:</div>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 5px; padding-left: 10px; border-left-width: thin; border-left-style: solid;">After all with a loop you are controlling the<br />
execution order of the processing. If done right you usually shouldn't<br />
need to care.<br />
<br />
<br />
But in document processing, you really really /really/ want the output<br />
to come out in the same order as the input. Which is why functional<br />
languages seemed a strange choice for document transformation. The<br />
absence of side-effects can be handy in document processing, but being<br />
in the right order is usually what publishing houses get paid the big<br />
bucks to do.</blockquote>
<div dir="auto"><br />
The key part of what Lennart wrote is “if done right”. How could you imagine that the functional program would return the results out of order? Compilers/interpreters are allow to make whatever optimizations they want, as long as time and memory consumption are the only things that change from the original!</div>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 5px; padding-left: 10px; border-left-width: thin; border-left-style: solid;">I've had to process utility time series power generation data in XSLT.<br />
That was horrid. Order matters a lot there, too.</blockquote>
<div dir="auto">XSLT is a very specific functional language, designed for a very particular job, which (from my limited experience) it does somewhere between “adequately" and “very well”. But while it may be Turing complete, it is not a general purpose language and I would not want to program such problems with it!!! Pure lambda-calculus and Turing machines are also Turing complete, but you sure wouldn’t want to be programming in those either.<br />
<br />
Haskell, Scheme, OCaML, Erlang/Elixir, Scala are much, much friendlier languages for general purpose programming. All the ML dialects, as well as Scheme and Scala support more imperative programming as well, that can help with the transition.</div>
</div>
<div name="messageSignatureSection"><br />
<div class="matchFont">../Dave</div>
</div>
</body>
</html>