13 ms·
Java 22 Released
- melling 3y ago“Vector API (Seventh Incubator)” Seven iterations? What is going on with vectors in Java?
- exidex 3y agoThey said it is waiting for some feature from project Valhalla. Not sure which one though
- pron 3y agoThere are ad-hoc hacks in the JDK to avoid allocation for vectors; once we get some Valhalla features, vectors could be represented as plain value objects.
- GreenToad 3y ago"Vector API" is universal api for SIMD. It will probably remain in incubator until valhalla delivers value types.
- packetlost 3y agoIs there a timeline on Valhalla? I only loosely follow the Java ecosystem these days, but Valhalla is of particular interest to my performance-oriented mind.
- e3bc54b2 3y agoI follow up on valhalla every now and then. It looks few more releases away, probably not before next LTS. That being said, the amount of rigor with which the JDK devs test their experiments is really something to witness. Its equivalent to old school MS with painstaking maintenance at backwards compatibility, all the while moving the wheel of progress. Every single change so far has been planned with a decade of advanced planning because that's just how this ecosystem roles.
- voidfunc 3y agoMy understanding is it depends on Valhalla (value classes) and they basically keep updating it as that project changes.
- MrBuddyCasino 3y agoThe Foreign Memory API is in the works since 2014. They are just very diligent and careful.
- kaladin_1 3y agoYeah, given the amount of legacy infra built on Java. They don't have the luxury to move fast and break things.
- geodel 3y agoIt will go on until 'value classes' are incorporated in Java
- neonsunset 3y agoIf you're interested, there already is a somewhat similar language that offers first-class support for these.
- pkphilip 3y agoInteresting to see the developments on the String Templates API using the STR and fmt template processors.
- ludovicianul 3y agoIt gets interesting: https://mail.openjdk.org/pipermail/amber-spec-experts/2024-March/004062.html https://mail.openjdk.org/pipermail/amber-spec-experts/2024-M...
- oaiey 3y agoForeign Function Interface is one of the key advantages what C# had over Java (e.g. against huge APIs like Android or macOS). I am really curious how this JEP turns out.
- MaxBarraclough 3y agoFor anyone reading, here's a link to the page with detail on this project: https://openjdk.org/jeps/454 https://openjdk.org/jeps/454
- soulbadguy 3y agoThe FFI is also an artifact of CLR type system and the ability of have proper stack value based types.
- grishka 3y agoThey will eventually bring value types to Java with Project Valhalla.
- layer8 3y agoI wonder how long it will take. We’ve been waiting for ten years already.
- kaba0 3y agoOne design iteration already has a working, implemented branch available, it’s just one of the hardest designs to get right, to remain backwards compatible, to have it work nice with generics and all the other features, etc. So once they actually settle on a design (which they seem to have closed on quite a lot in the last couple of years), it might not take that long to happen.
- ivan_gammel 3y agoLooks like we may see a first preview in Java 23, i.e. already this year.
- grumpydude 3y agoUnrelated to Java, but it’s so refreshing to see a simple HTML page for once
- deleted 3y ago[deleted]
- didip 3y agoSweet, G1 keeps getting better for free. Time to cut a new build tag for this.
- ecshafer 3y agoIt isn't a "Sexy" PL change, but a full foreign function interface will be a huge change. In my experience, relying on the old java JNI based libraries seems to be one of the biggest things that break in upgrades. So I am hoping this will reduce the maintenance burden of Java.
- DarkNova6 3y agoBoring changes like these are what keeps Java interesting. New and shiny syntax sugar becomes stale real quick.
- owlstuffing 3y agoAs a modern language Java is still quite feature deficient. But you can use compiler plugins like the manifold project[1] to level up. 1. https://github.com/manifold-systems/manifold https://github.com/manifold-systems/manifold
- wmfiv 3y agoI see Manifold as a huge leap past previous tools Immutables or Lombok. I understand there's a use case where you want to add these language features to an existing code base. But for the most part if you want the language features on the JVM, you should probably just use Scala. That gives you a set of established patterns, best practices, libraries, and a community of users. If you want type safe SQL in particular, you can pry JOOQ out of my cold dead hands.
- owlstuffing 3y ago> just use Scala Scala is a dying language, anyone boarding that ship is making a mistake. Anyhow, I prefer Java supplemented with powerful features Scala doesn't have, such as type-safe SQL. > If you want type safe SQL in particular, you can pry JOOQ out of my cold dead hands. Jooq isn't bad, but it's not SQL, it's Java trying to be SQL. Manifold lets you write type-safe, native _SQL_ of any complexity directly in your code.
- krzyk 3y agoLinkable features https://openjdk.org/projects/jdk/22/ https://openjdk.org/projects/jdk/22/ For me personally the most interesting one is JEP461 (Stream Gatherers) https://openjdk.org/jeps/461 https://openjdk.org/jeps/461 This will allow addition of interesting stream operations.
- jimbokun 3y agoMaybe my favorite feature in this release: https://openjdk.org/jeps/463 https://openjdk.org/jeps/463 Finally solves the inscrutable Hello World program! Yes, it's just ergonomics for early beginners. But could be the difference in whether or not someone new to programming sticks with Java or not.
- kyawzazaw 3y agolove this!
- carimura 3y agoThe thought process leading up to this work https://openjdk.org/projects/amber/design-notes/on-ramp https://openjdk.org/projects/amber/design-notes/on-ramp
- coldpie 3y agoI 1000% agree. Though, a favorite early programming memory of mine was when static methods finally clicked and I went back and looked at all that boilerplate that meant nothing to me and it all became crystal clear what it meant and why it had to be like that.
- eddd-ddde 3y agoThis reminds me of when I finally understood why returning 0 from a function named main made sense.
- fuzztester 3y agoAnd why array indices start at 0 instead of 1, in many, though not all, programming languages.
- fuzztester 3y agohttps://en.m.wikipedia.org/wiki/Zero-based_numbering https://en.m.wikipedia.org/wiki/Zero-based_numbering
- cgijoe 3y agoSo does this fix the crashing issue with macOS Sonoma 14.4? https://arstechnica.com/gadgets/2024/03/usb-hubs-printers-java-and-more-seemingly-broken-by-macos-14-4-update/ https://arstechnica.com/gadgets/2024/03/usb-hubs-printers-ja...
- kaba0 3y agoI doubt Oracle would fix it, as this is definitely a kernel bug that breaks userspace. It is part of the POSIX spec what the JVM relies on, and MacOS is supposedly POSIX-compliant. So it should be Apple that fixed their bug.
- deleted 3y ago[deleted]
- jmyeet 3y agoExamples [1] of these features. [1]: https://www.happycoders.eu/java/java-22-features/ https://www.happycoders.eu/java/java-22-features/
- preommr 3y agoIt's kind of startling to see how many places still use Java 8, estimated at ~1/3 of projects according to a survey i just googled. And something like half that still use java 11.
- BroomOfSYS 3y agoUnbelievable! It is a strong signal that people don’t care and technical leadership is bad. Always the nonsense excuses of having to work on a “legacy” codebase for more than ten years with a team of 3 developers and 4 analysts.
- MBCook 3y ago8 reached EOL in the last year or two. I think 11 is still under LTS. Part of the problem is the changes made between 8 and 17 could be incredibly disruptive depending on your libraries. If they had stuck to not using sun.* stuff you were pretty safe, but a few very popular things did. Then somewhere in there a lot of the common server stuff moved from javax.* over to jakarta.*. Both were needed and very good, but could turn into dependency nightmares. So depending on your app/stack it wasn’t an easy transition. 17 is fantastic though, especially coming from 8. I’m excited about what’s already in 21 (latest LTS) and coming in the next LTS after that.
- agurk 3y ago> 8 reached EOL in the last year or two Java 8 is still under Extended Support until 2030 (and indefinite sustaining support). Java 11 left Premier Support September 2023. "Java SE 8 has gone through the End of Public Updates process for legacy releases. Oracle will continue to provide free public updates and auto updates of Java SE 8 indefinitely for Personal, Development and other Users via java.com". https://www.oracle.com/java/technologies/java-se-support-roadmap.html https://www.oracle.com/java/technologies/java-se-support-roa...
- Nullabillity 3y agoOracle JDK support is not the same as OpenJDK support (for both better and worse).
- jsnelgro 3y agoWhy would I use Java 22 over Kotlin?
- cupofjoakim 3y agoTo me the question "Why would I use X over Y?" in programming space is a bit redundant. Why would I use Kotlin over Closure? Why would I use Groovy over Scala? Even only considering JVM languages you run in to way too many options for the question in itself to be worth your time as a serious discussion. IMO - use whatever you and your team like best and that suits your needs. Java is great for hiring new devs and is arguably the most well established in an enterprise settings. If you want an actual answer: Personal preference.
- pjmlp 3y agoKotlin is a guest language, doesn't have nothing to call their own as platform.
- jsnelgro 3y agoAndroid?
- pjmlp 3y agoAndroid OS layer has zero Kotlin, and Google had to backtrack on their decision to let Java languish, as the Android ecosystem started to lose out on Java ecosystem, thus ART is now updatable via Play Store since Android 12, and Java 17 LTS is the latest supported version. Kotlin is only used on Jetpack Compose and a couple of AndroidX libraries, that you have to ship alongside the application. And as alternative to Groovy on Gradle build scripts. I expect this year's GDC to announce Java 21 LTS support.
- jsnelgro 3y agoInteresting, I don't develop for Android so I don't know the details in this space. Surprising to learn that the Android OS layer is 100% Java. In terms of a platform, I was more referring to the mass adoption of Kotlin for Android app development. 95% of the top 1,000 Android apps are written in Kotlin and adoption overall is > 50% according to their overview page https://kotlinlang.org/docs/android-overview.html https://kotlinlang.org/docs/android-overview.html IMO those numbers create a lot of staying power for the language.
- cryptos 3y agoAlthough I like Kotlin better, I'm really impressed how Oracle continues to improve Java. Some developers think Java is an old, cumbersome language, but it is indeed such a productive language and ecosystem with outstanding quality! Java has quite good support for functional programming, concise and immutable structs (called "records"), pattern matching, string templating, virtual threads, structured concurrency (preview for now), a vast ecosystem with outstanding quality, world class documentation, a fast and robust runtime and so on. Even after nearly 30 years, Java is still a good choice to start something new (e.g. a startup).
- munksbeer 3y agoIt is very trendy to hate java. Which is actually a good thing, because it means I get to continue to enjoy working with java alongside sensible professional developers, who quitely get on with writing excellent code and creating industry leading systems with java. Less competition for the roles and I don't have to work with fanboy types.
- thisislife2 3y agoNow this may seem like a silly question, but if I only want to run Java apps on macOS, what should I install from MacPorts? Searching for "JRE" gives no results. Searching for OpenJDK gives various options including: - OpenJDK21: https://ports.macports.org/port/openjdk21/details/ https://ports.macports.org/port/openjdk21/details/ , - openjdk21-zulu: https://ports.macports.org/port/openjdk21-zulu/details/ https://ports.macports.org/port/openjdk21-zulu/details/ - openjdk21-oracle: https://ports.macports.org/port/openjdk21-oracle/details/ https://ports.macports.org/port/openjdk21-oracle/details/ each of them having so many variants (see the links). What variant needs to be installed to just run a Java app?
- mike_hearn 3y agoUsually Java apps come with Java these days, like how there's no independent way to run Electron apps, it just comes with the download of the app itself. There are tools that make it easy like jpackage and (toots my own horn) https://www.hydraulic.dev https://www.hydraulic.dev If you want to just quickly run a fat jar then any will work. "openjdk21" is fine. The Zulu variant comes with JavaFX which simplifies things if your app needs that.
- thisislife2 3y agoFor sure, Java developers need to use a tool like yours to distribute their app. My experience with some Java applications was that running it triggered an attempt to download (I assume) the JRE, which I cancelled as I didn't know the source of download and didn't want it to download some PUA or malware. (I remember JRE for windows used to bundle some browser toolbar on windows). Hence my attemt to install it myself beforehand. But, since Oracle has stopped distributing latest JRE through Java.com for macOS, I looked for it in MacPorts. And it is really confusing - for example, if you look at the OpenJDK-Zulu port that you recommended - https://ports.macports.org/port/openjdk21-zulu/details/ https://ports.macports.org/port/openjdk21-zulu/details/ - it has 4 variants: 1. Applets ( Advertise the JVM capability "Applets".) 2.BundledApp ( Advertise the JVM capability "BundledApp". This is required by some java-based app bundles to recognize and use the JVM.) 3. JNI ( Advertise the JVM capability "JNI". This is required by some java-based app bundles to recognize and use the JVM.) 4. WebStart ( Advertise the JVM capability "WebStart".) - what the heck? I think I am better off without Java. :)