-
Notifications
You must be signed in to change notification settings - Fork 147
exec: add example for VM usage #61
Conversation
Thank you very much for writing this. Should definitely help me get started! I'd suggest linking to this example from the repo's README. And since we're talking, do you have any experience with producing wasm from C++ or any other language? Should I expect Review status: 0 of 5 files reviewed, 8 unresolved discussions (waiting on @sbinet) exec/vm_example_test.go, line 24 at r1 (raw file):
it'd be good, at least for me, to explain a bit how linking works in the wasm world, and how that affects wagon. In this test we're manually handling the loading of one module ( exec/vm_example_test.go, line 37 at r1 (raw file):
call out the awesome fact that "go" is not a module we're loading, but one we're synthesizing. exec/vm_example_test.go, line 46 at r1 (raw file):
pls comment this exec/vm_example_test.go, line 55 at r1 (raw file):
what's up with this ptr to an empty struct? If it is needed, consider adding a comment (there are none at the exec/vm_example_test.go, line 75 at r1 (raw file):
nit: here and elsewhere, since exec/vm_example_test.go, line 106 at r1 (raw file):
I'm not sure I understand the need for this function, and calling it "compile" sure is misleading :) exec/testdata/add-ex.wast, line 2 at r1 (raw file):
unless the exec/testdata/add-ex.wast, line 3 at r1 (raw file):
for my edification - what does Comments from Reviewable |
To answer my last question, I've had good luck compiling simple C functions with Review status: 0 of 5 files reviewed, 8 unresolved discussions (waiting on @sbinet) Comments from Reviewable |
Review status: 0 of 5 files reviewed, 9 unresolved discussions (waiting on @sbinet) exec/vm_example_test.go, line 71 at r1 (raw file):
you forgot to check for the returned err here Comments from Reviewable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a pretty nice PR that solves a problem that I'm passing on.
Review status: 0 of 5 files reviewed, 8 unresolved discussions (waiting on @andreimatei and @sbinet) exec/vm_example_test.go, line 24 at r1 (raw file): Previously, andreimatei (Andrei Matei) wrote…
Done. (I think) exec/vm_example_test.go, line 37 at r1 (raw file): Previously, andreimatei (Andrei Matei) wrote…
Done. exec/vm_example_test.go, line 46 at r1 (raw file): Previously, andreimatei (Andrei Matei) wrote…
Done. exec/vm_example_test.go, line 55 at r1 (raw file): Previously, andreimatei (Andrei Matei) wrote…
Done. exec/vm_example_test.go, line 71 at r1 (raw file): Previously, andreimatei (Andrei Matei) wrote…
Done. (good catch!) exec/vm_example_test.go, line 75 at r1 (raw file): Previously, andreimatei (Andrei Matei) wrote…
I usually prefer to use exec/vm_example_test.go, line 106 at r1 (raw file): Previously, andreimatei (Andrei Matei) wrote…
I am leaning towards just adding a snarky comment about the lack of WAST->WASM compilation support (linking towards the issue) and leave it at that. exec/testdata/add-ex.wast, line 2 at r1 (raw file): Previously, andreimatei (Andrei Matei) wrote…
Done. (I have linked to the specs. exec/testdata/add-ex.wast, line 3 at r1 (raw file): Previously, andreimatei (Andrei Matei) wrote…
yeah... redundant but this allows to have a linear definition for the module. Comments from Reviewable |
Updates #60.
Reviewed 2 of 5 files at r1, 3 of 3 files at r2. Comments from Reviewable |
Updates #60.
This change is