Closed diakopter closed 5 years ago
I think you want "-run" instead of "run". You'll get compile errors because the wave module and the system module both use pointers, which are not in the interpreter target used by "run". Aeneas should give an error here, but I am not sure why it does not. (note that the behavior is the same for Aeneas running on any target).
Btw, you probably want to use -heap-size=500m when compiling Aeneas to wasm, as there is no default heap size set for this target, and you'll run out of memory very quickly, which will just look like a memory access out of bounds.
user@host009:~/src/virgil/bin/dev$ wave ../current/wasm/Aeneas.wasm -compile -heap-size=1000m -target=wasm ../../test/wave/hello-v3.v3 ../../rt/wave/*.v3
Trap: Uncaught RuntimeError: memory access out of bounds
42 user@host009:~/src/virgil/bin/dev$
it gets a little farther...
worked when I compiled Aeneas.wasm with the bigger heap size. 👍
well, it produced a .wasm, but then when I ran it:
user@host009:~/src/virgil/bin/dev$ wave hello-v3.wasm
<unknown>:-1: Uncaught CompileError: WebAssembly.Module(): unknown section code #0x1f @+546
ERROR: could not compile hello-v3.wasm
255
well, now it's working but it has exit code 32, but I don't know that I did anything differently..
user@host009:~/src/virgil/bin/dev$ wave ../current/wasm/Aeneas.wasm -compile -heap-size=500m -target=wasm ../../test/wave/hello-v3.v3 ../../rt/wave/*.v3
user@host009:~/src/virgil/bin/dev$ wave hello-v3.wasm
Hello world!
32 user@host009:~/src/virgil/bin/dev$
@titzer 😄