Live data from Hacker News

Applets are officially gone, but Java in the browser is better

frequal.com

51–60 of 101 posts

Re: Applets are officially gone, but Java in the browser is better

#51
post #38
post #35

Earlier quoted context omitted.

The JVM proved to the mainstream that a virtual machine good be as fast (sometimes even faster) than a compiled binary. Because of that it took a lot of the market share of C/C++ in the 90s. You got a buffer overflow safe language without compromise of speed. After it has been loaded, of course. But that's why Java had such a tremendous effect in Web services where the load times are negligible to the run time.

Of course, eliminating buffer overflows is orthogonal to using a virtual machine.

No, it's not? Using a VM is one way of preventing buffer overflows, it's not orthogonal.

Re: Applets are officially gone, but Java in the browser is better

#52
post #34

Earlier quoted context omitted.

I understand the sarcasm but this take is devoid of fact. Modern Java loads fast, Java 21 has pretty good functional programming featurez. The ecosystem churns out language level features at a pace and a budget that would put most large funded startups to shame. Java is also the workhorse of the big data ecosystem and moves enough money either as product revenue or as transactions than most nations GDP. They didn't f…

Mostly agreed that Java, warts and all, has gotten better, and will stick around. It's the new COBOL, for better or worse. (I still wouldn't want to use it voluntarily, but if someone pays me enough money, sure.) However: > Java is also the workhorse of the big data ecosystem and moves enough money either as product revenue or as transactions than most nations GDP. The global financial system moves so much money arou…

> The global financial system moves so much money around that comparisons to GDP are a bit silly.

Agreed. I guess its comparing production capacity to distribution capacity. Distribution capacity will equal n_tx * tx_amt. Having said that, another metric to look at is how much of software infrastructure is built on Java. Simply adding AWS to this equation proves the value added by Java backed systems. Hard to say that about any other langauge. Also we can look at versatility, Java is used to write very large data processing systems, CDN networks, API servers and even widely used consumer apps (IntelliJ products). Its very hard to find any other language that has had an outsized impact across domains. Of course the counter being Linux written on C powers all of the internet. True but C doesnt have the cross domain impact that Java has had.

So I disagree with the assessment that Java is a terrible langauge performance or productivity wise or it wouldnt have had this impact.

Re: Applets are officially gone, but Java in the browser is better

#53
post #17

Earlier quoted context omitted.

ActiveX was hell for security.

ActiveX was its own special kind of terrible for many reasons, but so were Java, Flash, and Silverlight. At least ActiveX didn't hide the fact you were about to grant arbitrary code execution to a website, because you might as well have assumed that the second these plugins were loaded. The only advantage to Java applets I can think of is that they had the advantage of freezing the browser so it could no longer be ha…

In my experience, most of the more important Java-on-the-web stuff was Java Web Start as opposed to applets. And Java Web Start was all kinds of bad. About the only remotely good thing I could say is that it has a sandbox. Which protected no one from anything, by design, because it was the app’s choice whether to use it. And Web Start apps also often included native code, too, so they weren’t even portable.

Re: Applets are officially gone, but Java in the browser is better

#54

Earlier quoted context omitted.

I understand the sarcasm but this take is devoid of fact. Modern Java loads fast, Java 21 has pretty good functional programming featurez. The ecosystem churns out language level features at a pace and a budget that would put most large funded startups to shame. Java is also the workhorse of the big data ecosystem and moves enough money either as product revenue or as transactions than most nations GDP. They didn't f…

There's zero sarcasm in my comment. The JVM is quite different from Java language features or Scala language features. I've written entire programs in JVM bytecode, without a compiler, and I see very little of value in it. A stack based machine? Why? Not a huge blocker, it's weird, but usable. The poor engineering around the JVM for many use cases? That's a blocker for me, and where are the alternatives in implementa…

> I remember a few decades ago somebody saying the JVM was incredible technology, and as a user and programmer I still have zero clue what the hell they could have been thinking was good about the JVM.

I see what you mean. In that case we can add Scala backed systems as well to the JVM balance sheet. If we simply look at the JVM and the systems it backs, there's very little evidence that it isnt a marvel of technology. It powers more impactful systems than few other technologies.

Re: Applets are officially gone, but Java in the browser is better

#55

Compose multiplatform is the spiritual successor to JVM in the browser. Compiles to wasm, modern api, great developer experience. It's kotlin so not java, but easy for java developers to learn.

> great developer experience

Compared to Java, maybe.

It is a far cry from modern frontend development with vite.

Re: Applets are officially gone, but Java in the browser is better

#56

Earlier quoted context omitted.

There's zero sarcasm in my comment. The JVM is quite different from Java language features or Scala language features. I've written entire programs in JVM bytecode, without a compiler, and I see very little of value in it. A stack based machine? Why? Not a huge blocker, it's weird, but usable. The poor engineering around the JVM for many use cases? That's a blocker for me, and where are the alternatives in implementa…

> A stack based machine? Why? The JVM being a stack-machine is probably the least controversial thing about it. Wasm, CPython and Emacs all also have a stack-based bytecode language. The value, of course, comes from having a generic machine that you can then compile down into whatever machine code you want. Having a register machine doesn't seem very useful, as it's completely unnecessary for the front-end compiler t…

> Having a register machine doesn't seem very useful...

Requires fewer instructions, so potentially faster evaluation, which is good for short-lived programs that ends before the JIT kicks in.

Stack machines requires less space per instruction, however, which reduces the size of the program (faster to load).

Re: Applets are officially gone, but Java in the browser is better

#57

Earlier quoted context omitted.

ActiveX was its own special kind of terrible for many reasons, but so were Java, Flash, and Silverlight. At least ActiveX didn't hide the fact you were about to grant arbitrary code execution to a website, because you might as well have assumed that the second these plugins were loaded. The only advantage to Java applets I can think of is that they had the advantage of freezing the browser so it could no longer be ha…

Flash is still a big loss imho, the ecosystem of games, movies and demonstration thingies was amazing and they were accessible to create by many. Unlike Java applets that slowed the main browser UI thread to a crawl if they didn't load they usually didn't), Flash didn't have such slowdowns. One exception is early 2000s Runescape: that was Java in browser but always loaded, no gray screen and hanging browser. They kne…

Many of the old games and movies still play back well with Ruffle installed (https://ruffle.rs/). Newgrounds embeds it by default for old interactive flash media that they couldn't convert directly to video.

It's not a perfect fit, but it works. The speed of Ruffle loading on a page is similar to that of Flash initializing, so you can arguably still make flash websites and animations to get the old look and feel if you stick to the Ruffle compatibility range. The half-to-one-second page freeze that was the norm now feels wrong, though, so maybe it's not the best idea to put Flash components everywhere like we used to do.

Runescape proved that Java could be a pretty decent system, but so many inexperienced/bad Java developers killed the ecosystem. The same is true on the backend, where Java still suffers from the reputation the Java 7 monolithic mega projects left behind.

Re: Applets are officially gone, but Java in the browser is better

#58
post #53

Earlier quoted context omitted.

ActiveX was its own special kind of terrible for many reasons, but so were Java, Flash, and Silverlight. At least ActiveX didn't hide the fact you were about to grant arbitrary code execution to a website, because you might as well have assumed that the second these plugins were loaded. The only advantage to Java applets I can think of is that they had the advantage of freezing the browser so it could no longer be ha…

In my experience, most of the more important Java-on-the-web stuff was Java Web Start as opposed to applets. And Java Web Start was all kinds of bad. About the only remotely good thing I could say is that it has a sandbox. Which protected no one from anything, by design, because it was the app’s choice whether to use it. And Web Start apps also often included native code, too, so they weren’t even portable.

So much JWS PTSD. Industrial automation got a giant dose of it and those things somehow weren’t even portable to different versions of internet explorer.

Re: Applets are officially gone, but Java in the browser is better

#59
post #42

Earlier quoted context omitted.

The article literally links to a frontend that does just that, run the JVM on top of WASM. It performs fine: https://teavm.org/gallery.html I'm not sure if I'd use it for a website or anything, but if my goal was to embed a simulation or complex widget, I wouldn't ignore it as an option.

It doesn't run the JVM. It's an ahead-of-time compiler that converts Java bytecode to wasm.

Oh, if you want a full fat JVM, then you want CheerpJ https://cheerpjdemos.leaningtech.com/SwingDemo.html#demo

Takes a few seconds longer to load because it loads all of Java Spring, but it still performs just fine on my phone (though the lack of on screen keyboard activation makes it rather unfortunate for use in modern web apps).

Re: Applets are officially gone, but Java in the browser is better

#60
+1 TeaVM is crazily good. Comparing to GWT it has faster build time and better exports to javascript. I've built so many games using libGDX + TeaVM and quite happy with the workflow and results.

Here's one of many: https://ookigame.com/game/flappy-bug/

Post reply on HN