i-net-software / JWebAssembly

Java bytecode to WebAssembly compiler
Apache License 2.0
985 stars 64 forks source link

how to build compiler? #19

Closed haorenfsa closed 2 years ago

haorenfsa commented 4 years ago

It would be much better if there's an instruction about how to build the compiler, and how to use the compiler to compile java code into .wasm.

Or maybe an docker image or binary releases for common platform may also work.

Below are my experiences: I tried to download the code; installed gradle which seldom use before; and used gradle to build; gradle build failed, and there's tons of errors; I spent an hour or two trying to figure out; I lose patience. I turn to teavm. They got all instructions I need in the repo's readme.md. Half an hour later, I got my first piece of code running. So I went back and write this issue.

Horcrux7 commented 4 years ago

It would be much better if there's an instruction about how to build the compiler, and how to use the compiler to compile java code into .wasm.

Why you want build the compiler self and does not use an existing build? Do you want contribute to JWebAssembly?

Or maybe an docker image or binary releases for common platform may also work.

I does not understand what the docker should do. There already exist docker images with Java and Gradle if you want use Gradle as build system. All other would be downloaded through the dependencies in your build script.

installed gradle

This sounds the core problem. Do you use another build system like maven? Which? Gradle is on board of all Java IDE via plugin. I have never installed it manually.

I turn to teavm.

This tool live in the maven universe and not Gradle. This sounds like that that you are familiar with the maven build system. Currently there is no plan for a maven plugin. This will be a Job for the community.

They got all instructions

Which point on the follow instruction was the problem? https://github.com/i-net-software/JWebAssembly/wiki/Getting-Started I will be happy to improve it.

So I went back and write this issue.

Thanks for the follow up. But I does not know how I can help you. You have nothing write about your environment and specific problems.

haorenfsa commented 4 years ago

Which point on the follow instruction was the problem? https://github.com/i-net-software/JWebAssembly/wiki/Getting-Started I will be happy to improve it.

I think the key problem is the starting guide jump to compiler output without showing how to compile. So I assume I need to have a compiler, but I can't find any link to download an existing build of the compiler. So I decided to build it myself.

Why you want build the compiler self and does not use an existing build? Do you want contribute to JWebAssembly?

As mentioned above the reason is that I can't find any link to download an existing build of the compiler. I want to compile java code into wasm bytecode. (which I just found on bintray.com, but it's just a lib, not dirrectly runnable to compile anything)

I does not understand what the docker should do. There already exist docker images with Java and Gradle if you want use Gradle as build system. All other would be downloaded through the dependencies in your build script.

I assume that the compiler needs java to run. So if we have a docker image contains the compiler and all the runtime environment it needs, then someone can compile his/her java code any where on any system supports docker, even without java or any other dependency installed. Anyway it's just a sugguestion.

Horcrux7 commented 4 years ago

I have write some improvements to the Getting Started. I hope this make things clearer.