It's much like GWT, however GWT takes source code, and this limits GWT to Java only.
Unlike GWT, TeaVM relies on existing compilers such as javac, kotlinc and scalac.
These compilers produce bytecode (
TeaVM is for you, if:
- You are a Java developer and you are going to write a web front-end from scratch.
- You already have a Java-based backend and want to integrate front-end code tightly into your existing development infrastructure.
- You have some Java back-end code you want to reuse in the front end.
- You are ready to rewrite your code to work with TeaVM.
If you have tightly-coupled applications that use Swing, you want to run these applications in web, and you don't care about download size, start-up time and performance, you should probably look elsewhere; there are more appropriate tools for you, like CheerpJ.
- TeaVM has a very sophisticated optimizer, which knows a lot about your code. Some examples are:
- Devirtualization turns virtual calls into static function calls, which makes code faster.
- TeaVM can reuse one local variables to store several local variables.
- TeaVM renames methods to as short forms as possible; UglifyJS usually can't perform such optimization.
- TeaVM is very fast, you don't need to wait for minutes until your application gets recompiled.
- TeaVM produces source maps; TeaVM IDEA plugin allows you to debug code right from the IDE.
Why use TeaVM when there are plenty of transpilers and frameworks for web front-end development?
TeaVM allows you to use single ecosystem, and reuse as much as possible of it for both back-end and front-end worlds.