Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Breaking language barriers with GraalVMs polyglotism

Milda
December 13, 2018
110

Breaking language barriers with GraalVMs polyglotism

GraalVMs polyglot feature overview slides

Milda

December 13, 2018
Tweet

Transcript

  1. Milda Glebauskaitė
    Breaking language barriers
    with GraalVMs polyglotism
    [email protected] twitter@mildagle

    View full-size slide

  2. Hi.
    I am Milda

    View full-size slide

  3. Introduction
    GraalVM allows you to write polyglot applications with a seamless way to pass values from one language to another.
    With GraalVM there is no copying or marshalling necessary as it is with other polyglot systems. This lets you achieve high
    performance when language boundaries are crossed. Most of the time there is no additional cost for crossing a
    language boundary at all.

    View full-size slide

  4. Why bother?
    https://www.emojicode.org/

    View full-size slide

  5. Why bother?
    https://en.wikipedia.org/wiki/List_of_programming_languages
    > 700

    View full-size slide

  6. WHAT WE CURRENTLY
    HAVE
    Implementation
    VM
    Implementation
    VM

    View full-size slide

  7. WHAT WE CURRENTLY
    HAVE
    Implementation
    VM

    View full-size slide

  8. WHAT WE CURRENTLY
    HAVE
    Implementation
    VM
    Java byte code

    View full-size slide

  9. Implementation
    VM

    View full-size slide

  10. WHAT WE CURRENTLY
    HAVE
    Nashorn

    View full-size slide

  11. How it works?
    https://chrisseaton.com/rubytruffle/dls15-interop/dls15-interop.pdf

    View full-size slide

  12. Read
    ...
    ...
    HOW IT WORKS
    Polyglot interoperability protocol
    JS C

    View full-size slide

  13. HOW IT WORKS
    =
    a
    .
    obj value

    View full-size slide

  14. HOW IT WORKS
    =
    a
    .
    obj value

    View full-size slide

  15. HOW IT WORKS
    =
    a
    obj value
    Read

    View full-size slide

  16. HOW IT WORKS
    =
    a Is C?
    obj value
    ->

    View full-size slide

  17. HOW IT WORKS

    View full-size slide

  18. Performance?

    View full-size slide

  19. The goal is similar level of performance
    as Java has

    View full-size slide

  20. Competitive performance

    View full-size slide

  21. Let’s try it!

    View full-size slide

  22. The
    downsides
    Not so seamless
    Maintenance
    Javascript, not NodeJS

    View full-size slide

  23. Valid
    use-cases Very specific tasks
    Migrating code
    from one language
    to another
    Reusing libraries

    View full-size slide

  24. Thank You
    [email protected] twitter@mildagle

    View full-size slide