Live data from Hacker News

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

frequal.com

41–50 of 101 posts

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

#41
post #4

Not sure if I get this: WASM lets you use any language in the browser, though it still works way better with languages without GC, such as Rust or a transpiling C engine. Java is unlikely to be the best choice. In the era of LLM assistants like Claude Code, any engineer can write frontend code using popular stacks like React and TypeScript. This use case is when those tools shine.

Java running in the browser is unlikely as typescript has largely tamed the mess of Javascript. Java requires a JVM and shipping an entire JVM so its runs atop another VM is kinda redundant. Except if JVM itself gets compiled and cached as a WASM bundle and Java compilers start accept WASM-JVM as a target. That will just be distraction tbh, Java has its strength in large scale systems and it should just focus on thos…

> That will just be distraction tbh, Java has its strength in large scale systems and it should just focus on those rather than get caught up in Frontend's messy world.

Multiple people can work on different things in the Java ecosystem.

Compiling Rust to WASM doesn't really distract anyone from compiling Rust to x86 or ARM, either.

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

#42

Earlier quoted context omitted.

Java running in the browser is unlikely as typescript has largely tamed the mess of Javascript. Java requires a JVM and shipping an entire JVM so its runs atop another VM is kinda redundant. Except if JVM itself gets compiled and cached as a WASM bundle and Java compilers start accept WASM-JVM as a target. That will just be distraction tbh, Java has its strength in large scale systems and it should just focus on thos…

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.

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

#43
post #40

Wouldn't it make more sense to run/emulate JVM bytecode on WASM instead of compiling Java to WASM? It seems like that'd be a much easier task. From a high level WASM and JVM byte code seems incredibly similar (though I'm sure the containerizing and IO are radically different). I never really understood why WASM wasn't some JVM subset/extension. Not an expert at all in this, so genuinely curious to hear from someone w…

From my understanding, this works for C# but is an ill-fit for Java. Java has simple bytecode with a powerful runtime to ensure all kinds of guarantees. C# focuses on compile-time checks with a more complex bytecode representation.

So instead you got TeaVM which is essentially a whole JVM in WASM.

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

#44

The only thing worse than launching the JVM from the command line, with it's looooooooooooong and inexplicable load time, was hitting a web page and having it lock the browser for that amount of load time. 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 hear that no…

So your lack of technical knowledge or curiosity means Java wasn't incredible? That's certainly... a take. I'm almost curious: why did you end up holding strong beliefs like these, instead of actually investigating? As a curious person, when I hear something I don't know I like to learn - not just dismiss it. FYI, your .jar complaint is almost a decade out of date.

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

#45
post #26
post #5

Earlier quoted context omitted.

Exactly. Java was so buggy and had so many security issues about 20 years ago that my local authorities gave a security advisory to not install it at all in end user/home computers. That finally forced the hand of some banks to stop using it for online banking apps. Flash also had a long run of security issues.

> banks to stop using it for online banking apps I never understood why so many banks flocked to building their online banking in applets when it wasn't like you needed anything more advanced than HTML to view balances and make transactions.

Because they’ve hired a bunch of Java devs that don’t know anything outside of Java?

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

#46

> In the 2000's, politics interfered and browser vendors removed plug-in support, instead preferring their own walled gardens and restricted sandboxes That's one way to say it. The more common way was that users got tired of crappy plugins crashing their browsers, and browser devs got tired of endless complaints from their users. It wasn't "politics" of any sort that made browsers sandbox everything. It was the insan…

Applets also had no view-source. Spiritually the web ought to be more than an application development platform. We haven't been doing great about that (with heavily compiled js bundles), but there's still a lot of extensions that many users take for granted. I'm using a continual wordcount extension (50 words so far), and Dark Reader right now. Applet's are the native app paradigm, where what the app-makers writes is…

Don’t worry, they’re trying to sneak back in with WASM and drawing everything to canvas.

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

#47
post #12

Earlier quoted context omitted.

Yeah, a totally mind boggling statement, almost completely void of reality. I wasn't even tired of the crashes, it was just a totally awful experience of using them in every way. They took forever to load, were clunky to use and even just downright ugly because the UI had nothing to do with what you usually got to use, and was a lot worse. The idea was good on paper, but the implementation sucked. Everyone, well almo…

Even Flash wasn't as bad as Java applets, and that's saying something.

Flash was great when it came to experiences. Ignoring melting CPU, crashes, loading times.

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

#48
post #5

> In the 2000's, politics interfered and browser vendors removed plug-in support, instead preferring their own walled gardens and restricted sandboxes That's one way to say it. The more common way was that users got tired of crappy plugins crashing their browsers, and browser devs got tired of endless complaints from their users. It wasn't "politics" of any sort that made browsers sandbox everything. It was the insan…

Exactly. Java was so buggy and had so many security issues about 20 years ago that my local authorities gave a security advisory to not install it at all in end user/home computers. That finally forced the hand of some banks to stop using it for online banking apps. Flash also had a long run of security issues.

I worked for a large financial institution in the early 2010s.

They ran Windows XP, IE 8, and they stuck with a 3-4 year old JRE to support one piece of shit line of business app that was used only by about 100 (out of 50,000) users internally.

That institution had endpoints popped by drive-by exploit kits dropping banking trojans like Zeus daily.

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

#49

> In the 2000's, politics interfered and browser vendors removed plug-in support, instead preferring their own walled gardens and restricted sandboxes That's one way to say it. The more common way was that users got tired of crappy plugins crashing their browsers, and browser devs got tired of endless complaints from their users. It wasn't "politics" of any sort that made browsers sandbox everything. It was the insan…

It mostly was politics. Browser crashes and slowness were almost always traced down to microsoft own java plugin that strongarmed proper java plugin install out of the way every update and every now and then to be sure, with a semi compatible runtime and a classloarlder that insisted fronting the dow load of all resources.

It created so much uncertainty across the ecosystem even today people repeat the "applet crashes browser line, god riddance" line

But it was deliberate action by microsoft.

So yeah 100% politics because without a court document in modern society we cannot call this anything else.

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

#50

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…

> 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 to minimize register usage (the backend compiler will do that for you).

Specifying classpath isn't fun, I agree with that. Launch performance isn't good, and is generally a consequence of its high degree of dynamicism and JIT compiler, though of course there are ways around that (Leyden).

> I've written entire programs in JVM bytecode, without a compiler, and I see very little of value in it

I agree, I also see very little value in manually writing JVM bytecode programs. However, compiling into the JVM classfile format? Pretty darn useful.

Post reply on HN