-
Notifications
You must be signed in to change notification settings - Fork 1
Limit type inference to bottom up, give the literals a type. #7
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
Comments
As I mentioned already in the comments on my PR. I don't mind type inference - it's handy and not hard to implement (and remember that we don't have the efficiency concerns here that we have in the binary format) - but we should be able to specify the type concisely. It goes without saying that the type inferred for a dropped value will have to be specified at some point, but it hardly matters. I'd say treat |
@qwertie If there were some bottom up type specialization in the binary encoding then it would not be necessary to specify the type in the text format, and not even possible. The redundant information just causes trouble and adds complexity. Bottom up type specialization could be efficient when decoding the post-order encoding, but not so top-down specialization. |
This issue has surfaced in our implementation too. Since we have type inference for infix operators, my thought was that it'd be nice to have type inference for literals too. |
The wasm binary encoding could combine |
With the choice of a post-order encoding, bottom-up typing is obvious and could be used in the binary encoding too, see WebAssembly#620
The literal constants do not have a type specifier and for bottom-up typing they need a type. There is not always a top-down type either for example
(drop (i64.const 1))
is ambiguous in the text format. Could use 1L for i64 and 1F0 or 1D0 etc for the floats.The text was updated successfully, but these errors were encountered: