Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Kotlin 2.0 #692

Open
odenix opened this issue Oct 16, 2024 · 9 comments
Open

Update to Kotlin 2.0 #692

odenix opened this issue Oct 16, 2024 · 9 comments

Comments

@odenix
Copy link
Contributor

odenix commented Oct 16, 2024

Pkl currently uses Kotlin 1.7.
Kotlin 2.0 was released in May 2024.
2.0 offers many internal and user-facing improvements over 1.7.
Updating to 2.0 means that Pkl's Kotlin libraries will require Kotlin 2.0 or higher.

I'd love to take this on if I get the green light from the Pkl team.

@bioball
Copy link
Contributor

bioball commented Oct 16, 2024

So far, we've been capping Kotlin's version to that used by the minimum version of Gradle supported by pkl-gradle.
I'm not totally sure if we need to be doing, this, though. pkl-gradle uses a fat jar (pkl-tools) that includes the kotlin stdlib, so it might be okay to untether these two.

In general, I'm also not sure if we want to be on the bleeding edge of Kotlin, because it can be painful for our users to migrate the newer versions of our libraries. We don't actually have a policy in place here, but something like "we are compatible with Kotlin released two years ago" sounds like a good goal to have.

In both of these cases, it should be pretty safe to upgrade to Kotlin 1.8, but not totally sure about 2.0.

@odenix
Copy link
Contributor Author

odenix commented Oct 16, 2024

pkl-gradle shouldn’t impose any limitations (compatibility tests will be the judge).

I’d prefer to update to a Kotlin version that is actively maintained.
Kotlin 1.8 is EOL. Kotlin 1.9 is EOL to the best of my knowledge.
Kotlin 2.0 and 2.1 (currently in beta) are actively maintained.

Minimum Kotlin version supported by latest version of popular Kotlin libraries:

  • clikt (*): 2.0
  • kotest: 1.9 (master: 2.0)
  • kotlinpoet (*): 2.0
  • kotlinx-html (*): 1.9 (master: 2.0)
  • kotlinx-serialization (*): 2.0
  • ktor: 2.0

(*) used by Pkl

@bioball
Copy link
Contributor

bioball commented Oct 16, 2024

That's compelling. If Kotlin 1.9 EOL, that's a good enough reason to upgrade.

By the way, I don't see any materials from JetBrains themselves about this. But endoflife.date claims that 1.9 is EOL.

@jamesward do you have context, and can you advise here?

@odenix
Copy link
Contributor Author

odenix commented Oct 16, 2024

I couldn’t find official information either. Apparently such “formalities” aren’t JetBrain’s strength.
1.9 had some bugfix releases in early 2024, before 2.0 was released. 1.8 is clearly EOL.

@jamesward
Copy link
Contributor

Yeah, I don't think JetBrains has a concept of EOL for Kotlin. But older versions definitely don't get active updates. The latest 1.9 release was July 19, 2024 so not too long ago, and it was after the 2.0.0 release. So likely still some active critical fixes on 1.9.

@odenix
Copy link
Contributor Author

odenix commented Oct 16, 2024

The latest 1.9 release was July 19, 2024

FWIW I didn’t count 1.9.25 because it says “This is a technical release for IntelliJ IDEA.”
The last time JetBrains shipped a .30 release was Kotlin 1.5.30.
A 1.9.30 branch exists but looks abandoned.
I guess we’ll have to wait and see.

@StefMa
Copy link
Contributor

StefMa commented Oct 17, 2024

Please note that Jetbrains "only" changed the compiler backend in version 2.0, rather than shipping tons of new features or removing deprecated items (which is what the name might suggest). I guess there wouldn't be much difference in choosing version 2.0 over 1.9...

@odenix
Copy link
Contributor Author

odenix commented Oct 18, 2024

I'll send a PR after the 0.27 release.

@odenix
Copy link
Contributor Author

odenix commented Nov 11, 2024

I have a PR ready. I'll send it once fewer PRs are in flight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@jamesward @bioball @StefMa @odenix and others