News for hackers. Stuff that matters.
Re:New Java to WASM GC Transpiler: Run Java in the Browser, ... by seinecle on Sunday December 15, 2024 @02:20AM (#42422067)
Love the concept but no clear idea of a use case.

Could you list 3 or 4 of them please?

Re:New Java to WASM GC Transpiler: Run Java in the Browser, ... by pjmlp on Sunday December 15, 2024 @04:16AM (#42422469)
Bring Java Applets back would be one.
Re:New Java to WASM GC Transpiler: Run Java in the Browser, ... by palmfacehn on Sunday December 15, 2024 @04:31AM (#42422517)
JS frontend enthusiasts rationalized JS on the backend. Now Java backend enthusiasts can once again rationalize Java on the frontend.

I would consider this for a project where I already have Java code on the backend and rewriting it for the front end in JS is a bigger barrier than adding TeaVM to the stack.

Re:New Java to WASM GC Transpiler: Run Java in the Browser, ... by skerit on Sunday December 15, 2024 @04:34AM (#42422525)
I'm actually in the process of converting my own little JS framework to Java using TeaVM. It's interesting and fun
Re:New Java to WASM GC Transpiler: Run Java in the Browser, ... by ffsm8 on Sunday December 15, 2024 @08:46AM (#42423346)
Aren't ppl like that are more likely to use vaadin and similar frameworks?
Re:New Java to WASM GC Transpiler: Run Java in the Browser, ... by TeaVMFan on Sunday December 15, 2024 @10:38AM (#42423976)
Vaadin has a restrictive, commercial license.

By contrast, TeaVM is Apache-licensed, available for commercial use without any gotchas, limits, or entanglements.

Re:New Java to WASM GC Transpiler: Run Java in the Browser, ... by konsoletyper on Sunday December 15, 2024 @04:38AM (#42422538)
TeaVM author here. Personally I use it to bring a large (500KLOC) project that's written in Java and Kotlin to the browser (also we are using Graal VM Native Image to compile the same app to iOS, and Android supports). It's virtually impossible to maintain another 500KLOC code base on TS and on Swift and make sure that they behave and look 100% same. So the target audience is any team that wants to write in Java and/or Kotlin applications that works in JVM as well as in the browser.
Re:New Java to WASM GC Transpiler: Run Java in the Browser, ... by emmanueloga_ on Sunday December 15, 2024 @04:46AM (#42422574)
* Grab A, some software that can be compiled to Java bytecode [1].

* Grab B, some software that can run wasm [2].

* Run A on B.

Just one example, since this "algorithm" can generate endless combinations! You could create some game logic in Kotlin, Clojure or Scala, compile it to WASM, and run it on Taca [3] (a runtime for multimedia wasm apps that runs native and in browsers).

--

1: from TeaVM front page: "the source code is not required to be Java, so TeaVM successfully compiles Kotlin and Scala"

2: There are many projects out there embedding some WASM runtime, not just browsers.

3: https://github.com/contextfreeinfo/taca

Re:New Java to WASM GC Transpiler: Run Java in the Browser, ... by fulafel on Sunday December 15, 2024 @05:05AM (#42422621)
If OpenAI some day wants to add support for languages like Clojure, Scala, etc, they could use this.

(For the Python version see https://simonwillison.net/2024/Dec/10/chatgpt-canvas/)

Re:New Java to WASM GC Transpiler: Run Java in the Browser, ... by TeaVMFan on Sunday December 15, 2024 @10:36AM (#42423960)
Here are over a dozen TeaVM-based projects, for inspiration: https://www.frequal.com/TeaVM/TeaVmBasedSites.html

Several use cases where TeaVM shines:

* A developer or team has strong Java skills and wants to develop single-page apps

* A Java desktop project wants to move to the web and has lots of validation logic they don't want to double-maintain in Java and ECMAScript/WASM

* A Java-based game developer wants to make a Canvas-based version of their game for the web (potentially full-screen)

* A Java developer wants a batteries-included framework for web development. TeaVM comes with a minifier, tree-shaker, packager, and more, out of the box, with familiar 'mvn clean install' semantics (And Gradle support too).

For more details on use cases and reasons for picking TeaVM, read chapter 1 of my book here: https://frequal.com/Flavour/book.html