3 ms·
I already defined above what an effect is. My definicion is technically precise and language-independent.
by catnaroek 10y ago
I already defined above what an effect is. My definicion is technically precise and language-independent.
- pron 10y agoOK, so you define effect-freedom using the language's equality operator. I agree it's a better definition than mine, but I think assembly language and BASIC would still qualify as effect-free (provided there's no concurrency) even though some people would not consider them pure.
- catnaroek 10y ago> OK, so you define effect-freedom using the language's equality operator. Not the runtime equality testing operator. Rather, the language's static notion of contextual equivalence. It just happens to be the case that most high-level languages provide a built-in equality testing operator that works on primitive types, returning `true` iff its operands are contextually equivalent values. > I think assembly language and BASIC would still qualify as effect-free I don't even know what a good notion of contextual equivalence for any assembly language would be. As for BASIC, I haven't used the old ones, so I can't comment on them. I've used Visual Basic, which most certainly has effectful procedures.
- pron 10y ago> Not the runtime equality testing operator. Rather, the language's static notion of contextual equivalence. How is that different from denotational semantics? > The ones that can be effectful or effect-free are specific computations, not whole languages. Well, we could define an effect-free language as one where all programs are effect-free. But anyway, what is the "static notion of contextual equivalence" in assembly (or BASIC), and how can you write an effectful program in such a language?