Java Host Research

February 8, 2023 ยท View on GitHub

This repo contains research documents and PoC application showcasing the feasibility of using wasmer-java as a Host Wasm Runtime Environment. The research was conducted in accordance to the W3F foundation grant.

Research Documents

3 main documents were produced as result of the research:

Additionally 2 more documents were created:

Proof of Concept Demo

Prerequisites - Docker

You can check if you have docker installed by running docker -v

If you don't have docker you can download it from here

PoC consists of a couple of carefully tailored examples which would be called in the docker container and have their output saved in a text file in the container.

  1. install wasmer-java submodule - git submodule update --init
  2. create the docker image - docker build -t wasmer-java wasmer-java
  3. create and enter container - sudo docker run -it wasmer-java bash
  4. view output file - less /opt/wasmer-java/output.txt

The first example being run tests imports by loading a runtime requiring the following imports: img.png

The second example manipulates memory through a pointer returned by the function invoked

Both of the examples as well as the wasm files can be found here.

Note that the runtime wasm file also has a wat variant and the hello_world wasm file was compiled from the rust file with the same name.