As an example if the level of low impedance between the languages, consider the @JsFunction annotation,
@JsType(isNative = true)
interface EventTarget {
void addEventListener(String event, EventListener listener);
}@JsFunction
interface EventListener {
void onEvent(Event event);
}Using Java8, you can write code like:
document.createElement("button").addEventListener("click", x -> Console.log("Hello World"));
The difference between GWT running this, and the new compiler, is that the output of the new compiler is a standard ES6 module.
The JSweet claims about GWT are out of date. First of all, in-browser Java debugging has been available for years. GWT was in fact, the very first transpiler to leverage Chrome source maps. I demoed this three years ago (https://www.youtube.com/watch?v=-xJl22Kvgjg)
Secondly, GWT has a "reversible and compatible" JsInterop system that provides full two way low-impedance bidirectional interop, you can even do things like subclass JS objects from Java, or define "fields" via @JsProperty which invoke methods ala Object.defineProperty()
Third, the JSweet stuff looks like it doesn't obey standard JLS semantics. Does it even compile the JRE or Guava? This is absolutely vital for code sharing between platforms (e.g. server, Android, j2objc). If you can't run standard JLS semantics, there's little point to writing the code in Java in the first place.