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

Call-site coercions. #70

Closed
cscott opened this Issue Jun 14, 2013 · 8 comments

Comments

Projects
None yet
4 participants
@cscott

cscott commented Jun 14, 2013

This is discussed in https://bugzilla.mozilla.org/show_bug.cgi?id=883175 and https://bugzilla.mozilla.org/show_bug.cgi?id=854061 (comments 26 and 29). The current (final?) version of the rules proposal is in comment 7 and 15 on bug 883175.

Call sites to local and foreign functions must appear in one of the following grammatical forms:
+f() => f returns doublish
f()|0 => f returns intish
f(); => f returns void

@cscott

This comment has been minimized.

Show comment
Hide comment
@cscott

cscott Jun 14, 2013

Oh, and this also removes the 'unknown' type from the spec.

cscott commented Jun 14, 2013

Oh, and this also removes the 'unknown' type from the spec.

@cscott

This comment has been minimized.

Show comment
Hide comment
@cscott

cscott Jun 19, 2013

Updated the issue description to match the latest proposal from bug 883175 (comment 7 and 15).

cscott commented Jun 19, 2013

Updated the issue description to match the latest proposal from bug 883175 (comment 7 and 15).

@cscott

This comment has been minimized.

Show comment
Hide comment
@cscott

cscott Jun 20, 2013

Latest proposal also allows f(), ... => f returns void. (ie, void functions can appear as left operand to the comma operator). See https://bugzilla.mozilla.org/show_bug.cgi?id=883175#c26

cscott commented Jun 20, 2013

Latest proposal also allows f(), ... => f returns void. (ie, void functions can appear as left operand to the comma operator). See https://bugzilla.mozilla.org/show_bug.cgi?id=883175#c26

@kripken

This comment has been minimized.

Show comment
Hide comment
@kripken

kripken Jun 21, 2013

Collaborator

Without that last one, could have been quite painful...

Collaborator

kripken commented Jun 21, 2013

Without that last one, could have been quite painful...

@jruderman

This comment has been minimized.

Show comment
Hide comment
@jruderman

jruderman Jun 24, 2013

Does this mean changing Math.abs(signed) to return signed instead of unsigned?

jruderman commented Jun 24, 2013

Does this mean changing Math.abs(signed) to return signed instead of unsigned?

@cscott

This comment has been minimized.

Show comment
Hide comment
@cscott

cscott Jun 24, 2013

The result of Math.abs(-2147483648) is indeed unsigned, not signed. The callsite grammar requires us to coerce the result back to signed using Math.abs(-2147483648)|0 (yielding a negative result), but that seems like an orthogonal issue (unless you're proposing that f()>>>0 be added to the set of valid call site expressions).

cscott commented Jun 24, 2013

The result of Math.abs(-2147483648) is indeed unsigned, not signed. The callsite grammar requires us to coerce the result back to signed using Math.abs(-2147483648)|0 (yielding a negative result), but that seems like an orthogonal issue (unless you're proposing that f()>>>0 be added to the set of valid call site expressions).

@sunfishcode

This comment has been minimized.

Show comment
Hide comment
@sunfishcode

sunfishcode Jun 3, 2014

Collaborator

The unknown type was removed and several other changes were added in 7881fbe.

Math.abs' return type in asm.js is signed, since unsigned return types are not supported in general. The document at asmjs.org/spec/latest has this update, though it's not yet in the github repository.

Collaborator

sunfishcode commented Jun 3, 2014

The unknown type was removed and several other changes were added in 7881fbe.

Math.abs' return type in asm.js is signed, since unsigned return types are not supported in general. The document at asmjs.org/spec/latest has this update, though it's not yet in the github repository.

@sunfishcode

This comment has been minimized.

Show comment
Hide comment
@sunfishcode

sunfishcode Jun 4, 2014

Collaborator

Looking at the actual latest github repository, the update is indeed present.

Collaborator

sunfishcode commented Jun 4, 2014

Looking at the actual latest github repository, the update is indeed present.

@sunfishcode sunfishcode closed this Jun 4, 2014

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