Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What is special about a mutating getter? It operates on the state of the object S and outputs a new state S' and some value x. Some programming languages allow you to write 'functions' without explicitly passing all input state into the function, but does that imply anything fundamental or interesting about mathematics or computation? Is that anything more than a type of syntactic sugar?


What is "special" is that the system has a peculiar property: f(x) != f(x).

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.

https://web.math.princeton.edu/~nelson/papers/rome.pdf


Of course it isn't. OP seems to have some kind of misconception about what "mathematics" means, since they keep fixating on a vague concept of purity of notation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: