Having been forced to use XSLT for a short period some years ago, my initial reaction to your suggesting that it is an FP language was one of complete and utter disbelief. However, I googled and found several people making a similar suggestion.
I have to say that I find it almost impossible to relate my experience of programming XSLT as anything like my experience of programming in any of several real FP languages. Indeed, I wouldn't wish XSLT upon anyone, not even my worst enemy. I see it has it's uses for performing a limited set of very specific types of transformations upon large volumes of XML encoded data, but as a general purpose programming language (IMO) it is a disaster.
The analogy that comes to mind is: Given the increasingly powerful processors available in mobile phones, and combining them with the nearly ubiquitous presence of video-capable digital cameras, it would be possible to program them to allow you to type SMS texts by placing the phone on a work surface and using Semaphore. I have absolutely no doubts it could be done, but would anyone really use it?
(IMO) XSLT is the absolute antithesis of FP. Just look at all the needlessly repetitive verbosity XSLT entails.
And whilst it supports (after a fashion) high order functions, imagine trying to do the holy grail of FP: Fixed Point Combinators using XSLT?
Aristotle demonstrated how to do the Y combinator in Perl a while back. Now compare that to the same thing in Q: _Y = \F.(\X.F '(X X)) (\X.F '(X X));
If the Perl version is an order of magnitude more complex and verbose than the Q version, I can only imagine that the XSLT would be one order more complex and two orders more verbose than the Perl. That's if it is possible to do it at all. And IMO, that totally negates any claim that XSLT is a FP language.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] |
Surely you jest.
Yes, XSLT is verbose and ugly. I find most XML to be that way. However, breadth of domain and verbosity levels do not indicate the style of a programming language.
By definition, XSLT is Purely Functional. As I understand it purely functional languages are a strict subset of Functional Programming languages.
If it helps, you can think of XSLT as the most dysfunctional functional language.
| [reply] |
Surely you jest.
No. I was deadly serious, though I agree that I was technically wrong when I said: And IMO, that totally negates any claim that XSLT is a FP language.. I would be completely wrong were in not for the IMO.
You suggested above that the OP needn't learn another FP language as he had already experienced them through XSLT. As I tried to explain, I also used XSLT long before I ever used any other FP language, and before I knew what FP languages were about. Now, having dabbled in several FP languages, it had never even crossed my mind that XSLT was in anyway related.
I guess that's because all the FP languages (except XSLT) that I have tried, seem to have a common set of typifying characteristics (as opposed the defining characteristics), that (IMO) are more relevant to their power and utility, and especially to the way they influence the thought patterns of the programmer.
Amongst that set of typifying characteristics I would include, conciseness, composability and extensible syntax as the primary ones that have affected my way of coding. And the way I think about coding.
You see, other than those in pursuit of academic knowledge and perhaps CS achievements, I don't think that the defining characteristics, referential transparency, immutability, mathematical provability, are anywhere near as important to the working programmer as writeability, maintainability and whether it gets the job done quickly and easily.
So yes, XSLT is a (dysfunctional) FP language. But no, I do not think that having used it is in any way a substitute for using a proper FP language. Especially for the way the latter influences ones way of thinking and working.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |