``` OpenJDK: 巴拿马 ```
OpenJDK: Panama

原始链接: https://openjdk.org/projects/panama/

Project Panama 旨在显著改善 Java 与非 Java API 的交互,特别是那些在 C 编程中常用的 API。这是一项多方面的努力,引入了诸如直接调用本机函数、无需复制即可访问本机数据以及 Java 虚拟机 (JVM) 内新的数据布局等功能。 关键组件包括 `jextract`——一个用于从本机头文件自动生成 Java 绑定的工具——以及对外部内存访问和函数调用的支持。Panama 还探索了针对本机代码交互的 JVM 优化,以及改进的库管理。 Panama 由 Hotspot 团队开发,作为一个孵化器运作,其组件最终将被纳入 JDK。积极的开发重点是外部支持和向量支持,一个遗留仓库现在被认为是不活跃的。最终,Panama 旨在弥合 Java 与更广泛的本机库世界之间的差距,从而提高性能和互操作性。

## OpenJDK Panama:改进Java的外部函数接口 最近的Hacker News讨论集中在OpenJDK的Panama项目,特别是其在外部函数接口(FFI)方面的进展。 这旨在改进Java与非Java代码的交互,为长期存在的Java本地接口(JNI)提供替代方案。 用户强调了Vector API(目前处于孵化阶段)提升性能的潜力,尤其是在数据密集型任务中,目前Kotlin Notebooks等替代方案表现不足。 虽然受到赞扬,但一些人批评Java“追赶”其他语言几十年来的功能,并将C#/.NET视为该领域的领导者。 对话还涉及Java创新的步伐,一些人认为这是一种渐进式的改进,而不是突破性的创新。 另一些人则为Java谨慎的方法辩护,更喜欢改进而不是快速采用新功能。 许多评论员指出最近的进步,例如垃圾收集改进(ZGC),作为持续开发的证据。 最终,这场讨论凸显了关于在像Java这样成熟的语言中,什么构成“创新”的争论。
相关文章

原文

We are improving and enriching the connections between the Java virtual machine and well-defined but “foreign” (non-Java) APIs, including many interfaces commonly used by C programmers.

To this end, Project Panama will include most or all of these components:

  • native function calling from JVM
  • native data access from JVM or inside JVM heap
  • new data layouts in JVM heap
  • native metadata definition for JVM
  • header file API extraction tools (jextract)
  • native library management APIs
  • native-oriented interpreter and runtime “hooks”
  • class and method resolution “hooks”
  • native-oriented JIT optimizations
  • tooling or wrapper interposition for safety
  • exploratory work with difficult-to-integrate native libraries

Community

This Project is sponsored by the Hotspot Group.

  • Mailing lists & News
  • Design documents
  • JEPs
  • Talks

Repository organization

Project Panama is designed to incubate a series of components for eventual inclusion in the JDK, via curated merge. Project Panama features are being actively developed in the following repositories:

  • Panama foreign support, which adds support for foreign memory access, as well as for foreign function calls;
  • Panama vector support, which adds vectorization support in Java through JVM intriniscs; and
  • jextract, a tool which mechanically generate Java bindings from native library headers.

The legacy Panama repository is also available here, although we do not expect to carry out further work there; as such this repository should not be used (and in the future we might make this more explicit by marking the legacy repository as read-only).

联系我们 contact @ memedata.com