Isn't this the definition of a declarative programming paradigm? (I.e. SQL?)
Isn't this the definition of a declarative programming paradigm? (I.e. SQL?)
"Functional programming, and in particular purely functional programming, attempts to minimize or eliminate side effects, and is therefore considered declarative."
"While functional languages typically do appear to specify "how", a compiler for a purely functional programming language is free to extensively rewrite the operational behavior of a function, so long as the same result is returned for the same inputs."
I would argue that there are many languages (and no reason they couldn't) act otherwise with regard to that second quote. However, the line between pure functional and not starts to become fuzzy as well.
Well... every program has side effects when you run it - I don't yet know a language with a type system that reifies CPU temperature.
I think it might be correct to say that idealized pure functional programming doesn't rely on side effects for correctness?
I personally like to think of my machine running in a lab, with IO being scientists running around taking data out, doing work, then feeding it back into the machine. :D
[1] http://en.wikipedia.org/wiki/Side_effect_(computer_science)
"In computer science, a function or expression is said to have a side effect if, in addition to returning a value, it also modifies some state or has an observable interaction with calling functions or the outside world."
The increase in CPU temperature certainly an "observable interaction with [...] the outside world". Given that you are given no kinds of guarantees about the semantics of this interaction in any language I'm aware of, it would be poor engineering to rely on it, but that doesn't mean it doesn't happen or that it is not a side effect.
I'll show myself out.
I doubt that CPU temperatures are part of many language specs.