I write the original blog because I found it funny that languages like XQuery and XSLT, which I feel so 'functional', is not actually referentially transparent. Yet monadic I/O as implemented in Haskell, which I feel so 'procedural' is referentially transparent. So my intension in the blog was to come up with something that can better depict the computation model of XQuery and XSLT. My approach was to keep the concept of RT, but stretch the concept of functional programming. From the feedback, I can see that people think that's not acceptable.
I admit that it might not be a good idea to stretch some existing well established term. That's fine. I can go plan B.
A new term can be coined instead. For the time being, I call it 'pure computation'. Here's the definition - a function may be described as pure computation if both these statements about the function hold:
- The function always evaluates to the same result value given the same argument value(s) and the same set of context value(s). The function result value cannot depend on other hidden information.
- Evaluation of the result does not cause any semantically observable side effect or output through the direct interface of the hosting world.
By this definition, I want to make sure 'pure computation' cannot carried out side effects through some back door. If I'm the gatekeeper of the real hosting world, I can sleep soundly at night when I grant someone the right to run pure computational program in the hosting world.
Below are two diagrams comparing the two ways of viewing the programming world:
Which one better represents you perception of the programming world, I left it to you to decide.