Live data from Hacker News

CheerpJ 3.0: a JVM replacement in HTML5 and WASM to run Java on modern browsers

leaningtech.com

81–90 of 179 posts

Re: CheerpJ 3.0: a JVM replacement in HTML5 and WASM to run Java on modern browsers

#83
post #75
post #52

Earlier quoted context omitted.

Direct ByteBuffers are used to interop with the underlying platform, particularly for the purpose of IO. I could be wrong, but I fail to see how 'WASM memory direct Buffers' will work in that scenario.

Why don't you just try? It seems to work fine: https://javafiddle.leaningtech.com/#JYWwDg9gTgLgBAKwIYDckDoB...

I did, as I said, those are likely 'Virtual WASM Direct Buffers' which are not really 'Direct (Memory) Buffers' - and therefore, not really what they are meant for, though it's impossible to tell.

Given how WASM works, I'm pretty sure (but not certain) that anything that uses nio to interface to anything else is not going to work, other than maybe things which are 'fully contained'. The 'test' would be to dynamically load a lib/dll and see if the references are valid, which I doubt, firstly that'd imply that native dll/libs are possible, which I also doubt.

These ports generally don't work 'as expected' the whole endeavour is about identifying the parts that work differently, and if/how to work around them or live within the constraints.

Re: CheerpJ 3.0: a JVM replacement in HTML5 and WASM to run Java on modern browsers

#84
post #72

Related, if you like Java but want to create a modern, Lighthouse-ready web app, check out Flavour: https://flavour.sourceforge.io/

What is Lighthouse in this context?

The web benchmark created by Google?

Re: CheerpJ 3.0: a JVM replacement in HTML5 and WASM to run Java on modern browsers

#85

Is there any plan to implement accessibility, e.g. for screen reader users, in CheerpJ's implementation of Swing?

Is there a single site using this and swing?

CheerpJ is being sold as a commercial product, specifically for running the kind of line-of-business application that people need to be able to use to do their job. So it seems like a question worth asking.

Re: CheerpJ 3.0: a JVM replacement in HTML5 and WASM to run Java on modern browsers

#86

A JVM in the browser wouldn't be so bad these days, since we have things like same-origin policies and sandboxing. Something like it could only run headless, had no AWT/Swing, and had an API to manipulate DOM and bindings to JS.

WASM runtime is so much better because it's a polyglot standard so close to a real CPU.

Re: CheerpJ 3.0: a JVM replacement in HTML5 and WASM to run Java on modern browsers

#87
post #77

If only we could get a new version of Java for the browser. Something more of a scripting language that is not compiled but interpreted. Could probably knock out a proof of concept in a week, might call it Javascript or something... In all seriousness, anything that spits out canvas for a simple textbox is completely misguided about what the web is.

> In all seriousness, anything that spits out canvas for a simple textbox is completely misguided about what the web is. I suspect the goal is a way to bring Java desktop applications into the browser without rewriting the application from scratch. Personally, as a fan of Blazor, I thought this was going to be a Java-based analog of Blazor; or a modernized replacement for GWT. (One flavor of Blazor compiles C# to WAS…

>as a fan of Blazor

I really dislike this stuff. It's easy-ish to write, but it's like the authors of it hate everything about the web.

SPAs do a lot of annoying stuff, and blazor encourages all of it.

I really hope things swing back away from this grotesque tight binding between the server and the client.

Re: CheerpJ 3.0: a JVM replacement in HTML5 and WASM to run Java on modern browsers

#88
post #68

Amusingly, there were two different ways of running Java in the browser when it came out in the late 90s. One was Applet style where Java takes over a part of the canvas of the page and has to implement everything, like Flash or ActiveX. The other was headless and you had access to the DOM. Why no one built interesting applications with the latter is beyond me. https://docs.oracle.com/javase/tutorial/deployment/apple…

>The other was headless and you had access to the DOM. Why no one built interesting applications with the latter is beyond me. Frameworks, HTML5 or even DHTML/AJAX didn't exist at the time. If you were already paying the cost of invoking Java/Flash/ActiveX, why would you access the DOM and pay extra rendering price - for an interface suited for documents, not applications?

You could have built DHTML/AJAX though just powered by Java code. SPAs could have been built then.

Edit: Repliers live in an alternate reality where good applets were made and HTML didn't win.

Re: CheerpJ 3.0: a JVM replacement in HTML5 and WASM to run Java on modern browsers

#89

With this and Ruffle, we will soon return to the days of Internet Explorer 6 but with 4k monitors! All we need now is to run ActiveX. I think BottledWine can run Windows executables in the browser, how hard would it be to simulate the ActiveX bindings?

THE SYSTEM. IS DOWN. THE SYSTEM. IS DOWN.

Re: CheerpJ 3.0: a JVM replacement in HTML5 and WASM to run Java on modern browsers

#90
post #68

Earlier quoted context omitted.

>The other was headless and you had access to the DOM. Why no one built interesting applications with the latter is beyond me. Frameworks, HTML5 or even DHTML/AJAX didn't exist at the time. If you were already paying the cost of invoking Java/Flash/ActiveX, why would you access the DOM and pay extra rendering price - for an interface suited for documents, not applications?

You could have built DHTML/AJAX though just powered by Java code. SPAs could have been built then. Edit: Repliers live in an alternate reality where good applets were made and HTML didn't win.

Am I imagining it, or did someone do exactly that but with an invisible Flash component at one point?
Post reply on HN