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

WebAssembly on GraalVM #1358

Closed
linux-china opened this issue Jun 6, 2019 · 10 comments
Closed

WebAssembly on GraalVM #1358

linux-china opened this issue Jun 6, 2019 · 10 comments
Assignees
Labels

Comments

@linux-china
Copy link

linux-china commented Jun 6, 2019

Add WebAssembly runtime on GraalVM with CLI and embed support, just like LLVM on GraalVM.

Cli as following:

gwasm polyglot.wasm 

Embed as following:

 Context polyglot = Context.newBuilder().allowAllAccess(true).build();
        File file = new File("polyglot.wasm");
        Source source = Source.newBuilder("wasm", file).build();
        Value cpart = polyglot.eval(source);
        cpart.execute();  

Now no Java Runtime for WebAssembly. https://github.com/appcypher/awesome-wasm-runtimes

Now lots of guys did the work to make WebAssembly run from web and with huge future for FaaS, Serverless and WASM MicroVM. If GraalVM has this feature, and Java developers can develop a real Polyglot runtime platform to accept WebAssembly module from Rust, TypeScript etc. Please consider WebIDL and WASI support.

Happy to see TruffleWASM :)

@linux-china
Copy link
Author

Towards a WebAssembly standalone runtime on GraalVM https://dl.acm.org/citation.cfm?id=3362780

@renatoathaydes
Copy link

FYI I wrote a blog post about my experience trying to run WASM on the JVM, if anyone is interested (yes, it's possible now, but far from "complete")!.

Basically, you can use asmble to create class files from wasm and wat files... and I wrote a Gradle plugin that uses asmble to make using WASM in a Gradle project as easy as using any JVM language.

Get in touch if that would be of interest to you.

@KOLANICH
Copy link

KOLANICH commented Nov 25, 2019

I wonder if it can be possible to translate wasm into llvm and run that llvm bitcode upon graal.

@neomatrix369
Copy link
Contributor

I wonder if it can be possible to translate wasm into llvm and run that llvm bitcode upon graal.

Check out the post referred to by @renatoathaydes above.

@KOLANICH
Copy link

I have already read it.

@renatoathaydes
Copy link

The wabt toolkit includes a wasm2c tool (i.e. compiles WASM to C). You can use that, then compile C to LLVM with clang, and you're done.

@KOLANICH
Copy link

KOLANICH commented Nov 30, 2019

There are converters that convert wasm to llvm bitcode directly. Thank you for getting me known about wasm2c though.

@eliasvasylenko
Copy link

Looks like this is now being worked on here https://github.com/oracle/graal/tree/master/wasm

@thomaswue
Copy link
Member

Tweet on the announcement about the effort is now available here: https://twitter.com/graalvm/status/1201544880364937216?s=20
Medium post: https://medium.com/graalvm/announcing-graalwasm-a-webassembly-engine-in-graalvm-25cd0400a7f2

I think the issue can be closed for now :). For follow-up suggestions and bug reports feel encouraged to open separate issues.

@renatoathaydes
Copy link

Great @thomaswue ! It's funny we met in San Francisco at a cafe, hope you remember me... now here :) will play with GraalVM's WASM as soon as I can!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants