New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change misuse of "idempotent" to something else #1133

Open
michaelficarra opened this Issue Mar 7, 2018 · 13 comments

Comments

Projects
None yet
7 participants
@michaelficarra
Member

michaelficarra commented Mar 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,

This operation must be idempotent if it completes normally. Each time it is called with a specific exportName, resolveSet pair as arguments it must return the same result.

Confusingly, there are also instances that are consistent with common usage.

The ToInt32 abstract operation is idempotent: if applied to a result that it produced, the second application leaves that value unchanged.

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.

@getify

This comment has been minimized.

Show comment
Hide comment
@getify

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.

Contributor

getify commented Mar 7, 2018

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.

@tabatkins

This comment has been minimized.

Show comment
Hide comment
@tabatkins

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.

@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

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?

Member

ljharb commented Mar 7, 2018

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?

@michaelficarra

This comment has been minimized.

Show comment
Hide comment
@michaelficarra

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.

Member

michaelficarra commented Mar 7, 2018

@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

This comment has been minimized.

Show comment
Hide comment
@ljharb

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.

Member

ljharb commented Mar 7, 2018

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.

@michaelficarra

This comment has been minimized.

Show comment
Hide comment
@michaelficarra

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.

  1. Let int be the mathematical value that is the same sign as number and whose magnitude is floor(abs(number)).
Member

michaelficarra commented Mar 7, 2018

@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.

  1. Let int be the mathematical value that is the same sign as number and whose magnitude is floor(abs(number)).
@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Mar 7, 2018

Member

@michaelficarra fair point; but in that case I think both definitions are useful.

Member

ljharb commented Mar 7, 2018

@michaelficarra fair point; but in that case I think both definitions are useful.

@robpalme

This comment has been minimized.

Show comment
Hide comment
@robpalme

robpalme Mar 7, 2018

robpalme commented Mar 7, 2018

@michaelficarra

This comment has been minimized.

Show comment
Hide comment
@michaelficarra

michaelficarra Mar 7, 2018

Member

@robpalme That would make me happy.

Member

michaelficarra commented Mar 7, 2018

@robpalme That would make me happy.

@claudepache

This comment has been minimized.

Show comment
Hide comment
@claudepache

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).

Contributor

claudepache commented Mar 7, 2018

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).

@michaelficarra

This comment has been minimized.

Show comment
Hide comment
@michaelficarra

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".

Member

michaelficarra commented Mar 7, 2018

@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".

@rossberg

This comment has been minimized.

Show comment
Hide comment
@rossberg

rossberg Mar 8, 2018

Member

@getify:

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)).

Member

rossberg commented Mar 8, 2018

@getify:

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)).

@rossberg

This comment has been minimized.

Show comment
Hide comment
@rossberg

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)).

Member

rossberg commented Mar 8, 2018

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)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment