Skip to content
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

Make assert/invoke require constant parameters? #109

Closed
AndrewScheidecker opened this issue Oct 3, 2015 · 6 comments
Closed

Make assert/invoke require constant parameters? #109

AndrewScheidecker opened this issue Oct 3, 2015 · 6 comments

Comments

@AndrewScheidecker
Copy link
Contributor

I just noticed that invoke accepts arbitrary expressions as parameters. WAVM currently generates code for each assertion, but I was hoping to get rid of that and make each assertion just call some exported function with constant parameters.

It could also go the other way and allow expressions other than invoke as the left hand side of the assertion, but what's there right now seems like an awkward trade off between power and simplicity that achieves neither.

@sunfishcode
Copy link
Member

This makes sense to me. I revised several tests to work like this already, and #104 revises float32.wast's tests this way too, which I believe is the only remaining one.

@lukewagner
Copy link
Member

Ideally, I think, we'd not reuse wasm for the Script.command language (and thus remove Eval.eval). That might also let us have more concise syntax for specifying the constants.

@jcbeyler
Copy link

jcbeyler commented Oct 7, 2015

I don't really see a problem with having expressions as parameters. Is there one?

I implemented it as such and think it is a good way of being able to cascade different calls together and ensuring the end result. I see simplicity of having the constants instead but I think expressions just allow more possibilities.

@titzer
Copy link
Contributor

titzer commented Oct 7, 2015

I also think constants only makes sense. Otherwise you need to be able to
'eval wasm' to test wasm.

On Wed, Oct 7, 2015 at 4:05 PM, jcbeyler notifications@github.com wrote:

I don't really see a problem with having expressions as parameters. Is
there one?

I implemented it as such and think it is a good way of being able to
cascade different calls together and ensuring the end result. I see
simplicity of having the constants instead but I think expressions just
allow more possibilities.


Reply to this email directly or view it on GitHub
#109 (comment).

@jcbeyler
Copy link

jcbeyler commented Oct 8, 2015

Funny ☺. It kind of goes in the same conversation of Descartes: Doubt of everything except that you are doubting (otherwise how can you know that you are really doubting ;-)).

I do see the point but I don’t see it as a real problem:

Unitests that use constants for base functionality of foo

è Thus assess that foo is fine

Start using foo in the unitests for higher level testing.

I’m ok with any decisions you make, I was just curious

@lukewagner
Copy link
Member

Eval.eval is now removed and args/results are fixed to constants.

eqrion pushed a commit to eqrion/wasm-spec that referenced this issue Nov 25, 2019
Connicpu pushed a commit to Connicpu/wasm-spec that referenced this issue May 11, 2020
JavaScript `Atomics.wait` takes milliseconds, but wasm uses nanoseconds
for timeout.
rossberg pushed a commit that referenced this issue Feb 11, 2021
Fix decription of ref.func
dhil pushed a commit to dhil/webassembly-spec that referenced this issue Dec 6, 2023
[test] Unify the trap message of "null function reference".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants