Key to creating world-class solutions lies in the effectivity of cross-team collaboration and lead time. When multiple teams involved in a project, it is critical to take cross-platform and cross-language aspects into account. Introducing GraalVM, a universal virtual machine created to address an issue of teams struggling to collaborate because of varying preference of programming languages.
In this session, we will look at how you can use GraalVM to create polyglot applications with ease. It is a hands-on live coding session where we will look at Ruby, NodeJS & Java interoperability.
1. How to create Polyglot Applications using
GraalVM
@owais_zahid
@owaiszahid
2. Know your speaker
• Software Development Manager at Autodesk
• Over 14 years of experience working around the globe
• Focus areas
• Cloud Platforms
• Resiliency and Scalability
• Love to code in JavaScript
• Avid fan of AS ROMA @owais_zahid
@owaiszahid
4. What to do for
Interoperability
Apache
Thrift
Swig
Protocol
Buffer
Java Native
Interface
AWS Layers
and Runtime
GraalVM
And many
more…
5. What is
GraalVM
GraalVM is a polyglot (multi-
lingual) Virtual Machine
Allows a common stack for
applications running in JavaScript,
Python, Ruby, Java, Scala, C / C++ n
many more.
Provides interoperability in a
shared runtime
6. JEP 243 (JVMCI) JEP 295 (AOTC)
Java HotSpot VM SubstrateVM
Graal VM Architecture
7. JEP 243 (JVMCI) JEP 295 (AOTC)
Java HotSpot VM SubstrateVM
Graal Compiler
11. Truffle
Language implementation framework
Currently supports Ruby, Python, R
Provision to support new languages
Works with Graal
Compiler to provide
Low-overhead language
interoperations
Language agnostic
instrumentation
12. Sulong
LLVM bitcode interpreter based
on truffle framework
Support C/C++, Fortran and all
languages that can be
converted to LLVM bitcode
13. Ahead of
Time
Compilation
Create Native Image with Graal AOT
Compilation
Substrate VM executes native code
Reduces startup time and lower runtime
memory overheads
AOT support added in JDK 9
(experimental). See JEP 295
14. Native vs JVM
• Graal supports two modes of
execution
• JVM
Better peak performance and
support for dynamic programming
• Native
Better startup time and lesser
memory footprint
15. Should I be using Graal?
This Photo by Unknown Author is licensed under CC BY-SA-NC
24. Demo # 4
Graal Tools
You can’t optimize what you can’t measure
- Ilya Grigorik
25. Lesson
Learns
Better suited for custom code, libraries
and SDKs
There are some performance gaps in
truffle implementations
JDK 10+ is recommended for
containerize applications
Not widely used in production apps
(yet!)