Live data from Hacker News

Java in the Browser

jpro.one

91–100 of 113 posts

Re: Java in the Browser

#91

Some notes from the developing company: First of all, sorry for the bad performance in the first hours after this post. The server isn't setup up for a big traffic peak. It was way higher than we are used to. To improve the performance, we increased the memory. Many of our demos represent heavy business applications. Especially the "FlexGanttFX Demo" is a good example. With JPro the Application itself runs "logically…

Is it like Eclipse RAP, just for Java FX? How does it compare to Gluon?

Re: Java in the Browser

#93

Earlier quoted context omitted.

What's so bad about server rendering

- higher latency - uses more server resources per-client, therefore it's more expensive - harder to do SPA-like apps

- waiting for javascript to load is not considered latency but kills user experience

- depends how you do it

- not all apps need to be SPA but also you can render fragments if you really want

Re: Java in the Browser

#94

Earlier quoted context omitted.

Soda Constructor? Yeah, that was a fun one. Here's a decent JS clone for some nostalgia: http://panoramx.ift.uni.wroc.pl/~maq/lovesoda/0.36beta.html

Huh, I once made a workshop where people used evolutionary algorithms to make a similar shape learn to walk (see gif on top here https://github.com/Matsemann/walkingea ).

There is a paper on two-legged animals learning different methods of walking: https://youtu.be/pgaEE27nsQw (or https://youtu.be/FahK9srJq10 for the slightly better known "music video" version).

Soda Constructor's wikipedia page also links to a 3D applet named "Springs World 3D", I was playing with that one back in the day.

Re: Java in the Browser

#95

Anyone remember that Java applet in the nineties where there was some 2D wireframe "animal" moving in a rectangle and there was, IIRC, a tiny circle at each joint and you grab it and move it and it'd move the thing around / distort it. It was the first "serious" Java in the Browser I remember. It was all black & white. Maybe some HNer (not an HNer back then obviously) wrote it back in the days?

Back in college I had an assignment to build some kind of CRM-like system, and the professor made a point that we used Java applets, because that was the future ( https://en.wikipedia.org/wiki/Write_once,_run_anywhere was all the rage). I proposed instead learning PHP and using it for that purpose, but was laughed out of the room. Developing this was a PITA and I feel vindicated that applets faded away soon after, an…

I remember when nytimes.com started using java like this, and something like 8 out of 10 failed to function in Firefox on Linux.

Re: Java in the Browser

#96

Actual Java in the browser (working, fast, passes Lighthouse) with TeaVM: https://blogs.oracle.com/javamagazine/post/java-in-the-brows... For example, try this 5-letter word game: https://frequal.com/wordii/

Nice username :) It looks like TeaVm is still setting steady releases? It’s certainly bucking industry trends, which concerns me about maintenance.

Yes, TeaVM is still actively maintained by the original author (and contributors). Java 17 record support was recently implemented, for example.

TeaVM is coming up on 10 years, so it has proven its longevity.

Re: Java in the Browser

#97
post #22
post #18

I do not know. .NET created with Blazor a modern Applet tech stack based on WebAssembly and HTML. Would not Java be able to do the same and just port the applet API onto a Canvas? Would not that reactivate a whole existing ecosystem?

Java solutions for JS and WebAssembly as targets are older than Blazor actually, see TeaVM and CheerpJ, and then there was GWT alongside Vaadin.

Yes, TeaVM predates Blazor and still has the edge on most fronts:

https://frequal.com/java/TeaVmVsBlazorWasm1-0.html

Comparison Chart: https://frequal.com/java/TeaVmVsBlazorChart.html

Re: Java in the Browser

#98

Interesting. Runs app on the server, does final rendering of the UI's scene graph on the client (within the browser). It's not clear from skim reading if the client side rendering is implemented with the DOM or a canvas element. I've always thought it'd be hysterical to use canvas. The whole browser just to hoist a client side frame buffer. X-Windows reinvented. FWIW, JavaFX is so close to The Correct Answer™. Defini…

The canvas is a powerful tool, especially if you do a lot of graphical work. Rendering the entire UI yourself, gives you complete freedom of layout management. Plus, you avoid any DOM manipulation, directly or through a myriad of JavaScript frameworks. Remember: there is no silver bullet. Example: https://www.isochart.com

Using canvas for fast visualizations is good! As you say, it's fast, you have layout management, and lower-level control of how things load and paint.

Using canvas for the entire UI...is not good. You have to reinvent _everything_, poorly. You have no accessibility support. Text selection doesn't exist, things look and behave kind of "off" from what people expect.

All that so you can avoid spending a few hours learning some CSS? Not sure it's worth it.

Re: Java in the Browser

#99

Earlier quoted context omitted.

The canvas is a powerful tool, especially if you do a lot of graphical work. Rendering the entire UI yourself, gives you complete freedom of layout management. Plus, you avoid any DOM manipulation, directly or through a myriad of JavaScript frameworks. Remember: there is no silver bullet. Example: https://www.isochart.com

Using canvas for fast visualizations is good! As you say, it's fast, you have layout management, and lower-level control of how things load and paint. Using canvas for the entire UI...is not good. You have to reinvent _everything_, poorly. You have no accessibility support. Text selection doesn't exist, things look and behave kind of "off" from what people expect. All that so you can avoid spending a few hours learni…

You really need a good reason to choose a non native language (e.g. not JavaScript for the Browser). One reason might be that you target other platforms too (cross-platform). In that case, you are outside of the browser anyway and you need to come up with solutions to these problems. Implementing those in a consistent way across all platforms for your product is not generally a bad idea. The alternative is an inconsistent but native UX for each platform.

Re: Java in the Browser

#100
post #34

I have looked around the website and I really have no idea what this is. I feel their marketing and doc could do with a bit more explanation if it's intended for devs. Is it like applets in that there is a runtime in the browser? Or more like GWT which compiles Java to Javascript? Also, the website which is apparently created with the technology, is incredibly slow, at least for me. And the website doesn't give usefu…

From elsewhere (site is down for me): > jpro is a new technology which brings Java back into the browser — without Java Plugin. To achieve that, jpro runs JavaFX on the server and maps its scenegraph directly into the browser. JavaFX is the most recent of the standard GUI libraries for Java. Seems like the Java all runs server-side, but it is effectively using a display device which is "send draw commands via a webso…

A Swing version of the same idea: https://jetbrains.github.io/projector-client/mkdocs/latest/
Post reply on HN