Live data from Hacker News

Show HN: 300k lines of Java UI code running as JavaScript in browser

reportmill.com

11–20 of 75 posts

Re: Show HN: 300k lines of Java UI code running as JavaScript in browser

#11
post #8

Appears the tech behind this "cheerpj" a java transpiled to javascript[1] system that appears to contain all of openjdk including swing(!?!). That's kind of cool actually. But creating applications with such a system seems highly problematic. See for example GWT (google web toolkit)[2] which also transpiled java to javascript. I only see legacy GWT apps around nowadays, the world moved on. So I really don't see the a…

What about a program that uses a ton of Java libraries?

Re: Show HN: 300k lines of Java UI code running as JavaScript in browser

#13
post #2

This is… actually not bad. :shocked:

Uhh... It seems very bad. I clicked "Run RMStudio DOM" in Chrome. It loaded dozens of java packages for half a minute, and then showed me a 90s looking splash screen with three buttons on it. None of them do anything. I'm assuming I'm supposed to be seeing something else. Edit: I tried "Run RMStudio Swing". That one actually loads eventually. I don't understand what kind of app it is, but it appears to leak DOM eleme…

That's the not bad part! Half a minute for a Java app to load is twice as good as most. And it loads in your browser.

Can you do the same thing to eclipse? That is still widely used despite how long it takes to load and how "90's the UI looks"

Re: Show HN: 300k lines of Java UI code running as JavaScript in browser

#14
post #8

Appears the tech behind this "cheerpj" a java transpiled to javascript[1] system that appears to contain all of openjdk including swing(!?!). That's kind of cool actually. But creating applications with such a system seems highly problematic. See for example GWT (google web toolkit)[2] which also transpiled java to javascript. I only see legacy GWT apps around nowadays, the world moved on. So I really don't see the a…

They also have something called Cheerp, which is an Emscripten-like C++ to JS compiler based on LLVM: https://www.leaningtech.com/cheerp/

Re: Show HN: 300k lines of Java UI code running as JavaScript in browser

#15
post #2

This is… actually not bad. :shocked:

Yes. Yes it is.

I mean as a technical feat it's impressive (in the same way as running Linux in the browser via JavaScript [0]).

At the same time I'm horrified that someone would seriously do it (though I can understand the business reasons for wanting to do so).

0: https://bellard.org/jslinux/

Re: Show HN: 300k lines of Java UI code running as JavaScript in browser

#16
This is really nifty as a proof of concept, major kudos to the authors. However, it completely kills accessibility, so it's probably best to avoid for any serious projects.

I've gotta ask, since I've never used Java applets... Wasn't this already possible back in 1995? Have we come full circle?

Re: Show HN: 300k lines of Java UI code running as JavaScript in browser

#17
post #12

runs on my iphone, but text input doesn't seem to trigger the appearance of the keyboard. Other than that, it's pretty impressive.

Even on a browser, not taking in inputs, until I realised I needed to press on the "A" to insert text. So probably just a UX thing...

Re: Show HN: 300k lines of Java UI code running as JavaScript in browser

#18
post #8

Appears the tech behind this "cheerpj" a java transpiled to javascript[1] system that appears to contain all of openjdk including swing(!?!). That's kind of cool actually. But creating applications with such a system seems highly problematic. See for example GWT (google web toolkit)[2] which also transpiled java to javascript. I only see legacy GWT apps around nowadays, the world moved on. So I really don't see the a…

This is impressive! Are they using WebAssembly here?

Re: Show HN: 300k lines of Java UI code running as JavaScript in browser

#19

This is really nifty as a proof of concept, major kudos to the authors. However, it completely kills accessibility, so it's probably best to avoid for any serious projects. I've gotta ask, since I've never used Java applets... Wasn't this already possible back in 1995? Have we come full circle?

Yes, around 1996-97 there was a lot of hype around desktop applications delivered as applets. E.g. Corel Office for Java:

http://www.edm2.com/index.php/Corel_Office_for_Java

Re: Show HN: 300k lines of Java UI code running as JavaScript in browser

#20

This is really nifty as a proof of concept, major kudos to the authors. However, it completely kills accessibility, so it's probably best to avoid for any serious projects. I've gotta ask, since I've never used Java applets... Wasn't this already possible back in 1995? Have we come full circle?

It was possible, but there were issues with performance, compatibility, security and configuration. Everyone had a different version of the Java plugin implemented with different platform Look-And-Feels (if you had the plugin at all). And then the browser vendors went to war against plugins.

CheerpJ is a much better approach - doesn't require a separate plugin, doesn't have version problems, has inherent JS-sandbox security, uses the same look-and-feel and performs great (after initial download).

For a large project, it's nice to have all the benefits of desktop development with a strongly typed language, but still have the ability to publish to the browser.

Post reply on HN