Re mutating getter:
Monads for example are a standard way of formalising state in a pure-function universe. You seem to have some fundamental misconception about what "mathematics" is, since you keep repeating something about purity. Mathematics is merely the rigorous study of formal systems, of which your mystical "mutating getter" is one such system.
To assert that a premise is fallacious mandates that you have some prior notion of "fallaciousness".
You don't have an objective criterion for asserting whether one definition is better than another because you don't have a notion of "betterness" - it's all conventional.
It's precisely because I am an over-zealous formalist is why I see Mathematics for what it is - grammar, syntax and semantics.
It's just language.
I'm definitely not an expert but aren't irrational numbers are the best examples to show that these types of constructs already exist in math? You can't calculate them in finite amount of time. You use an analytical formula or series expansions to get the nth term instead.
Every time you call read() on it - you get a different result. It has side-effects.
This violates the “purity” of Mathematics.
That's not a train-smash for your argument if you can show me a Mathematical model for a global mutex.
When the discussion turns to control-flow you are inevitably in the land of well-ordered imperatives, not Mathematical, lazy-evaluated declaratives.
If we claim to be subscribed to denotational (Mathematical) semantics then the above contradicts the identity axiom.
And it's not any deep and world-changing insight either - it's obvious to anybody who sees that the LHS and RHS are only evaluated at runtime - they don't have any inherent (denotational) meaning, which is why I keep harping on: programmers use different semantics to mathematicians. We care about things like interaction and control flow structures as first class citizens - those are precisely the things that have no mathematical equivalents. Timeouts, exceptions, retry loops.
It's not "syntactic sugar" - it's necessity for reifying control flow. In the words of the (late) Ed Nelson: The dwelling place of meaning is syntax; semantics is the home of illusion.
Neither can you express foobarish bamboozles...
Q.E.D
Quoting http://math.andrej.com/2006/03/27/sometimes-all-functions-ar...
>>The lesson is for those “experts” who “know” that all reasonable models of computation are equivalent to Turing machines. This is true if one looks just at functions from N toN. However, at higher types, such as the type of our function m, questions of representation become important, and it does matter which model of computation is used.
Mathematics only proves things up to isomorphism. Two things that are theoretically equivalent are not necessarily empirically equivalent.
Or, just the good ol' adage: in theory there is no difference between theory and practice, but in practice there is.
>So there's literally nothing in "computer science" that you cannot express in mathematics.
In addition to the examples in the blog post linked above, you cannot express a mutating getter in Mathematics.
Go ahead. I'll wait.