Hacker News new | ask | show | jobs
by konsoletyper 970 days ago
As an author TeaVM I can tell you about advantages of TeaVM compared to GWT.

1. TeaVM can compile not only Java, but Scala and Kotlin. Actually, any JVM language, which is not using much reflection, invokedynamics and dynamic class loading in its runtime. It's possible because TeaVM uses JVM bytecode, not Java source code, as an input. 2. TeaVM can emulate threads. TeaVM won't spawn real threads, it will turn Java methods into coroutines and schedule their execution upon one physical thread. This won't speed-up programs by using multiple cores, but for example you can use Java synchronous IO APIs in a background thread. 3. TeaVM has more advanced reflection support. You can list class' methods and fields, call methods and get/set field via reflection (but as in any other AOT compiler you should list reflectable methods and fields). 4. Maven and Gradle plugins both available out-of-the-box, you don't need any 3rd party tool. 5. I usually get positive feedback from my users about compilation time compared to GWT. 6. TeaVM already has some limited support of compilation to WebAssembly.

As for latest Java version, TeaVM currently supports Java 21.

1 comments

Many thanks. Looks really promising. I tried TeavM two or so years ago and faced problem because my Java veriosn was newer than 14, if I remember correctly.

Now with this new release, things look great, at least for some time :D