3 ms·
I have high hopes for wasm on the desktop for app plugins. Loading a whole binary DLL/SO is such a risk. VMs like Lua don't give you enough performance. VMs lik
by 01HNNWZ0MV43FF 3y ago
I have high hopes for wasm on the desktop for app plugins. Loading a whole binary DLL/SO is such a risk. VMs like Lua don't give you enough performance. VMs like Python and Java require huge effort to embed.
Once the SIMD stuff is in, it may even have enough performance for music plugins. wasm codecs would be real cool too. Nobody likes having to build and install ffmpeg. `ffmpeg-4.0.wasm`... just imagine.
- Traubenfuchs 3y ago> VMs like Python and Java require huge effort to embed. As a (backend) Java dev, I couldn't let that stand. And indeed I found out java now offers a tool called jlink with first class support, that will create a system native (e.g. .dmg on my macbook) executable with the JRE embedded. The javafx example project* I found could be downloaded, built and run from its native release all within less than 5 minutes. Mind you the Hello World example executable is 80mb and takes 6 seconds to start, but I feel like with the garbage we are used to in regards to desktop applications, this totally holds up -doesn't everything else usually bundle all of chrome? I have also read there are simple command line options to reduce the size to about 50mb. * https://github.com/mjparme/javafx-template https://github.com/mjparme/javafx-template
- eviks 3y agoBut all of Chrome doesn't take 6 seconds to start
- davidalayachew 3y agojlink is very much out of date. jpackage is the new way to do it. I use jpackage for all of my builds. Pointing to the 2 most recent projects I have, my Microsoft Paint clone starts up ~0.25 secs, and my Checkers clone is the same.
- lxgr 3y agoLet's please not justify bad/bloaty plugin/extension runtimes with "at least it's not as bad as Electron". A framework producing a Hello World application, even if it has a GUI, with a double- or triple-digit size in MB and memory consumption on the same order, is doing something very wrong.
- davidalayachew 3y agoThe example in question is very much a "include-more-than-you-need-by-default" problem. So, bloat. Java lets you include only the parts of the JDK that you need for your app. These parts are called modules. Unfortunately, all modules MUST include the base module (java.base), which is ~22MB. And if you add a GUI (java.desktop), that's another ~13MB. And since the linked example uses Java FX, there is yet another layer on top of that. Java is doing a lot of work to bring that number down by a lot. More to come.
- obdev 3y agoMay I ask how do you solve the problem that almost none of the 3rd party libraries in Java ecosystem use modules? Last time I checked, jlink tool refused to make use of those "automatic module" dependencies when creating an image.
- davidalayachew 3y agoThat information is several years out of date. At best, the build tools in the ecosystem don't do a great job of supporting modules, but that's about it. And your comment about `jlink` MIGHT be true if your application is nor modular/ does not use modules with a well-formed `module-info.java`. I haven't tried an automatic module in a long time. If your application is modular, everything happens as expected. I do this for all the builds for all of my projects. Last build from last night confirms that it still works, and works well.
- kaba0 3y agoWith all due respect, that’s just a dumb conclusion. Optimizing for hello world is dumb - if the primary use case of a given framework is larger scale, than it is more than right with such a size.
- dmingod666 3y agovery good alternative is wails 6-10mb single binary use any frontend js tech you want automatically go functions exposed to the js side so you don't need to think about making endpoints, it makes and uses a websockets between the binary and the ui uses WebView2 and not chrome
- erhaetherth 3y agoSounds like Tauri, which is built on Rust instead of Go. > By using the OS's native web renderer, the size of a Tauri app can be less than 600KB.
- 01HNNWZ0MV43FF 3y agoYou're right, embedding a JVM might actually be easy. It's more that I don't target JVMs
- maxcoder4 3y agoIt's loading untrusted python different from loading untrusted dll/so? Unless your use some dedicated sandbox, I think they're equally insecure. I guess a bigger problem with native plugins is that they're not (usually) platform independent.
- marcosdumay 3y agoWell, it's possible that we can only create a serious application-aware OS security layer by forcing people to write an emulator for some random VM... But I'd expect it to be easier to go and write application-aware security on your OS.
- 01HNNWZ0MV43FF 3y agoUnfortunately I am having to support like 3 OSes. 4 if you count the Linux kernel of 2020 as distinct from the Linux kernel of 2024. A userspace, in-process solution is very very appealing until everyone is on Linux of 2024+.