In general, running wasm by itself outside of a browser is not a simple thing. You'll need some sort of libc or syscall standard, which doesn't exist yet. But WAVM could perhaps define such a thing. I suggest filing an issue on that project, maybe they are working on it already.
On Tue, Jan 23, 2018 at 6:12 PM, zz zz <jeffyan....@gmail.com> wrote: > Hi > > I want to get the wasm binary file to run with out any web browser, just > run the .wasm file alone, so I need a VM tool like java program to .class > file. > Then I got a tool named WAVM, you can see that: https://github.com/ > AndrewScheidecker/WAVM > "This is a standalone VM for WebAssembly." as the state, but I was not run > out correctly. > > > 在 2018年1月23日星期二 UTC+8下午11:25:00,Brian Gavin写道: > >> Hello zz zz >> Most people are using wasm with a web browser. I believe you can use it >> with Nodejs. You are going to need to use javascript with wasm because >> WASM has a limited api. In your example the printf will actually be done >> by javascript. WASM has no API to print to the screen. >> >> Can you be more specific what you are trying to do? Also I am not sure >> why you are setting SIDE_MODULE=1 >> >> Brian Gavin >> >> On Tuesday, January 23, 2018 at 2:22:48 AM UTC-5, zz zz wrote: >>> >>> Hi, >>> >>> I wrote a c code file just like that: >>> >>> ///////////////////////////////////// >>> #include <stdio.h> >>> >>> int hell(int x) { >>> printf("hello wsam\n"); >>> return 44+x; >>> } >>> int main() { >>> hell(33); >>> return 32; >>> } >>> /////////////////////////////////// >>> >>> and compiled it with : >>> #emcc hello.c -Os -s WASM=1 -s SIDE_MODULE=1 -o hello.wasm >>> then I want to run the wasm file without the web browser, is >>> there any pretty tools (like java) can do that? >>> I got a tool named wavm, but it was not work as imagine. >>> >>> -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to emscripten-discuss+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.