
Foojay Podcast #57: Welcome to OpenJDK 23
OpenJDK (Java) 23 is (almost) here!
OpenJDK 23 introduces three new features to the language and runtime and many bug fixes, small improvements, and a longer list of preview features.
What are the most important facts about this release? Let’s find out…
Video
Podcast Apps
You can listen and subscribe to the Foojay Podcast on:
- Spotify
- Apple Podcasts
- And most others…
Guests
Simon Ritter
- https://www.linkedin.com/in/siritter/
- https://mastodon.social/@speakjava
- https://twitter.com/speakjava
Artur Skowroński
Content
00:00 Introduction
00:49 What OpenJDK version are we on?
Foojay post by Loic Mathieu: https://foojay.io/today/java-23-whats-new/
01:26 Why switch to OpenJDK 23?
02:45 JEP 467: Markdown Documentation Comments
04:15 JEP 474: ZGC: Generational Mode by Default
https://www.azul.com/blog/what-should-i-know-about-garbage-collection-as-a-java-developer/
https://newrelic.com/resources/report/2024-state-of-the-java-ecosystem
14:17 JEP 471: Deprecate the Memory-Access Methods in sun.misc.Unsafe for Removal
Foojay post by Bazlur Rahman: https://foojay.io/today/unsafe-is-finally-going-away-embracing-safer-memory-access-with-jep-471/
22:04 Preview and incubator features
22:31 JEP 466: Class-File API (Second Preview)
25:48 JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview)
https://openjdk.org/projects/valhalla
30:52 JEPs leading to cleaner code
https://openjdk.org/projects/amber
32:28 469 vector
35:28 JEP 473: Stream Gatherers (Second Preview)
38:07 JEP 476: Module Import Declarations (Preview)
Overview of projects with modules: https://docs.google.com/spreadsheets/u/2/d/e/2PACX-1vQbHhKXpM1_Vop5X4-WNjq_qkhFRIOp7poAF79T0PAjaQUgfuRFRjSOMvki3AeypL1pYR50Rxj1KzzK/pubhtml
43:03 JEP 477: Implicitly Declared Classes and Instance Main Methods (Third Preview)
45:40 JEP 480: Structured Concurrency (Third Preview)
46:26 JEP 481: Scoped Values (Third Preview)
46:40 JEP 482: Flexible Constructor Bodies (Second Preview)
48:56 Removal of String templates
https://openjdk.org/jeps/430 (OpenJDK 21): String Templates (Preview)
https://openjdk.org/jeps/459 (OpenJDK 22): String Templates (Second Preview)
Nice description on the mailing list: https://mail.openjdk.org/pipermail/amber-spec-experts/2024-March/004010.html
53:21 Process of releases
55:25 Predictions for next LTS 25
57:48 License changes for Oracle JDK 17
58:38 About JVM Weekly by Artur (and Scala, AI, LLMs)
JVM Weekly Newsletter: https://www.linkedin.com/newsletters/7097859802881540096/
https://webtechie.be/tags/jfx-in-action
1:06:18 Conclusions
Transcript
Automatically generated from the audio, so it can contain errors in names and technical terms. Suggest a correction.
[0:00] Yava 23 is here what are the new features let’s find out welcome to the FJ podcast all your news about OpenJDK yava 23 brings three new features into the language and runtime but also many bug fixes small improvements and a longer list of preview features what are the most important facts we must know about this release let’s ask these guests hello I’m Simon R I’m the deputy CTO at aul and I’ve been involved in Java for quite a long time now hello I’m arus Kinski I’m head of javac development in vtus Lab company responsible for example for scal compiler currently and I’m also editor of JVM Weekly Newsletter and I’m Frank theor technical writer at Azul so yeah here we are again Simon we meet twice a year in this podcast to go to look into the new releases for people still running Java 8 can you confir irm which version gets released this month so yes it’s JDK 23 it is difficult to keep up with this I have to say sometimes I really have to think to myself hang is it 23 24 22 what which version we on yeah people are always surprised when I I’m it’s even the very funny question during the
[1:20] Start of the presentation okay who knows what is the current version of java and people often misses we’ve said it in the previous podcast you don’t have to switch to this version because we have these long-term support versions in between what is the most important reason to try out Java 23 I think really if we’re not looking specifically at the features of it the reason that you want to try out JD k23 is that because obviously there’s there sort of two years between long-term support releases the best idea is to test each of those as you go so that when you make the switch to the next long-term support release you’ve already been exposed to the various changes in each of those intermediate releases so it is a very sensible thing to keep up to date with at least testing your applications with the newer versions so one answer is to be prepared the other if you are writing a lot of java do JX comment javax comments because that is the one and only very practical feature that you can use right now at least from my perspective in that version okay and or if you are using the GC however will
[2:30] Probably get into that yeah indeed so there are three new jeets which gets released in this OpenJDK 23 I will list links to each of these jeps also in the show notes of this podcast markdown documentation comments let’s pick that as the first one because you said that’s the most important one for you Arthur so what does it mean it means that you can write better Java do more consistent one because currently Javad do syntax it’s all does H because it was created in the way in the time when unfortunately more fortunately there’s a lot it was it has a lot of phases on the HTML tax and styling it in that whale so xish U truly xish in that regard and today we probably moved a bit from that direction from writing documentation because marown is the most popular for format it’s currently included in most of the popular GitHub repositories and other coding sharing platform like for example GitHub gitlab so it’s it become the standard and is automatically passed so people are and what is probably the biggest advantage of markdown is the fact that everybody knows it it’s very easy to
[3:54] Grasp it’s you can use it both for writing the documents and well as for writing documentation so people memorized the people memorized the format so it’s good to see it in the Java do as well so that’s a new Final feature which is implemented and then 474 is zc is now changed the full mode what’s the change there okay so my question here is should we explain people what generat generational truly means mhm probably a good idea yes okay so maybe I will carry on with that I will try to make it simple and as for children because I have three years old daughter so I prefer that method and imagine that you have room full of toys the toys that are quite new and the toys that are with you for the longer period of time and as I said I will use the daugh my daughter as an example here because if you have new toy you probably will be playing with it all the time for the first week then you will drop it and return to the doll that you are playing since your are birth that’s what children do and that’s exactly what application do as well because garbage collect and because most of the new
[5:17] Objects they are destroyed very quickly because they are just used for a moment just for the brief computation for the scope of one method things like that however there’s a group of objects that are there for the longer period of time and probably will be till the application will be killed or closed and based on that hypothesis because this is generational Theory soall u a lot of garbage collectors try to optimize so if some objects were just created there’s probably bigger chance that they will need to be garbage to just swept much quicker than the objects that are quite long and with ask for the extended period of time so most of the garbage collectors in Java they are working that exact way however dgc did not at least in the past because it is very state-ofthe-art garbage collector the one that is able to handle the terabytes of the memory however with that power comes a great complexity and just to not delay the original premiere of the garbage color they decided okay maybe adding that yet another layer of optimization so generations to the cgc would be
[6:43] Probably too much and it’s better to deliver it without the generational generational sweeping just to be able to deliver it quicker and now they are just adding yet another optimization no and called it generation GC so it’s not a new garbage collector but a change in one that was added recently yep and probably the funny part is that originally it was considered to drop not generational one so that original version of the zgc however there are some use cases and some workloads when generation Generations do not help on either have some drawbacks so they decide okay for the time being let’s keep both of them optimize the new version until the end when we’ll be happy with its performance in that corner cases it’s probably it will be able to get rid of the original non- generational one okay that was one of the first very first blog post I wrote when I joined aul was how many different garbage collectors are there because not many people realize that there are different ones some are better suited for different use cases H I’ll need to go back to that
[8:09] Blog post and update it because I think I mentioned there that Z GC was not generational so it is now are there other things we should know about this Simon yeah so you know to sort of follow up on what arter said the idea behind garbage collectors is one of those things that we an enormous amount of work on I’ve got two very thick books on my bookshelf which are all about a garbage collection and you know as as you rightly said you know there’s this thing called the weak generational hypothesis which says that most objects that you allocate are only going to be used used for a very very short space of time and that’s proved to be very consistent across a very wide range of applications and that’s the reason why if you look at the sort of garbage collectors that we had in the original sort of hotspot jbm so if you look at the serial collector the parallel collector concurrent Mark sweep and even G1 when it was introduced all of those are generational so you had a Young Generation which could be garbage collected quickly and eliminate objects because most of the time when you do the
[9:16] Garbage collection on that you can do it at zero cost because you’re not copying any objects You’re simply removing only copying the ones that are there valid objects so it was a very sensible way of doing things and then we start started doing some more experimentation with different sort of garbage collection algorithms and the two most recent ones in OpenJDK are Shen and DOA which was originally developed by red hat and then Z GC which came from within Oracle and both of those took the approach originally of not being generational which was kind of an interesting design decision because clearly the people who were developing them were you know pretty smart people but they decided not to go with a generational approach initially and both of them have gone back and said actually you know to get better performance we need a generational garbage collector so Shan Anda did it a while ago I can’t remember which version it came in that they had a generation or shanida and now zgc has also taken the same idea which okay to get a better performance for a wide range of applications we need
[10:17] Generational garbage collection it is interesting that they’re leaving the non-general garbage collector in because clearly there are some situations where when you’re not generating a large number of new objects and you’ve got a very steady state for your data then having a single generation actually is more efficient in that case but I would imagine it’s a fairly small number of applications that do that because the way that Java works is you’re always allocating objects even though you don’t necessarily realize it when you write code there’s a lot of object allocation going on that you might not think about so yes the there’s various things that people should consider in terms of the choices but of course the choice for anybody who wants to do you know high performance garbage collection has to be C4 in ao’s platform Prime I am going to you know stick the marketing BD in there I’m going to add the link to the blog post about these garbage collectors and C4 is indeed one of them in that list but people should also be aware there are that many garbage collectors but in most cases the defa
[11:21] Will be good enough but there are options that you can switch garbage collector that you can fine-tune it that you can configure it so those are all possibilities but I don’t think a lot of Java developers need to do that yeah I mean one of the things that’s interesting because our colleague Garrett Garrett ginal is currently doing a presentation on garbage collections at different conferences I think he’s doing it at devox in a couple of weeks time and I’m I’ve been quite surprised that how popular that is not because you know any sort of negative thoughts towards gett because he’s very accomplished presenter but I used to do a presentation on garbage collection many years ago and it sort of fell out of favor but now obviously there’s an interest because we have more collectors available Shen andoa zgc C4 and so on and people are interested in that and as you say most developers aren’t necessarily concerned about garbage collection but there is actually a lot of configuration that can be done and that that’s one of the things that you have to look at is how much effort
[12:28] You need to put into tuning a garbage collector to get the best possible performance out of it there are a lot of flags that apply to most garbage collectors which then results in you having like an n-dimensional space and you’re trying to figure out what’s the best combination of parameters to give you the best performance on that yeah and probably having multiple garbage collectors there’s also for reasons I still remember that quite interesting documents about the state of the Java development is all from data doc remember correctly H when they were able to go data doic probably something worth checking we’ll share it in the link notes when they because they are as they having agent that is able to track the real usage of different well different components of the JDK platform They Se that a lot of people is using the garbage collect collectors wrongly because for example they have garbage collectors that are mostly tuned for the big hips for the one g gigabyte Docker containers and unfortunately it’s not optimal way if you have very small amount small memory footprint you probably should should
[13:39] Just stick to Mark and sweep or some kind of the others G optimize for that not the one that are just prepared for the big hips like theander G1 is current probably more mostly recreated for so it’s always kind of tricky not only tunic particular garbage collector but also picking the proper one for your use case Okay I’ll write a note for myself I need to think about the podcast about garbage collectors that’s probably a topic we can discuss for hours oh yes yeah it’s very interesting okay good there’s a third finalized new feature JEP 471 deprecate the memory access methods in unsafe for removal there is already a Foojay blog post by bosur Raman about this topic I will also add a link to it what can you tell about this Jeb okay it’s probably funny to call it stable Jeb because it’s Jeb about deprecating something so it’s not very practical for most of the people however is just the working sign that in the future the sun MK and safe will be marked most of the method that are still there because in the past it’s quite interesting because in the past they were just reading the method from
[14:58] That class so there was no warning no information just cleaning up however currently because okay once again a bit of History I still remember times when everybody was scared because when the Java jdk9 and jigaw and model system was announced everybody was okay worried that as we’ll be encapsulating the Java platform a lot of project will lose access to the internals and most of the internals are not that important however s m unfe is because it allows people to handle the memory in the direct way on Hep off hip memory one that is not directly managed by Java so it’s very necessary not for a daily application because please dear listeners if you do not have particular reasons to do that do not all do not use off hiip memory however that ALS Al the reason why so many data intensive application like Kafka like Cassandra is written in Java because it was possible to manipulate M pages of the operating system directly so when the original jigo announcement was made those developers said you are just killing our projects that way and they decid okay the modu systems won’t
[16:23] Be that strict however it will at the start however it will be in the future because you need to be prepared will give you a proper tools we’ll give you Panama we’ll give you act foreign functions foreign memory access apis things like that and in the future we’ll just drop the support we’ll just encapsulate s MK unsafe and deprecate it access from the Java application and it is happening right now as you say it’s it’s it’s an interesting thing from a historical perspective jdk9 they really wanted to turn off access to all of the internal apis and that just wasn’t going to be practical because despite sun and even Oracle after that you know being very explicit about this you know these are not designed for general purpose use do not use them they could be removed at any time they could be changed without notice as you say lots of people who wrote Frameworks and some of these more sort of lower level things like Cassandra and CFA they did use them and so it was decided that it wasn’t going to be realistic to turn off access to Sun Miss guns safe in jdk9 and the fact that we’re at JDK 23 and we still
[17:33] Have Sun Miss gun safe even though we’re we’re deprecating some of the methods in there is Testament to how long it’s going to be around yeah I mean if you look at the particular Jeet here there they’re not turning off all or not not deprecating all the I wanted to say that it’s not all the methods because I say probably will stay as I can stay in the current state Forever at least partially yeah so the ones that they’re doing at the moment are they did a few I think it was in jdk18 that they deprecated and then it’s an extension of that so they’re turning off a lot of the memory access deprecating not turning off they’re deprecating a lot of the memory access methods but there’s still things like fencing operations and stuff like that are still available and haven’t been deprecated yet but obviously their goal is to replace everything in zis gun safe with a public API which is documented and maintained and provides the same access in as safe a way as is possible and then they will remove access to Sun Miss GS safe I personally really like sunis unsafe the reason
[18:39] Being that the clue is in the name unsafe don’t use it however sometimes sometimes price is better is such grade that you are just taking the risk so but that means that by deprecating them you can still use them but if you have a code validation tool it will give you warnings because you are using methods which can disappear in the future yep and if I remember original ja it will be in the first version it will be warning during the compilation time then during the run time and then you will just have an error yeah so you have some time but isn’t this whole package of unsafe methods wasn’t this used in that 1 million Road Challenge we had I think the beginning of the year that people were finding out how fast can I get something done with Java that was exactly what they were using because they were accessing the memory directly yes and that that’s the point you see because there wasn’t a public API to be able to do that so this is the thing about deprecating them is that with the inclusion of the Forum specifically The Forum memory API that gives us the ability to do the
[19:51] Same kinds of things it will be interesting to see whether if they did something like that 1 billion line Channel and said you couldn’t use Sun Miss G safe can they get the same results with the public apis that they can get with using the internal ones yeah it’s interesting mentioning the 1 billion Ro challenge because I still remember the discussion that was during the challenge itself that probably we shouldn’t deprecate s m and safe because it is used to get the best possible performance so it was mentioned during the time and people started to wonder maybe it’s not the good d ction then because even in the there are still some use cases that are mentioned which unfortunately won’t be covered by the standard DPI because okay just the one very Corner Cas cor Corner Kish on however people okay creating the vand API the for memory act API just decide okay it shouldn’t be accessible to the public apis probably what does it mean probably will need to just create the libraries for that and consume them we’re just using foreign functions API yeah this is the problem of having orthogonal requirements so on
[21:09] The one hand you know people want a language that’s safe and that doesn’t allow you to step outside of things and do things like buffer over runs and all the sort of stuff you can do in C and then people want the ability to do those things in order to get performance so you have to make a decision one way or the other as to what you want to allow but this whole process of chaps and preview features and the community giving feedback I think if it’s really needed and it gets deprecated there will be a question to reimplement this in a safe way or in a good way so that’s just how Java is evolving at this time yeah I mean OpenJDK has already stated that so we don’t need to worry too much about it because they they’ve already said when they tried to deprecate and remove the internal apis in jdk9 they did say when they changed their mind about that before they would remove this they would make public apis available to provide the same functionality so we have three finalized features we got them now and then there are nine incubator and preview features so as a reminder these are
[22:14] Not available if you just start Java or develop like you would normally do you really need to enable these preview features should we go through hold the list or are there some that you think are really important Pi okay so maybe I will start with my daring so class file API it in the second preview because it’s solving quite interesting interesting problems because currently as Java is Evol because for a time being Java wasn’t evolving that fast so changes in the class files wasn’t that wasn’t happening that often however currently there are many libraries for that are handling Java classes and each have its pros and cons that’s one thing and as the class files evolve and especially due to valhal the other projects that are wearing doing a lot of the heavy lifting of the class file CL class files unfortunately you need to just maintain all the store Ries and it’s very hard because for example some of them are used in the ASM library is used in the internals of the JD okay and you have egg and the chicken problem because unfortunately you cannot just evolve the component that is used in the
[23:37] Internal of the JDK before the new version of the JDK is published however you need it to just be able to deliver or use that old new feature that you just delivered in the JDK inal so they decided okay maybe we should just create the Glorious alternative the one that will be just keep up with the all the changes that will happen now in the future now and in the future and create the standard API that will replace all those libraries so this is something that class file API is bringing and there’s one interesting thing about it because they are just dropping the dependency of the external components and getting once again back to our stable features they just brought one because the markdown support in the JDK will be delivered through the common mark library so they decided to use library for that U so it’s not that consistent however I understand this is just the small feature not the class files not things like that it’s good to use the well established components however in such an internals that are happening such internals of the whole platform probably having external dependencies
[24:54] What good start but not sufficient enough or now so all these Evolutions they help to get rid of a few dependencies so your project can become smaller easier to maintain because things are moving from good libraries into the language itself yeah and especially especially important for the language itself because it was hard for them to evolve everything in the platform they even thought about the including just take maintain the ASM library and making the part part of the core platform however it’s just the Legacy code base that is not using all the new features and they say okay it’s better to create the proper replacement it’s very interesting JB yeah okay good all the links again in the show notes this was JEP 466 class file API then we have JEP 455 primitive types in patterns instance of s that’s again an evolution in this whole switch case thing and of what’s important with this preview feature yes this is definitely one this is my favorite one although this was introduced in JDK 22 so this is second preview as you said it’s the idea that we can now have because in
[26:15] Java you’ve got the idea of obviously a type system so classes but in order to get better performance right at the very beginning rather than making everything an object we still have primitive types and we’ve still got primitive types now so there’s this kind of like impedance mismatch where sometimes you’re dealing with primitive types and sometimes you’re dealing with real types and this becomes most apparent when you do things like generics because you can’t have a list of int which is a primitive you have to have a list of integer which is a rapper class for that primitive so you make it into a type and then this leads to a number of issues and we’ve seen this with pattern matching because we can do pattern matching in various ways that’s been in included since about JDK 12 I think but again dealing with Primitives has been harder so this is introducing the idea and it’s sort of also related to some of the Valhalla stuff as well so that we now have the ability to use Primitives in things like switch where we can then say you know okay switch on in ey and recognize an integer ey but also
[27:26] Instance of and the instance of is the one that I find is actually even more useful because if you do if I instance or bite it will actually take that number the Primitive value and determine will it fit into a bite and that’s a really nice thing because then you don’t have to do is it you know between 127 minus 127 and 127 to say is it will it fit in a bite you can just simply now do if I instance or bite and then you can manipulate it in the way that you want to so this is a very very useful feature to my mind extending that pattern matching that’s that’s really been a big theme for the last few releases of java is this also has does this have an influence on the amount of memory so if you’re using bite Primitives instead of a bite object I suppose technically yes but it’s probably not going to have a huge impact on that I think again when we get Valhalla that’s going to be the thing that will have a much more significant impact on the ability to reduce the size of memory that we use because of the whole ideas behind Valhalla so this is a sort of like teaser to some of the stuff
[28:38] That’s coming in Valhalla Paving the ground and unification of the platform so make okay make it more more obvious when in which places you can you to use which Concepts because right now it’s without the IDE it would be probably quite complex to know okay I can use the premi here I need to auto box here for example with the streams it’s quite it’s pretty hard with streams for the new people that you need to be have for example boxed in the particular places specifically put because otherwise you won’t be able to use particular methods so that unification will just bring the clarity to the whole platform and talking about this JB and maybe the pattern matching all together I’m very happy that we currently can use the switch because it’s pretty useful concept and for years it was treated as the anti pattern and currently it’s getting back getting the lights no it’s getting the proper spot because it’s very useful not to use all those Des same patterns and everything due to fact that currently the switches are ex exhaustive so we are able to easily spot the places where
[29:53] Where particular play where there where the particular methods and particular the objects are used and which places needs to be changed yeah there is one thing I would say about this is if you’re thinking about using this you do need to read the carefully because there’s an awful lot of sort of how can I put this well combination of like truth tables Corner cases and Corner cases yes exactly Corner cases and Truth tables where you need to be aware of what you can and can’t do because of the different primitive types that we have in terms of you know you’ve got short bite short int double so that’s four different things to store an integral value and how those sort of relate to one another and how you can use them in different examples so that there it’s well worth reading the in detail to understand the corner cases okay I would say before I would even say before use particular feature it good to say to read Jeb period yes if you read these jeps they also give examples of codes before and after exactly I’m I’m really surprised how much the codee gets cleaner if you
[31:02] Make good use of all these changes in pattern matching and switches how you can reduce a lot of code into some simple lines and make it very readable which is I think most of the important facts as a developer you have to make readable code not only for yourself but also for your colleagues for your future yourself if you go back to some code that you can understand what you did some weeks ago yeah if if you talk to people like Brian gz and even James Gosling they will say that readability is much more important than writability because you’re going to spend more time reading code than you are writing code and this is all part of that bigger project project Amber which is about trying to take some of the rough edges off the Java syntax and simplifying those things as you said so that you’ve got less boilerplate code but without losing the readability and the great example of that is the patent matching for switch because they introduced the idea of you know being able to use a comma separated list for your cases and have a switch expression rather than a switch statement that really does make a
[32:12] Difference and you can see some really good examples of how you can take a very big switch statement or switch Yeah switch statement and then condense it down into a very small switch expression and not lose the readability you can still see exactly what’s going on but it’s less code involved okay the next JEP which is in the eight incubator phase the vector API 469 so eight incubator two releases per year that means that we are working on this for four years and more probably what’s changing why it’s taking so long nothing and to the level that I don’t remember if that was JDK it was probably jk22 they forgot to include it yes because nothing changed and everybody forget it’s even there and the probably the funniest part is that it’s in the incubator is in the currently we are still waiting for it however everybody is using it all the AI related projects J Vector J Lama every project that needs to use efficient vectorized memory and want to have control over how the structures are put in the memory is using that project right now so but the they have said they’ve been very
[33:29] Explicit about this which is that because the vector API is closely related to the Valhalla project it will remain in incubator status until they deliver on more of the Valhalla project so that’s why there’s no changes in it it’s not because they’re they’re still soliciting feedback on it it’s just that they can’t put it in as a full feature until they’ve got more of Valhalla in there yeah however decided to just put it in the JDK because it’s that’s useful okay and it’s useful and it’s used indeed for AI related projects I think mostly but yeah it’s there it’s in you just need to enable it but you can use it and it’s as it is not changing anymore it’s stable it is an interesting API though because I looked at this quite closely because I did a I put together a session on this and you shouldn’t think to yourself oh Vector API I’m going to use that because autov vectorization happens in the compiler anyway so the jit compiler will do autov vectorization for you in simple cases where you’re you’re doing numerically int intensive operations you don’t need to use it because the compiler is
[34:30] Going to do that for you anyway where it becomes useful is where you’ve got more complex situations especially where you start doing things that involve conditional statements because the jit compiler C2 can’t recognize a lot of situations where you could use Vector operations when you’ve got a conditional involved in that now I would say that in and I’m going to I’m going to mark it again in platform Prime from us all with our Zing JPM we have a different jit compiler called Falcon and that recognizes a lot more situations where it can do autov vectorization so we don’t need the vector API as much in Prime as you do in OpenJDK hotspot marketing has probably add a bit more thing to the gr V that gr V is also not using the vector IPM as as for now so a lot of different evolutions and we’ll see how they come together at some point or not and when they become final good the next Jeb 473 stream gatherers another useful very useful feature because if you look at streams you know they’ve been there since jdk8 that was the huge thing that made jdk8 so popular the introduction of
[35:42] A more functional style of programming through streams API and the introduction of lambdas so combination of those two really very very powerful and streams have kind of gone through a number of like iterations in terms of adding a few features to it they did a fantastic job of the initial implementation they’ve kind of added a few things as ’s gone by to make the even more useful but the stream gatherers is a really good thing because if you look at the way streams work you have a stream Source you have a number of intermediate operations and then you have a terminal operation now from the terminal operation point of view where you collect things together or you gather them or you do whatever you want to do with them there’s a lot of flexibility because you can create your own collector so you can Define your own collector and make it whatever you want in addition to the ones that they provide you which is a very rich set but for the intermediate operations you’ve been restricted to only the ones that are provided by the streams API what stream gatherers does is now now gives
[36:41] You the same ability to Define your own intermediate operations in the same way that you can do for a terminal operation so to me it’s it’s a very logical thing to do great feature to add just adds that extra level of power to the streams API mhm and what is interesting you don’t need to CL because this way they do not need to clutter the original API it can be simple it can be just they can include just the most important features that will be mostly used and jdka one 1.8 and streams are with us for the longest period of time and we probably most of the user is Happy what was delivered however they are particular more interesting gatherers that especially functional people are talking a lot about it currently I for example heard that gather can include much more functional features to the stream that were not possible in the past so people are quite happy with that feature okay again in the jet there are examples about what you can do with the stream gatherers and also with the other Jets of course we already have on Foojay another blog post by Lu mat who was in the previous Java 22 podcast he also
[37:50] Has written a blog post about Java 23 what is new I see that Hano inre also has an overview of the features so if people are interested in all these features and they want to try them out or see how the code looks like before and after there’s definitely a lot to learn there okay let’s go to the next 476 module import declarations as I understand it it’s simplifying the import or minimizing again the number of imports you need to do correct yeah okay maybe I will start with a question there before we go delve into discussion from your experience how many people are using the mod systems ah I’ve used them a few times and it was each time a headache yeah that is a very good point because you know that was the big thing in jdk9 wasn’t it was project jigsa modularity and it had two aspects to it so there was modularization of the JDK itself very important made a lot of sense so we in and that’s okay that I wanted to say everybody because we currently have those previous features and they are implemented to the model system however explicitly it will probably it will
[38:59] Be probably your second Point yeah well because that was the thing so the other side of project jigsaw which it was really more designed about was the whole idea of modularizing your application introducing modules for the application Level and I have seen very little take up of the module system in applications I really don’t see many people actually using it in anger in and in real world applications so yes that that’s a good question is how many people are really using the module system so do we need this chip we do yes because even though not many people are using it it’s one of those things it’s a small change in the same way that you can do package Imports with wild card so you can do import java.util dostar to indicate I want to import all of the classes from the java.util package what we’re doing is in the same way that modules are a step up from packages where you’re collecting so packages collect together logically related classes a module collects together logically related packages so in the same way that we can say we want to include all the classes from a given
[40:11] Package now we can say we want to include all of the packages from a given module so it’s it’s a very logical thing to do I don’t know why they didn’t do it earlier on when they did the module system back in jdk9 but it’s it’s a sort of small thing that just makes live easier for anybody is using yeah probably due to fact that you need to explicitly in case of the conflict you need to explicitly set which class needs to be pick however it was always like that because it was also a problem with the package system okay and because probably it’s everything it’s said to be said about this JB however I have one yet another interesting info because I wanted to wrap it with a bit of positive there’s a much more and more libraries that are currently fully modernized because the problem with M system is once again again in hand that you need to have if you do not have modularized ecosystem so Sprints of the swords are not implementing models it’s not worth to doing do that in your application because it will just be shooting yourself in the foot however currently there’s more and more projects
[41:21] Who are modularized there is even the nice list that is collecting all of those May also something worth to add to the episode notes and once again the problem is that spring is not and that’s probably the biggest reasons why nobody no not that many people are excited yeah because if spring is not fully modularized probably we just cannot we just cannot it’s not worth to do that with the application that use spring and I still remember when they announced before the spring the 6.0 that the spring frame 6.0 that it will include the model systems and they resigned it just before the premiere because in PR is such heavily based on the reflection and they wanted to also include to create the native images to know what classes are used in the production application so being able to create the native images effortlessly for the users it wasn’t possible to include it was very very hard to include the model system because you are losing that information what is used by which particular particular part of your application that’s why they said okay maybe just we need to wait a bit more
[42:43] For that but they have it on their Roat as far as I know yeah so maybe in the future is brighter than we presented it at the beginning but that’s that’s how we should look at the future everything will be okay one day yeah event eventually bright je 477 implicitly declared classes and instance main methods isn’t it the one Simon We were discussing last time you were not a fan I’m a fan yes I’m I’m not a fan as I say I think you know it’s it’s very it’s it’s it’s a good intention to include the ability to simplify the way that you write your very first application so when somebody has no Java experience at all and they want to understand the you know the very basic idea of how do I simply print out hello world then yes it’s great that it makes it easier for them but the reality is that nobody writes that as an application so everything is going to be more complicated than that so once you’ve done that you need to know about all the details of how to you know construct classes and how the Constructors work and the access methods
[43:56] And those sorts of things so it’s it’s great that they’ve included this but I you know it’s not a feature that I see any immense value from yeah the fact that it’s already in the third preview although it was initially very simple just simplifying the main method is there a lot of discussion ongoing here it is and probably that’s the reason why we have yet another preview and yet another change of the name of the because the problem is far more complex than people originally thought yeah it seems okay we’ll just created much not something easy for people to use and then another complexity layers happen and I still remember that is currently called the implicity declar CL classes the name was I oh my God I don’t remember what was the original name however it was something that was clashing with the Scala yeah imp okay it was just implicit and cl Scala had a different has a particularly different meeting for the implicits so they decided to change that and also there’s a lot once again if you already put into emphasis that you should read Jeb if you want to use that feature you
[45:18] Need to reject and probably with the cont in the contradiction with okay it’s for the beginners it should be simple yeah yeah yeah it should be it’s not simple it’s very hard to bake that feature into the already existing ecosystem I’m curious to see if if we will see it Landing in the next or next next we’ll see okay je 480 structured concurrency that’s the third preview what no changes one in yeah yeah everybody happy with it but it’s not yet ready to be packaged or finalized I’m close to sure that it will in the next stable version of the JDK it’s just they’re just preparing for it they’re just looking for okay situation what in it will be problematic however currently they just okay there’s no reason to stabilize it yet before the LTS maybe JDK 20 24 that will be good time to include it however no changes and U and probably we’ll just have it in as is in the next JDK release okay 481 scoped values third preview quite similar story just one if I remember there’s just one slight minor change for the API and that’s all okay and then we have a final one for 82 flexible Constructor bodies
[46:45] Second preview I think that could be a more important one yes yeah because it used to be called the was it statements before super yeah and now it’s flexible Constructor bodies yeah I mean it’s it’s again it’s it’s one of those things that in terms of the way that the language works this is something that occasionally can be annoying is that the fact that if you want to have a Constructor and you need to call the Constructor of the super class you had to put the call to Super as the first line of your Constructor so you couldn’t do anything before that and now there are certain situations not everything so certain situations where you can include some code before you make the call to the superclass Constructor or the explicit call to the superclass Constructor I should say because there is an implicit one already there so yeah it’s it’s again it’s it’s one of those things that’s addressing a small need from certain developers where they go oh you know that would be really nice if we could do that and now they can I will just give yet another reason for that particular J because it’s much more
[47:50] Important than that because it’s are it’s just specifically stated in the no restricted and labor types JB from the valhala because they need it if we will be a yeah this is something that is needed for valal currently because yeah because to introduce and we are probably just we haven’t talked about that jet there will be probably some discussion about the future of the JDK and what will go after the JDK 23 however that one will be needed for Vahala because to have to be able to have no label TI and being they need to have some way to assign values before calling the Constructor so this is the building block for the future of valala and potential nullability Improvement in Java so that one is pretty important and there’s again some nice code examples there that you can for instance check a value before you construct your object to make sure that value is defined or required value so examples like that are there good so that was a long list of incubator and preview features now the risk of these preview features is that they can also disappear and that’s what’s happening with the string
[49:07] Template and that’s I think also an important topic for this OpenJDK 23 the string templates which we already had in two preview features JEP 430 and 459 they’re gone why didn’t like them there are two reasons okay because I get to the original mailing list and it was you know I was reading it and eating popcorn because it was quite interesting story when it happened and there are more than one reason because the when they or for sure people didn’t like it everybody hated the design each iteration and remember there was even original draft for the third preview that was going totally other way but they finally decided it’s probably time to drop it and what is interesting in that Jeet is the fact that okay they there’s two reason one nobody lik the API the other the design was wrong to the L because originally they thought that they need to have pre preprocessors to be able to achieve the decent performance on the goal on the way they learn they do not because it’s there are better ways to handle it however if it would just mean okay we’ll need to rewrite everything from scratch
[50:30] And probably we shouldn’t just make it the continuation of the previous previous s plate I would say brand because it’s just totally different design and we are getting back to the Whiteboard getting back to the original assumptions and trying to check if they are still valid after some research they did on how it can be handled in the performance way yeah this to me me is an absolutely perfect example of how the development of OpenJDK has been handled in such a great way and what I mean by that is that by switching to the six-month release Cadence it means that we could introduce the idea of preview features and incubator modules we couldn’t do that before because two three or four years between releases made it totally impractical to have incubator modules and preview features but with six months you can say Okay preview feature have a couple of releases let people try it out and then bake it into the full platform but it also gave us the ability to try out something and then if it doesn’t work and they were very explicit about this when they introduced the jeets for
[51:38] Preview features and incubator modules was if something doesn’t work out and people really don’t like it we can just back the whole thing out of the thing and it’s not going to have an issue of backwards compatibility and so that to me is a great example of how we have this ability to develop Java in a way where we can try things out like this and find that there’s two things you know one is a lot of people don’t like it and even the developers of the feature realize that there are different ways of doing it better ways of doing it so at the end of the day they just went okay we’ll take it out and we’ll have another go at it we’ll we’ll come back later on and find a different way of doing it that provides an alternative way of delivering the same functionality so to me it’s it’s brilliant I love the fact that they’ve dropped it not just because it wasn’t a great feature in terms of where but because it shows that we can do that with Java mhm yeah and because they just realize they can do it better so it’s not worth because they are just investing for the long term not just to deliver it right
[52:37] Now so it was the good decision probably a lot of people will be a bit more look T to use the preview feature as now because we have that first occurrence when it was truly dropped however it’s for the greater good I think yes so people who are using that as a preview feature in Java 21 OpenJDK 21 or 22 for 23 they will not have it anymore so they will have to find an alternative approach or stick to 22 and wait until something reappears that is doing a bit of the same thing but in a different way and yeah it’s not lost work because they know what not to do it’s just it’s just the R&D yeah yeah this points out that we have this evolution of six months and we can go back and but it’s not that this release which is now happening in September is something which is now finalized because I’ve looked at the timeline and this is really an interesting topic if you follow a bit of these releases if on the 6th of June there was already a message saying yeah Java 23 will be released in September it’s branched today so that means that these features which are now there as a finalized or a preview feature were
[53:55] Already there in June yes so we do have it’s it’s interesting because yes we have six-month release cycle but the actual development cycle is a little bit less than that it’s it’s not really s of three months because as you say the feature freeze happened in June so that was only really three months after the creation of the thing but we create the next project so for example where are we now J to 204 is already there and I think 25 will create the project for that pretty soon because I’m on the Java SE expert group and they keep sending me messages saying do you want to be on the next expert group and it’s like yes of course I do and they do create it a Time ahead so if you look at JDK 24 for example there’s already one Jeet that is listed as targeted for JDK 24 even though we haven’t released JDK 23 yet so there is a little bit of time before we release the next JDK when they start developing the one after mhm can you share which one is already there selected for 24 it is prepare to restrict the use of jni yeah it’s always the slow start however from
[55:02] My experience just after the premere of JDK 23 next week we’ll be able to see what will happen What will be Target for the at least initially Target for the JDK 24 because the FOC will shift yeah that particular Jeet is very much like when you’re driving your car and you’re you’re you have the satinav and it says prepare to turn left and you go okay I’m ready so that’s one thing we already know for 24 so next year in September we will have 25 which is again a long-term support version but we don’t know yet what will be in there so that’s something which will be decided after somewhere around the release of 24 okay good okay I can assume okay we make a bit of guessing I assume that most of the preview feature we discussed today will be part of the next LPS that’s something I also count on some preview of the Valhalla maybe some original maybe we’ll be able to see value classes in the next LTS that would be very cool maybe also if because I also checked what is currently in draft and what would be the most I would be most fond of to have in the next ltf probably adapt object monitors for
[56:16] Virtual threat so handing some drawbox of the Loom and being able to use it in the more cases that would be nice to have in with structure concurrency because that would be hit the big milestone for loom and make it quite full fully complete especially if we add scope values we didn’t cover scope values however I assume as in the third preview it was done in the previous episodes yeah so that’s my wish list for the next ltf okay maybe I need to invite you then for the podcast about Java 25 to check if you’re correct just to check what was correct yeah so I’ll say that the one that I’m I’m hoping makes it out of the draft into something fairly soon is the concise method bodies let’s see if that happens should companies start preparing for the 25 as being the next long-term support version only in so much as testing with 23 M and just following these releases okay there’s nothing to prepare for specifically for 25 it’s testing with the current version yeah and probably I need to say that I see three different velocities in the companies the first is okay we will just use every new
[57:35] Version to be able to prepare it for the next ATS the other one okay we’ll just use the new LTS and one okay we stick with Java 1.8 however those on are in the problems right now yeah yeah actually there’s a fourth there’s a fourth velocity there’s the company who uses the long-term support but not the current one they use the one four mhm yeah yeah that is quite significant because if you’re using I’m going to I’ll put this out here so if you’re using Oracle JDK 17 you need to be aware that because with the release of JDK 23 that’s one year after the release of JDK 21 follow me here that means that the license for the Oracle JDK 17 will change from the no fee terms and conditions license which is you know basically free use to the Oracle technology Network license agreement which means means you will need to buy a jav RC subscription if you want to get further updates from October which is unly a bit of promotion for aul again Simon so you are good you are definitely good in that as Simon already did some marketing Arthur I’m going to allow you to do the same because you have this newsletter this Weekly
[58:46] Newsletter that you’re writing promoted so okay promoted okay so maybe a big of background what I’m doing on my job because like I mention at the beginning I’m the head of jav development so in the consulting company we are vtus lab is a consulting company the one that is very heavily involved into JVM however from the bit different direction because we are currently stewards of Scala one of the I would say not the only one however if you will see new releases of the Scala when they are announced they are by people from The Bu sub because we are currently handy scat so we are involved in the community and in such company Java is probably just another department and I’m trying to handle it in the proper way so I want to be able to be the source of the information for both compan organization and the clients this way I need to be up to dat I need to see what is happening so I decided okay if I need to gather that knowledge it’s good to share it with the people and that’s how I created newsletter when week by week I’m de just delivering information what interesting happen in the community
[1:00:00] Especially not especially on those heavier stuff so new JBS what is happening in them why they are important how they connect to each other because what I learned is that it’s very hard to just get Jeet and understand it because they are connected to each other it’s a quite complex ecosystem and there is a singular puth do not give you the whole picture so I’m trying to give that people give people that picture through the newsletter and I’m quite happy with that it’s a lot of fun to be able to deliver it and I think that people quite like it so I’m currently delving into the 100 Edition because the next one the one connected to the JDK 23 Premiere it will be one also big F for me because it will be 100 episode 100 issue of the newsletter so as small changes in with as well okay congrats by the way you mentioned Scala I’m making a video series about Java fix and now it’s used in companies and I discovered that a lot of people are combining Scala and Java evx because they like both Scala as the language Java vix as the UI framework and apparently that’s that’s a good match so I also add a few links to those
[1:01:19] Is very interesting language probably it’s a bit past is GL the most glorious days however it’s also going into interesting Direction so a bit more functional that it was in the past because it was object object oriented function Curr communities mostly delve into the M functional path of Scala however it’s very interesting interesting designed language and probably what is the most fun is being able to see compiler team working in your company and for example sharing the rfcs of the new features to the rest of the rest on the company slack that’s very cool to see something like that you probably have quite similar stuff in a well if I go back to that blog post I wrote about garbage collectors I could talk with six developers of garbage collectors within the company who were there from the start of java and having a lot of opinions about what’s good what’s not good how people should use it so that’s why it took a long time to write that blog post I believe by the way do you use any Java Scala tools to write your newsletter an automation you have there will be I will share a bit of a bit
[1:02:38] Of the work because I’m in Polish because I’m I’m fluent in English I can write in English however I think that my style is a bit more distinct if I write in Polish because my it’s my natural language in English I would just use the all I would say most more boring phrases that’s why okay my current workfl looks like that I’m writing in Polish and then I have prepressing stuff that okay was checking the checking factual stuff because I’m currently using llms a lot the first thing okay check if I didn’t mess up with something because I’m not using llms for right because I don’t believe they are able to create anything interesting however I use them for fact checks because they are quite good in that okay just go through that and check if I didn’t mess with something for the most things on the edge they are not able to do that because they do not have proper information in their models however for the past informations they are sometimes able to find something so I would say my editor is LM based and I’m using sematic C for that so it’s part of the my personal Java application and then I’m translating it once again
[1:03:52] Using the because they are very good in that so writing is done in Polish editor is done by the AI and translating is done by AI so I’m able to integrate those parts in the proess because I’m not able to okay this pretty interesting from my perspective because in past I’ve been working in for example humans who are able to check my English and check things like that however it was for a Weekly Newsletter it was too much because it was another another point in the process that you needed to wait for somebody and being able to deliver something each week on regular schedule you are not able to do that unfortunately it didn’t work for me so using AI for that it was pretty useful so to fful step and help me get for example better grammar get quality things like that with the same style I wanted to achieve because like I said I want Pino theend I never try okay I try maybe I tried to write something with AI however it’s that boring that I cannot fed one with it it’s it’s not something we should it’s the direction we should go yeah just writing everything by yourself then translating for that it’s
[1:05:08] Perfect though so you’re a perfect example of developers will not be replaced by llms and AI but they will be replaced by developers who know how to use them and integrate them in their workflow yeah okay I can say that way if you are not if you do not think AI will be useful for you are not able to Del you are not capable of delegating stuff because there’s a lot of small stuff you can delegate to the llms and that will make you more productive and I see that brings us back to the jeps there are some jeets related to Ai and llm and the vector API and all those other things with the memory improvement so we will see how Java will be able to cope with all these these evolutions so a bit of promotion I will be talking about that exact topic on devop so how all those small pieces in jebs are building the picture of java that will be more useful for model inference because it’s very interesting topic okay that was another marketing yeah a lot of marketing episode yeah I think we handled everything that I had on my list that I wanted to discuss is there anything you want to add Arthur
[1:06:25] Or s I just wanted to say that it was the pleasure so I had a lot of fun creating that episode yeah and pleasure was all mine and was very nice again to talk to you and to share what will be in Java 23 so people can from this week on get it from several sources several builds run it on all the platforms as they used to and start experimenting okay thanks a lot for your time yeah and I was going to say I guess you and I will talk again in six months time of course let’s stick already in the calendar some some dayses to record this yes 24 will be there in what is the release month I’m totally screwed upch March okay so see you again in March for the next episode also thank you to the listeners of this podcast keep an eye on Foojay for future articles and podcasts about development and everything related to the Java World thanks a lot byebye thank you give me a f give me a j give me the friends of OpenJDK
Found a mistake, or something to add? Edit this page on GitHub







Discussions on the previous Foojay site
1 comment left on this article in 2024, kept from the previous WordPress version of foojay.io. They are an archive and are closed for replies — use the discussion above to add to the conversation.
Does anyone have thoughts on possible solutions to this issue