Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upchange misuse of "idempotent" to something else #1133
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
getify
Mar 7, 2018
Contributor
I believe there are two "common usages" of Idempotent... one is the mathematical sense, like ABS(-1) === ABS(ABS(-1)), and the other is the programming sense, like x = 4; being equivalent to x = 4; x = 4;.
FWIW, I cover the duality of the concept of "Idempotence" in one of my book chapters.
|
I believe there are two "common usages" of Idempotent... one is the mathematical sense, like FWIW, I cover the duality of the concept of "Idempotence" in one of my book chapters. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tabatkins
Mar 7, 2018
Yes, both definitions of the word are in common usage; for example, it's commonly stated that GET requests must be "idempotent", while PUSH requests don't have to be.
tabatkins
commented
Mar 7, 2018
|
Yes, both definitions of the word are in common usage; for example, it's commonly stated that GET requests must be "idempotent", while PUSH requests don't have to be. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ljharb
Mar 7, 2018
Member
The only definition i really ever encounter is the REST one - ie, what GET requests must be.
Can you elaborate on what’s incorrect about the current usage?
|
The only definition i really ever encounter is the REST one - ie, what GET requests must be. Can you elaborate on what’s incorrect about the current usage? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
michaelficarra
Mar 7, 2018
Member
@ljharb "The output of P is determined wholly by its parameters" and "if applied to any of its own outputs, it behaves as the identity function" are two very different concepts. We use the same word to mean both of those things within the same document. Something must change.
|
@ljharb "The output of P is determined wholly by its parameters" and "if applied to any of its own outputs, it behaves as the identity function" are two very different concepts. We use the same word to mean both of those things within the same document. Something must change. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ljharb
Mar 7, 2018
Member
I would prefer the former definition; the second one doesn't seem useful in a context where (unlike mathematics) equality is determined referentially instead of by value.
|
I would prefer the former definition; the second one doesn't seem useful in a context where (unlike mathematics) equality is determined referentially instead of by value. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
michaelficarra
Mar 7, 2018
Member
@ljharb Actually, ToInt32, one of the abstract operations that uses this term according to the common mathematical usage, operates on (or at least returns) mathematical values. Mathematical values are of course compared by value.
- Let int be the mathematical value that is the same sign as number and whose magnitude is floor(abs(number)).
|
@ljharb Actually,
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ljharb
Mar 7, 2018
Member
@michaelficarra fair point; but in that case I think both definitions are useful.
|
@michaelficarra fair point; but in that case I think both definitions are useful. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
robpalme
Mar 7, 2018
robpalme
commented
Mar 7, 2018
|
Could we differentiate the two cases by referring to them as
"deterministic" vs "idempotent"?
…On Wed, 7 Mar 2018, 20:22 Jordan Harband, ***@***.***> wrote:
@michaelficarra <https://github.com/michaelficarra> fair point; but in
that case I think both definitions are useful.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1133 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AGni9bBL-bVmX8Hl3EQHyoHDtya9XfS0ks5tcEFzgaJpZM4Sg348>
.
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@robpalme That would make me happy. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
claudepache
Mar 7, 2018
Contributor
Could we differentiate the two cases by referring to them as
"deterministic" vs "idempotent"?
x++ is deterministic but not idempotent (in the computer science meaning).
x → x+1 is deterministic but not idempotent (in the mathematical meaning).
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
michaelficarra
Mar 7, 2018
Member
@claudepache Those are expressions with effects. What would be an example of a function that you would describe as "deterministic", but which would violate what we're trying to describe here?
edit: We could be even more pedantic and say "deterministic with respect to its parameters".
|
@claudepache Those are expressions with effects. What would be an example of a function that you would describe as "deterministic", but which would violate what we're trying to describe here? edit: We could be even more pedantic and say "deterministic with respect to its parameters". |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rossberg
Mar 8, 2018
Member
I believe there are two "common usages" of Idempotent... one is the mathematical sense, like ABS(-1) === ABS(ABS(-1)), and the other is the programming sense, like x = 4; being equivalent to x = 4; x = 4;
The second is also the mathematical sense. The term is used there because semantically, you can think about the state of a program as an abstract value that is "computed" by executing statements. The semantics of a statement can be seen as a function from state to state. And for a statement like the above, this function is idempotent.
More concretely, the semantics of "x = 4", often written [[x = 4]], is a function where the result is the same state value as the arg but with its internal mapping for x changed. And if you have an initial state S, then that resulting state S' = [[x=4]] (S) is always the same as the one resulting from [[x=4]] ([[x=4]] (S)).
The second is also the mathematical sense. The term is used there because semantically, you can think about the state of a program as an abstract value that is "computed" by executing statements. The semantics of a statement can be seen as a function from state to state. And for a statement like the above, this function is idempotent. More concretely, the semantics of "x = 4", often written [[x = 4]], is a function where the result is the same state value as the arg but with its internal mapping for x changed. And if you have an initial state S, then that resulting state S' = [[x=4]] (S) is always the same as the one resulting from [[x=4]] ([[x=4]] (S)). |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rossberg
Mar 8, 2018
Member
Markup messed up the notation. I meant to write that the state S' = [[x=4]] (S) is always the same as the one resulting from [[x=4]] ([[x=4]] (S)).
|
Markup messed up the notation. I meant to write that the state S' = [[x=4]] (S) is always the same as the one resulting from [[x=4]] ([[x=4]] (S)). |
michaelficarra commentedMar 7, 2018
There are occasions throughout the spec where the word "idempotent" is used to mean something other than its common usage in mathematics. In these cases, the spec is trying to claim that a host-defined procedure indeed behaves as a mathematical function. For example,
Confusingly, there are also instances that are consistent with common usage.
I think we can just remove the incorrect usage, since the intended meaning is always described immediately after. If someone has a better term or phrasing to use as an alternative, I'd love to hear it.