Hello Guest

Project panama

  • 12 Replies
  • 16570 Views
Project panama
« on: January 06, 2019, 21:35:27 »
Hello,

I just saw some "news" around project panama: a way better solution to use native code, more easily and more efficiently, perfect for LWJGL I guess.

They released a beta 0 on the main website : https://jdk.java.net/panama/

A youtube presentation: https://youtu.be/M-FPNBFAoSo
This video give some information about the use: annotations to describe the header, no need to modify the native library, some tool to generate the binding. He says that the firsts parts of this project could come soon into the JDK (mainly around the off-heap usage).

I guess it will simplify a lot LWJGL.

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: Project panama
« Reply #1 on: January 06, 2019, 23:42:55 »
Yes, it will. I'm reviewing every commit that goes into Project Panama, a lot of progress has been made but it's still not there yet.

*

Offline KaiHH

  • ****
  • 334
Re: Project panama
« Reply #2 on: January 07, 2019, 15:13:56 »
Here are more recent pre-built binaries: https://builds.shipilev.net/openjdk-panama/

*

Offline tlf30

  • **
  • 73
Re: Project panama
« Reply #3 on: March 17, 2020, 15:24:23 »
@Spasi, I was just checking up on the Panama project. It looks like they have made a lot of progress, but trying to find a roadmap for them is like pulling teeth.
Have you heard of any timeline for them? What are your thoughts on their progress?

Thanks,
Trevor

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: Project panama
« Reply #4 on: March 17, 2020, 16:29:09 »
I'm still following Panama's progress, but I will not start testing until it stabilizes. There are still too many API changes happening and the promised performance isn't there.

The latest bad news is that they're trying to shoehorn safety features into the memory access API. Which is hopeless without a) sacrificing performance or b) copying something like Rust (impossible). Not saying it's not a noble effort, but it will take more and more time to sort it all out. I would have preferred just being able to write C in Java (same semantics, same unsafety, same performance), then letting libraries like LWJGL handle and hide the nasty stuff.

On the performance front, there are still too many open issues with Hotspot that affect Panama performance, who knows when and if they'll be fixed.

And, as always, we're still waiting for Valhalla, which imho is a prerequisite for Panama to turn out nice. The good news is that I personally trust the engineers involved and they'll eventually figure out the best approach for both projects. However, the design and implementation issues are extremely hard and the process necessarily time-consuming.

*

Offline tlf30

  • **
  • 73
Re: Project panama
« Reply #5 on: March 24, 2020, 16:39:18 »
Thank you for the update!
I see that JDK14 is finally out... (for better or worse) I need to start looking into what they broke this time around. It looks like improvements have been made to gc though.

I guess we will not see the Panama project for a while then. Which is unfortunate, it would be great to get C++ support in LWJGL.

Anyways, thanks again for the update, you are much more in the loop on the project status than anyone else I have talked to.

~Trevor

*

Offline tlf30

  • **
  • 73
Re: Project panama
« Reply #6 on: November 20, 2020, 03:31:24 »
I see that Panama will be included as a preview in JDK 16. Exciting to see it finally making it into a JDK!

*

Offline tlf30

  • **
  • 73
Re: Project panama
« Reply #7 on: March 21, 2021, 03:28:36 »
JDK 16 is now out.
Any thoughts on the panama project so far? Is it going to be feasible to make lwjgl based on jdk 17 with panama instead of jni?

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: Project panama
« Reply #8 on: March 21, 2021, 15:59:51 »
It's looking better as time passes, but the API is still not stable. We're getting close now though, it would make sense to start the migration around the JDK 17 release date.

Performance-wise I'm not expecting miracles, but at least upcalls (i.e. C-to-Java callbacks) will be much faster than JNI.

*

Offline tlf30

  • **
  • 73
Re: Project panama
« Reply #9 on: March 24, 2021, 21:00:11 »
What does the C++ support look like? Is it functional, or just a dream at this point?

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: Project panama
« Reply #10 on: March 25, 2021, 07:51:30 »
C++ is not supported.

*

Offline tlf30

  • **
  • 73
Re: Project panama
« Reply #11 on: September 29, 2021, 02:48:48 »
Hello @Spasi, any new thoughts on Panama with JDK 17 out?
It is exciting to see JDK 17 out. I am disappointed that Adoptium is only releasing a JDK and not a JRE, but that is neither here nor there.

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: Project panama
« Reply #12 on: September 29, 2021, 05:12:39 »
The API released in JDK 17 is already obsolete: Finalizing the foreign APIs. The project will still be in incubation in JDK 18 and a preview is planned for JDK 19. My guess is that JDK 21, which will be the next LTS release in Sep 2023, will likely be the minimum requirement for projects like LWJGL wanting to target Panama.

I personally don't mind the delay. I would love to explore the API and how it applies to LWJGL before that, but my firm belief has always been that Panama without Valhalla is not that exciting. I'm sure Panama will get where it needs to be soon, but the extra couple of years should be enough time for Valhalla to mature and the final combo will be amazing. I'm also expecting that we'll see more major changes in the Panama API once Valhalla is available.