That's technically pretty cool, but it makes me wonder:
In order to run a Java Desktop app, I need to install a JVM first (or the Desktop app can embed it, I guess that's what IntelliJ does, right?).
Now if I run CheerpJ, it means that I essentially download a JVM when I load the page (every time), and run code in that JVM. But at this point, why not downloading a Desktop app?
It feels like we are going around, shipping simple web pages together with full browsers and calling that "desktop apps" (e.g. ElectronJS), then shipping complete JVMs as web pages and calling that a "web page"... why don't we just ship simple webpages through browsers and complex desktop apps through package managers?
apignotti•5h ago
With CheerpJ you are downloading the subset of the JVM that you need, and actually only once thanks to the standard browser cache.
There are many reasons why shipping via the browser is a better choice compared to shipping desktop apps. The main 3 in my opinion are:
1. Distribution: Give your user a link and the app will start
2. Isolation: The user can have confidence the app won't read his personal files.
3. Cross-platform: Every OS and every device, for real this time
yuri91•4h ago
For reference, when loading https://browsercraft.cheerpj.com for the first time (up to loading a world), my browser downloaded ~32MB.
The second time almost nothing.
jeffreportmill1•4h ago
And here's an entire Java IDE with CheerpJ that downloads less than 15mb:
> With CheerpJ you are downloading the subset of the JVM that you need
That's interesting! May I ask how it works? Does that also happen with e.g. IntelliJ?
> Every OS and every device, for real this time
Doesn't the JVM run everywhere in 2025?
apignotti•4h ago
> That's interesting! May I ask how it works? Does that also happen with e.g. IntelliJ?
Byte ranges request do most of the heavy lifting, data is loading exclusively on-demand.
> Doesn't the JVM run everywhere in 2025?
What about iOS? Android has Java, but can't run desktop Java apps. Chromebooks also have limits.
palata•24m ago
> Byte ranges request do most of the heavy lifting, data is loading exclusively on-demand.
I don't understand what that means. The JVM is supposed to interpret and sometimes compile bytecode, right? How can it be done with only a fraction of the JVM?
Or are you saying that it is constantly communicating with a server that does the work?
palata•5h ago
In order to run a Java Desktop app, I need to install a JVM first (or the Desktop app can embed it, I guess that's what IntelliJ does, right?).
Now if I run CheerpJ, it means that I essentially download a JVM when I load the page (every time), and run code in that JVM. But at this point, why not downloading a Desktop app?
It feels like we are going around, shipping simple web pages together with full browsers and calling that "desktop apps" (e.g. ElectronJS), then shipping complete JVMs as web pages and calling that a "web page"... why don't we just ship simple webpages through browsers and complex desktop apps through package managers?
apignotti•5h ago
There are many reasons why shipping via the browser is a better choice compared to shipping desktop apps. The main 3 in my opinion are:
1. Distribution: Give your user a link and the app will start 2. Isolation: The user can have confidence the app won't read his personal files. 3. Cross-platform: Every OS and every device, for real this time
yuri91•4h ago
The second time almost nothing.
jeffreportmill1•4h ago
https://reportmill.com/SnapCode
palata•4h ago
That's interesting! May I ask how it works? Does that also happen with e.g. IntelliJ?
> Every OS and every device, for real this time
Doesn't the JVM run everywhere in 2025?
apignotti•4h ago
Byte ranges request do most of the heavy lifting, data is loading exclusively on-demand.
> Doesn't the JVM run everywhere in 2025?
What about iOS? Android has Java, but can't run desktop Java apps. Chromebooks also have limits.
palata•24m ago
I don't understand what that means. The JVM is supposed to interpret and sometimes compile bytecode, right? How can it be done with only a fraction of the JVM?
Or are you saying that it is constantly communicating with a server that does the work?