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

TeaVM bindings for resource types are un-implemented #1010

Open
Sintrastes opened this issue Jul 29, 2024 · 7 comments
Open

TeaVM bindings for resource types are un-implemented #1010

Sintrastes opened this issue Jul 29, 2024 · 7 comments

Comments

@Sintrastes
Copy link

the lib.rs in teavm-java seems to have a number of todo! macros currently, which prevent bindings being generated for any .wit files containing resource types.

@Mossaka
Copy link
Member

Mossaka commented Jul 30, 2024

I think that teavm-java is not being actively maintained. Loop in @dicej for clarification.

@dicej
Copy link
Collaborator

dicej commented Jul 30, 2024

@Mossaka is correct that it's no longer being actively maintained; it was an experiment that never really took off. I think we should probably remove it unless someone wants to volunteer to maintain it going forward.

TeaVM is a really cool project, but it's not necessarily the best solution for transpiling general-purpose Java code to Wasm given that the class library is extremely limited compared to OpenJDK's library, which means most third-party libraries won't work. Other projects, such as Bytecoder and GraalVM's native image compiler might be better suited to the task, although the latter is a long shot given that Oracle appears to have zero interest in Wasm.

@Sintrastes
Copy link
Author

I'm personally not super invested in TeaVM in particular. Just compiling JVM applications to WASM, so Bytecoder definitely looks promising.

I wouldn't mind helping with some of the work to add that as a new target, but I'll probably need to learn a lot more about the WASM Component Model ABI before I'd be very helpful.

@konsoletyper
Copy link

@dicej @Sintrastes Bytecoder's class library emulation looks even more limited. FYI, that original TeaVM project supports WASI target, except that there's no support for wit bindings.

@dicej
Copy link
Collaborator

dicej commented Aug 1, 2024

@dicej @Sintrastes Bytecoder's class library emulation looks even more limited. FYI, that original TeaVM project supports WASI target, except that there's no support for wit bindings.

@konsoletyper Can you elaborate on how Bytecoder's class library is more limited? I haven't done anything with it myself, so I honestly don't know, but the "Backed by OpenJDK 20 as JRE classlib" item listed in the high level goals section of the readme led me to expect broader compatibility.

@konsoletyper
Copy link

@dicej according to what I saw, they just take bytecode from the underlying JDK and replace some of the classes with their own implementations. Not sure their implementation is complete and fits any other underlying JDK than 20. With some classes it may work, for some it may lack necessary re-imlpementation. Their test coverage is quite limited, they rely on their own tests, not running JDK tests. So for anything beyond class library emulation that comes with Bytecoder, there no guarantee that some particular Java API would work. Not even sure they have support for WASI.

BTW, GraalVM currently does not support WebAssembly target, they doing quite opposite thing: running WebAssembly within JVM. I heard though that they have plans to support WebAssembly as a target.

@dicej
Copy link
Collaborator

dicej commented Aug 1, 2024

@konsoletyper thanks for clarifying WRT Bytecoder.

BTW, GraalVM currently does not support WebAssembly target, they doing quite opposite thing: running WebAssembly within JVM. I heard though that they have plans to support WebAssembly as a target.

Right. This issue contains a proposal to support a Wasm target, but Oracle appears to be entirely unmotivated despite strong interest from the community, so I don't have high hopes for it.

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

No branches or pull requests

4 participants