News for hackers. Stuff that matters.
Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by grzm on Thursday January 04, 2018 @11:45PM (#16076618)
You don't need to have Java enabled in your browser.
Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by dizon on Friday January 05, 2018 @12:02AM (#16076677)
The problem with that is you'll essentially re-download the entire JVM (and libraries) on each page load. If you don't want to use a Java applet, you would need to reimplement GC, JNI, and so on. Java didn't work on the web for a reason.
Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by hrjet on Friday January 05, 2018 @12:12AM (#16076716)
GC should be available in WASM in the future. And, not all applets needed JNI.

In other words, this is enabling a subset of well behaved applets, while excluding the naughty (or advanced) applets.

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by konsoletyper on Friday January 05, 2018 @10:27AM (#16079134)
GC is only about 300 lines of code. There's no JNI in TeaVM (and never will be), instead of JNI there's JSO to interact with JavaScript, and still no interop layer for WebAssembly (that's why I claim WASM support to be experimental). JSO is rather lightweight, and I hope I'll be able to implement a lightweigh interop for WASM.

As for Java libraries, TeaVM is able to throw away unused parts of it, producing relatively small binaries.

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by merb on Friday January 05, 2018 @07:51AM (#16078249)
> The problem with that is you'll essentially re-download the entire JVM (and libraries) on each page load.

I always here these arguments, but if you develop an angular application and somehow can't turn on AoT you need to download a ton of stuff, too. Also it's way easier to make use of dead-code elimination on java than on javascript (especially without reflective code)

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by C14L on Friday January 05, 2018 @03:30AM (#16077357)
The browser would cache that automatically. And in many cases, you'd probably use a Service Worker to implement your own custom cache and "install" the application locally in the browser, so that is usable offline and only version updates are downloaded in the background.
Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by oblio on Friday January 05, 2018 @03:50AM (#16077426)
Weren't applets also cached?

To be honest, I think that hate of applets comes from a time when 56kbps download speeds were considered very high, the average CPU had 1 core at 200 Mhz and the average webpage weighed 20k and executed 5-10 lines of Javascript.

I haven't used applets in the time, but if the user experience would be improved (nice looking UI, respecting modern UX conventions, etc.), I imagine your average applet from circa 1999 would run circles around Gmail, for example :)

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by mping on Friday January 05, 2018 @04:48AM (#16077617)
Not only that, swing applets are notoriously fugly. One reason electron is successful is because it kinda looks like native. Swing Look and Feels all seem alien.
Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by oblio on Friday January 05, 2018 @04:58AM (#16077668)
Swing can be styled, it's that not a lot of people really bothered. Jetbrains products use Swing and they're decent.

Not amazing, but decent.

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by fulafel on Friday January 05, 2018 @02:03AM (#16077080)
The JVM can be very small. The libraries shouldn't be any worse than with current JS.

The browser won't have to re-download on each page load because the browser has a cache, which can be validated on each page load to check for updates.

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by jayd16 on Friday January 05, 2018 @01:37AM (#16076997)
Caching exists. You hsouldn't have to redownload the same libraries for each page load.