5 ms·
Toward Condensers
- wavemode 3y agoSome context: https://mail.openjdk.org/pipermail/discuss/2020-April/005429.html https://mail.openjdk.org/pipermail/discuss/2020-April/005429... Earlier design notes: https://openjdk.org/projects/leyden/notes/01-beginnings https://openjdk.org/projects/leyden/notes/01-beginnings https://openjdk.org/projects/leyden/notes/02-shift-and-constrain https://openjdk.org/projects/leyden/notes/02-shift-and-const...
- slowmovintarget 3y agoThe end result of all of this would be to allow Java-based programs to be packaged as static standalone executables. Java apps wouldn't have to "warm up."
- eikenberry 3y agoThey should have done this 20 years ago. The JVM has always been a questionable discission.
- spockz 3y agoWe already have this capability with graalvm today. Not sure how condensors compare.
- slowmovintarget 3y ago> Project Leyden will take inspiration from past efforts to explore this space, including the GNU Compiler for Java [1] and the Native Image feature of GraalVM [2]. Leyden will add static images to the Java Platform Specification, and we expect that GraalVM will evolve to implement that Specification. Developers who use only the standard, specified static-image feature will then be able to switch with ease between Leyden (in the JDK), Native Image (in GraalVM), and whatever other conforming implementations may arise, choosing amongst tradeoffs of compile time, startup time, and image size. (From one of the links posted above)
- svieira 3y agoFor those who follow along but don't do this for work or fun (yet) is this a Futamora projection? http://blog.sigfpe.com/2009/05/three-projections-of-doctor-futamura.html http://blog.sigfpe.com/2009/05/three-projections-of-doctor-f... Or is this a simpler form of static analysis / partial runtime optimization?
- ithkuil 3y agoMinor Typo: Futamura
- gavinray 3y agoReddit thread with additional discussion: https://www.reddit.com/r/java/comments/15ere1m/toward_condensers/ https://www.reddit.com/r/java/comments/15ere1m/toward_conden...
- ur-whale 3y agoCondensers is an interesting concept and one that is IMO sorely needed in many dev environments (to wit, the amount of work that has been put in Zig to get the compile-time language to be as powerful and compatible as possible with the real thing, and the giant PITB that is doing these kind of things in e.g. C++) Shame the conversation in this article is inextricably laced with Java stuff.
- belfthrow 3y agoI guess you missed the authors and / or the domain this was posted on.
- whartung 3y agoThis sounds pretty nice. In Lisp, this would be considered a "tree shaker" (mind I don't know how they're plan to use this). Currently, we rely on the Java Module system to make reduced runtimes. It works, but is necessarily coarse. You'd think you'd be able run the application for a "suitable amount of time, and a suitable amount of use cases" and monitor what classes were loaded, etc. and use that information to make the smallest runtime possible. The addition of the sealing mechanism is a bonus, most apps simply don't need to be that configurable and flexible. You could do that analysis once, and update it manually (so you don't have to do it all the time), or have some automated service that you run routinely. I have a simple GUI program, getting ready to distribute. It's 5000 lines of code, and has a couple of windows. Admittedly, it also includes WebKit (which alone can be large), but with all the the distribution is 70M. That's tuned using the module system, so it leaves stuff out. That's "good". Many other cross platform solutions are larger. It would be great for something like this to knock that down to 20M (cough).
- ezst 3y agoI bet a majority of those 70M is WebKit itself, and I don't think there's any way to "condense" any of this since it lives outside of the JVM.
- whartung 3y agoAfter some very quick butchery, WebKit turns out to be about 30M of it, just so you know next time you're at a party and it comes up during a drinking game, or something. I wonder how hard it would be to write a simple ("simple") HTML renderer enough to show my documentation (which is all I use it for). "Look a rabbit hole! Let's go inside!!"
- michaelfeathers 3y agoI'm wondering whether there is any reason why condensers can't be used for all program optimization. It seems like the definition would allow that: > The primary means for shifting computation is the condenser. A condenser is a component that transforms a program, yielding a program that is semantically equivalent under a stated set of constraints (e.g., “class X will not be redefined”), but may be smaller, faster, or better suited to a particular execution environment.
- DylanSp 3y agoA fair amount of compiler optimizations already work like this; I'm thinking in particular of LLVM IR passes.