Foreign Function & Memory API - A (Quick) Peek Under the Hood

Поділитися
Вставка
  • Опубліковано 12 лют 2024
  • JNI is, to date, the only way to access native libraries from Java code, but JNI's brittle and convoluted programming model makes it tedious to use at scale. But no more: JDK's 22 Foreign Function & Memory API provides a safe, modern and efficient way to access foreign memory and code from Java.
    Presented by Maurizio Cimadamore (Oracle)
    Recorded during FOSDEM 2024
    Try the FFM API in JDK 22!
    ◦ jdk.java.net/22/
    ◦ openjdk.org/jeps/454
    ◦ Subscribe to panama-dev@openjdk.org and send feedback! ➱ mail.openjdk.org/pipermail/pa...
    Generate FFM bindings with the jextract tool
    ◦ jdk.java.net/jextract/
    Build the latest version of the FFM API & jextract
    ◦ github.com/openjdk/panama-for...
    ◦ github.com/openjdk/jextract
    ◦ FOSDEM 2024 Free Java Devroom ➱ fosdem.org/2024/schedule/trac...
    Tags: #Java #OpenJDK #ProjectPanama
  • Наука та технологія

КОМЕНТАРІ • 10

  • @Nick-yd3rc
    @Nick-yd3rc Місяць тому

    That’s a much appreciated improvement over JNI no doubt, but that still feels like a lot of syntactic ceremony, especially for such trivial tasks. Any plans on a more implicit DSL?

  • @ClassXDevelopment
    @ClassXDevelopment 3 місяці тому +2

    using hashtables, String lookup for symbols. Can we say that's efficient ?
    Mik

  • @31redorange08
    @31redorange08 3 місяці тому +2

    14:34 Are typographic quotation marks for string literals a new feature of Java 22?

    • @delabassee
      @delabassee 3 місяці тому +2

      Nope... just an annoying PPT feature 🤫

    • @PeterVerhas
      @PeterVerhas 3 місяці тому

      They are unicode characters, so you can use them in string literals.

    • @31redorange08
      @31redorange08 3 місяці тому

      @@PeterVerhas I know. But that wasn't the question.

  • @nempk1817
    @nempk1817 3 місяці тому

    🍷🗿

  • @gsestream
    @gsestream 3 місяці тому +1

    do you want java to run as gpu shader/compute binary language, maybe just make a java to shader binary compiler instead

    • @gsestream
      @gsestream 3 місяці тому +1

      16-bit and 32-bit component color model functionality needs to be easily accessible in Color class, now only 8-bit component colors, even if you represent them in floats. best way to do this without changing any code depending on colors is to force internal representation to be floats without any forcing to 0-255 range in any way. then the components and red/green/blue give out the types fit to the data types, 8-bit or 16-bit or 32-bit, or even 64-bit doubles per component. the main point is that color class itself can be float component representation and sometimes it gets loaded with 0-255 limited color components, not predictable, clamps color in some cases.

    • @gsestream
      @gsestream 3 місяці тому

      one more improvement. Color class should have setComposite(Composite) function also, for a single color value, in same way as Graphics/2D class. yes for single pixel color operations, simply. or just a mixing function with another color when the composite has been set or is an argument in the function.