How central is Google Web Toolkit for current Kotl...
# getting-started
m
How central is Google Web Toolkit for current Kotlin?
0️⃣ 1
c
What's GWT? ← that's your answer
m
It's the "de facto" Java frontend toolkit? What is Kotlin-JS?
c
I've been developing Kotlin for 6+ years (3+ years frontend) and never heard of it. Guess it's not central to Kotlin at all.
m
That's like saying GCP is not central, since I have a private cloud(?)
b
Do you mean GWT as in Google Web Toolkit?
1
c
So according to Wikipedia it's a framework to develop JS applications in Java. Why would we use that when we can call the JS APIs directly?
m
Cross-platformicity?
Backwards-compatibility?
c
Backwards-compatibility with what?
m
Java
Desktop
c
Can you make desktop apps with GWT?
m
One can also add React to this discussion, and then notice how some sources argue React as breaking compatibilities, and the cure is Web Components
r
GWT is about compiling Java sources. We don't have Java sources when using Kotlin.
c
Ah, React is used quite a bit in Kotlin. For example, Space (tool by JetBrains) is written in React.
m
okay which would suggest that it's a different paradigm from GWT
c
Of course it's different, we're not Java.
That's my point: you can call any JS function directly. You can use any library on NPM. There's no need for a Java framework when we can use React or anything else
m
But they say React is not very good for reusability, while Web Components are
thus I have speculated its suitability for long-term projects
c
Writing frontend projects in Java is definitely not good for reusability...
m
"_a React component can only be reused in the React application_. A web component, on the other hand, can be used anywhere."
r
You could check KVision (https://kvision.io), if you are looking for components based web development with Kotlin (disclaimer: I'm the creator). It's definitely a bit similar to GWT 🙂
m
it's just that maybe React isn't related to W3C, dunno?
c
There's also #compose-web, #kobweb (based on Compose Web), #korge (for games)...
m
So is KVision endorsed by W3C?
c
Why would anyone need to be endorsed by the W3C?
😂 2
m
because it's the definite web standards organization?
c
Is it illegal to use something that is not written in a standard?
m
no, but then it might have unofficial support
r
We don't create a different web with Kotlin/JS (or any other similar tools) - it's all the same HTML and JS.
☝️ 1
m
yes but the other thing was compatibility aspect with desktop toolchains
so if there's Java Spring, then
or if there's GWT, then
c
Spring isn't a frontend framework. GWT can't do desktop or Android. What's your point?
m
well I just thought I'd use GWT on desktop
c
I can write a Kotlin library and use it on all platforms. No other language can do that.
m
so then I thought why is it not relevant elsewhere
c
Why would you write a Java application, compile it to JavaScript, run it in a browser, when you could just write a Java application and run it as is?
m
although based on this https://www.jrebel.com/blog/java-web-framework-usage-stats there's also Spring MVC
Because now Android is not Java, doh
the problem is about what happens when it's Kotlin and the past frameworks are in Java
Or do you suggest that Kotlin-GWT is trivial?
c
Kotlin-GWT is not possible. GWT is a compiler that reads Java source code. We don't have Java source code.
r
The world is changing - frameworks come and go, and languages as well
m
Yes, so is Kotlin-JS a lone island?
c
Even if it was possible, there's no benefit to learning an entirely new framework when you could call directly the browser APIs (which are defined by the W3C, since that seems important to you)
m
yes, sure but I've found that business users like frameworks
c
What do you mean by lone island? It has access to the entire JS ecosystem, which is arguably the largest ecosystem there is.
m
I believe very few write vanilla JS
c
Kotlin/JVM has access to the entire JVM ecosystem. Kotlin/JS has access to the entire JS ecosystem. Kotlin/Native has access to everything conforming to the C ABI. There's no other language that has this kind of compatibility.
💯 2
m
That's not what I'm asking for, I'm asking whether Kotlin/JS is such that one can write for desktop and get Kotlin/JS for free?
c
“very few write vanilla JS” Do you count React, jQuery, Angular as vanilla JS? If so, your vision of the web is quite surprising.
m
which is the case with React etc.
no vanilla JS is "JS without frameworks"
-> most people use frameworks
-> Kotlin/JS should use the most popular/standard ones
c
Yeah, and a lot of Kotlin people use React (or KVision, Compose Web...)
m
then just see the React vs Web Components discussions
and lets remind that: "_Google Web Toolkit_ — Web Component Framework for Java Developers"
g
And so? GWT is framework to compile Java to JS, it cannot be used with Kotlin, not endorsed by W3C (which is irrelevant btw) and not related to Kotlin JS somehow
o
To answer the original question: GWT is a non-issue with Kotlin. Other than that, it would be more useful to present a real-world use case and discuss solutions for that. Dumping all kinds of unrelated opinions into a thread seems like bordering on trolling for me.
s
The only time I’ve had to interact with GWT it was in the Siemens Teamcenter ecosystem. Their web client was written using GWT when I first got started but they quickly found it difficult to maintain and hire competent front end engineers and have since rewritten in straight Angular.
m
@Oliver.O Yes, but part of the problem is confusion among competing standard pipelines. For some it's vanilla JS, for some it's GWT, for some it's React, ...
And when you ask each camp what's the best, they will all say their's is.
But since GWT is by Google, then it's expectable that it would be the most natural toolchain for Android. Possibly even in native sense. So then you get the question.
@Oliver.O Non-issue? It's not React.
I don't about GWT, since I'm new to it, but it seems like it could be very related to Google's internal way of producing web sites.
But in this context one might also speculate https://news.ycombinator.com/item?id=19460116
s
no, GWT has nothing to do with Android. It was about writing web apps in Java instead of JS, and if I'm not mistaken than Goggle left it behind between 5-10 years ago when they realized, it wasn't a good idea. (I did actually write a GWT web-component around 10 years ago.)
💯 1
But the main thing for this forum is that there is no overlap between Kotlin and GWT what-so-ever.
g
@Matti Viljamaa why would the framework to produce js from java would be natural on Android which doesn't use JS or other web techologies for application (apart from browser/WebView)? Nothing strange or confusing about different frameworks and approaches to write for browsers, do not understand why it confuses you, it's just progress and competition, different approaches, different goals and different languages.