Repository navigation
Upgrade to Java 21 - #44
rodinaarssen wants to merge 2 commits into
Conversation
|
@msteindorfer are you okay with moving capsule into JDK21? |
|
(Note, I've seen usethesource/usethesource.github.io#27 flying by, but not followed the detailed discussion over time.) What's the Capsule-specific rationale for updating to JDK 21, for both runtime (e.g., on CI/CD builds) and increasing the byte-code release target as well? The former I support unconditionally. I would even suggest to move to the latest LTS, JDK 25. Regarding raising the byte-code level, I'd like to hear what benefit you're expecting at the moment? In general, I was considering to move towards a JEP 14: The Tip & Tail Model of Library Development inspired model, where the tails are more conservative for backwards compatibility, whereas tip move more progressively. That said, I haven't mapped out the specifics yet. |
Runtime: we've always used the same runtime as the target level, but recently the backwards compatibility has really improved, so that could be reconsidered. Byte code/language level: for upstream projects, (vallang & rascal) we have some language features and libraries that came after java 11 that we want to use. So since vallang & rascal won't be limited to jdk11, we thought, maybe capsule can also move to 21, such that new features such as records and some better ways to calculate field offsets might be used? If instead you're aware of other capsule users that would be impacted by raising the class level to java 21, I think we can instead choose to not upgrade this now, and perhaps only run the the newer runtime but leave the language level at 11.
Hmm, that is an interesting discussion indeed, especially with regards to semver. |
|
In general the benefit of moving the target/runtime level to 21 is because we are forced to in the Rascal project in order to keep up with dependencies and their security patches. Specifically for capsule we'd like it then for consistency with the rest: diagnostics and predictability of runtime behavior (such as efficiency). It's hard to keep up expertise for different levels at the same time. And it's easy to forget while focusing on some challenge. Nevertheless if more libraries would have done as proposed we would not have been forced to go in this direction now. So I'm very open to this discussion. |
|
We also have a general rule at usethesource to keep all projects at the same levels, but that can be discussed as well. |
|
So as keeping capsule at java 11 does not limit us in vallang & rascal to upgrade to java 21, I think we can choose to skip the forced upgrade of the language level. Maybe a way to interpret the use the source java language level is that it's a maximum? So a project may choose a lower language level if it makes it more compatible with other users of the library. And at a later point might still decide to also go for a higher level of java, in case new changes require it. But that it can not go above the agreed-upon language level of the use the source projects. |
There are definitely interesting features for Capsule that come with newer Java versions, like records, sealed classes, pattern matching for
I second that. The rationale for not upgrading Capsule to In any case, I recommend adopting newer Java runtime release, regardless of the target bytecode level.
Indeed you're not blocked on independently upgrading source level or release target for
The upper bound, is a practical way to view it. On the topic of agreed-upon-level and not going above it, my point of view is more differentiated, hence I brought up the tip-and-tail model. I can foresee that we keep a stable maintenance line say of the 0.7.x branch around that remains compatible with Java 11. (Or maybe even introduce a Java 21 maintenance line at one point in time.) At the same time I can see value in creating a tip version that leverages the latest features (like value objects a.k.a. project Valhalla) and target a feature release / rework aligned with Java 29 (LTS). The latter wouldn't likely be adopted by other |
No description provided.