SlideShare a Scribd company logo
Salenda
GraalVM

with Groovy & Kotlin
Alberto De Ávila Hernández
A B O U T M E
✴ Team Lead at Salenda
✴ Groovy & Grails dev
✴ Atlassian certified
@alberto_deavila
S A L E N D A
S O F T WA R E D E V E L O P M E N T
Turnkey
development
Atlassian
Solution
Partner
Consulting and
support in
software
architecture and
analysis
Application
integration
Evolutionary support
of our own
developments or
inherited ones
@alberto_deavila
DISCLAIMER
Goals
G O A L S
✴ Increase our JVM performance
✴ Future of JVM
✴ Programming languagues interoperability
✴ System independence
✴ Serverless
@alberto_deavila
✴ GraalVM & features
✴ Show me more code
✴ Limits using GraalVM
✴ Future
S U M M A RY
@alberto_deavila
GraalVM
@alberto_deavila
first... what is Graal?
G R A A L
@alberto_deavila
A dynamic just-in-time compiler that
improves efficiency and speed
G R A A L
@alberto_deavila
A (JIT) compiler for Java transforms
bytecode to machine code
G R A A L
@alberto_deavila Source: https://www.dynatrace.com/news/blog/new-ways-introducing-compiled-code-java-9/
G R A A LV M A R Q U I T E C T U R E
@alberto_deavila Source: https://res.infoq.com/presentations/polyglot-jvm-graal/en/slides/sl13.jpg
@alberto_deavila
then... what is GraalVM?
G R A A LV M
@alberto_deavila
Ecosystem and shared runtime offering
performance advantages to multiples
languages
G R A A LV M
@alberto_deavila Source: https://www.graalvm.org/docs/
S U P P O R T E D L A N G U A G E S
@alberto_deavila
✴ Native support: 



✴ Support with installations: Ruby, Python, R
✴ JVM languages: Groovy, Kotlin, Java...
✴ LLVM: C, C++
✴ Javascript
✴ Graal: the JIT compiler
✴ Graal Polyglot APIs: API to combine
programming languages
✴ Graal SDK: embedding Graal and configure
native images
✴ Oracle HotSpot JVM
G R A A LV M
@alberto_deavila
@alberto_deavila
License
✴ Community edition: free to use
✴ Enterprise edition: Oracle support
G R A A L L I C E N S E
@alberto_deavila
@alberto_deavila
Features
✴ Interoperate with other languages
✴ Includes consoles for JS, R...
✴ Create compiled native images
✴ Run code faster & efficiently
✴ Tools to monitor, debug, and profile code
G R A A LV M F E AT U R E S
@alberto_deavila
@alberto_deavila
Interoperability
@alberto_deavila
How can we achieve that?
@alberto_deavila
Truffle
✴ Framework
✴ Allow to create languages interpreters
✴ Based on annotations
✴ Contains common things across any
language
G R A A LV M T R U F F L E
@alberto_deavila
G R A A LV M T R U F F L E
@alberto_deavila Source: https://res.infoq.com/presentations/polyglot-jvm-graal/en/slides/sl13.jpg
G R A A LV M I N T E R O P E R A B I L I T Y
@alberto_deavila
JS RubyPython
Source: https://www.graalvm.org/docs/reference-manual/polyglot/
G R A A LV M I N T E R O P E R A B I L I T Y
@alberto_deavila
JS RubyPython
Source: https://www.graalvm.org/docs/reference-manual/polyglot/
G R A A LV M I N T E R O P E R A B I L I T Y
@alberto_deavila
JS RubyPython
Source: https://www.graalvm.org/docs/reference-manual/polyglot/
G R A A LV M I N T E R O P E R A B I L I T Y
@alberto_deavila
Node with R
Source: https://docs.google.com/presentation/d/1cBuq4rjaNTOMJOOeGvqnI2TJjWH2VBId7NtVVhXWJkY/edit#slide=id.g495524223b_0_179
✴ Use the appropiate languague for any task
✴ Use libraries from differents languagues
✴ Create apps combining languages
✴ One environment for all requirements
G R A A LV M I N T E R O P E R A B I L I T Y
@alberto_deavila
@alberto_deavila
Native images
✴ Self-contained executable
✴ Fast startup
✴ Low memory consumption
✴ Can generate binary library
✴ Useful for lambdas, containers or command
line
G R A A LV M N AT I V E I M A G E S
@alberto_deavila
G R A A LV M N AT I V E I M A G E S
@alberto_deavila
GraalVM can generate native images BUT
not yet cross platform
Source: https://github.com/oracle/graal/issues/407
@alberto_deavila
Ahead-of-time compilation
✴ Analyze statically all code
✴ Compile reachable code
✴ Generates native code
✴ Package it with SubstrateVM
G R A A LV M A O T C
@alberto_deavila
✴ Framework subset of JVM
✴ No JIT
✴ No optimization
✴ No Graal neither any related with bytecode
✴ Just runtime: GC, threads, I/O, ...
G R A A LV M S U B S T R AT E V M
@alberto_deavila
G R A A LV M N AT I V E I M A G E S
@alberto_deavila Source: https://twitter.com/cstancu/status/1103413247305166849
@alberto_deavila
Performance
✴ Depends on code optimizations
✴ Native images startup time is very fast
✴ Each languague has different perfomance
G R A A LV M P E R F O R M A N C E
@alberto_deavila
G R A A LV M P E R F O R M A N C E
@alberto_deavila Source: https://lafo.ssw.uni-linz.ac.at/pub/papers/2016_PLDI_Truffle.pdf
G R A A LV M P E R F O R M A N C E
@alberto_deavila Source: https://2017.jokerconf.com/en/2017/talks/3qdblcadmqy0me2uuieqaq/
Twitter performance using Graal
@alberto_deavila
Tools
✴ Use one debugger for all languages, like
chrome-dev-tools
✴ VisualVM to show stats about other
languages
G R A A LV M T O O L S
@alberto_deavila
G R A A LV M T O O L S
@alberto_deavila Source: https://github.com/chrisseaton/graalvm-ten-things#5-tools-that-work-across-all-languages
G R A A LV M T O O L S
@alberto_deavila Source: https://github.com/chrisseaton/graalvm-ten-things#5-tools-that-work-across-all-languages
Show me more code
@alberto_deavila
Setup
✴ Download manually
✴ Use SDKman
✴ Docker
G R A A LV M S E T U P
@alberto_deavila
@alberto_deavila
SDKMAN!
✴ Install SDKMAN!
✴ Download GraalVM
G R A A LV M S E T U P W I T H S D K M A N !
@alberto_deavila
@alberto_deavila
Factorial
G R A A LV M FA C T O R I A L
@alberto_deavila
Groovy Class
G R A A LV M FA C T O R I A L
@alberto_deavila
Groovy Script
G R A A LV M FA C T O R I A L
@alberto_deavila
Trying to generate an image you'll get:
✴ You need some config:
G R A A LV M FA C T O R I A L
@alberto_deavila
Groovy
reflection.json
compiler.groovy
✴ Then you can compile code:

✴ And generate the image
G R A A LV M FA C T O R I A L
@alberto_deavila
Groovy
✴ Compile code

✴ Generate image
G R A A LV M FA C T O R I A L
@alberto_deavila
Kotlin
@alberto_deavila
Micronaut
✴ Generate native images from Micronaut app
✴ Java and Kotlin supported, Groovy partially
✴ Includes scripts or Dockerfile to generate it
✴ Generate automatically reflect.json
G R A A LV M + M I C R O N A U T
@alberto_deavila
✴ Create a Micronaut app
✴ Create a controller:
G R A A LV M M I C R O N A U T
@alberto_deavila
Kotlin
✴ Generate the image:
G R A A LV M M I C R O N A U T
@alberto_deavila
Kotlin
✴ Use it:
Limitations
✴ Evaluate static code at compile time
✴ No dynamic code
✴ Some strange exceptions appears
✴ Take long time to generate executable
✴ Only for Mac/Linux & 64 bits
L I M I TAT I O N S
@alberto_deavila
@alberto_deavila
Kotlin
K O T L I N L I M I TAT I O N S
@alberto_deavila Source: https://github.com/oracle/graal/issues/366#issuecomment-383547970
✴ Almost all features work
✴ Some bugs / features to work, like:
✴ Does not support compilation of non-
reducible loops
@alberto_deavila
Groovy
✴ Sometimes requires lot of changes / rewrite
✴ No metaprogramming
✴ Closures requires manual config
✴ Grape doesn't work on standalone native
images
G R O O V Y L I M I TAT I O N S
@alberto_deavila
G R O O V Y L I M I TAT I O N S
@alberto_deavila Source: https://e.printstacktrace.blog/graalvm-and-groovy-how-to-start/
L I M I TAT I O N S
@alberto_deavila Source: https://github.com/oracle/graal/blob/master/substratevm/LIMITATIONS.md
Future
F U T U R E
@alberto_deavila
✴ More languages and tools will be available
✴ Apps with many languages working
✴ A native image compatible with all OS
✴ Better perfomance
✴ ...
M O R E I N F O
@alberto_deavila
✴ Offial Doc
✴ List of resources for Graal and related topics
✴ Videos and presentations
✴ Top 10 things to do with GraalVM
✴ Kotlin performance with GraalVM
Thank you!
@alberto_deavila
Feedback:
https://greach.contestia.es

More Related Content

What's hot (20)

PDF
Jumping in Jakarta Open Source Project Everything nobody tells you
Roan Brasil Monteiro
 
PDF
Use Groovy&Grails in your spring boot projects
Paradigma Digital
 
PDF
Git with t for teams
Sven Peters
 
PDF
React native first impression
Alvaro Viebrantz
 
PDF
Moderne Android Builds mit Gradle
inovex GmbH
 
PDF
Building Command Line Tools with Golang
Takaaki Mizuno
 
PDF
Project52
Evan Lin
 
PDF
Getting started with Go - Florin Patan - Codemotion Rome 2017
Codemotion
 
PDF
Developing Apps With React Native
Alvaro Viebrantz
 
PDF
Improving your code design using Java
Roan Brasil Monteiro
 
PDF
Your First Slack Ruby Bot
Daniel Doubrovkine
 
PDF
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
Evan Lin
 
PDF
Managing releases effectively through git
Mohd Farid
 
PDF
Golang online course
bestonlinecoursescoupon
 
PDF
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
Evan Lin
 
PPTX
Building a Portable Testing Rig with GoConvey and Docker
Alison Rowland
 
PDF
XP Days Ukraine 2013 - Architecting for Continuous Delivery
Axel Fontaine
 
PDF
Git workflow step by step
Binh Quan Duc
 
PDF
All you need is front
Israel Gutiérrez
 
PDF
Integrating react in django while staying sane and happy
Fröjd Interactive
 
Jumping in Jakarta Open Source Project Everything nobody tells you
Roan Brasil Monteiro
 
Use Groovy&Grails in your spring boot projects
Paradigma Digital
 
Git with t for teams
Sven Peters
 
React native first impression
Alvaro Viebrantz
 
Moderne Android Builds mit Gradle
inovex GmbH
 
Building Command Line Tools with Golang
Takaaki Mizuno
 
Project52
Evan Lin
 
Getting started with Go - Florin Patan - Codemotion Rome 2017
Codemotion
 
Developing Apps With React Native
Alvaro Viebrantz
 
Improving your code design using Java
Roan Brasil Monteiro
 
Your First Slack Ruby Bot
Daniel Doubrovkine
 
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
Evan Lin
 
Managing releases effectively through git
Mohd Farid
 
Golang online course
bestonlinecoursescoupon
 
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
Evan Lin
 
Building a Portable Testing Rig with GoConvey and Docker
Alison Rowland
 
XP Days Ukraine 2013 - Architecting for Continuous Delivery
Axel Fontaine
 
Git workflow step by step
Binh Quan Duc
 
All you need is front
Israel Gutiérrez
 
Integrating react in django while staying sane and happy
Fröjd Interactive
 

Similar to Graalvm with Groovy and Kotlin - Greach 2019 (20)

PDF
Graalvm with Groovy and Kotlin - Madrid GUG 2019
Alberto De Ávila Hernández
 
PPT
Git workflows presentation
Mack Hardy
 
PDF
Emacs verilog-mode is coming to Debian, again
Kiwamu Okabe
 
PPTX
JavaScript All The Things
Jordan Yaker
 
PPTX
Intro. to Git and Github
Olmo F. Maldonado
 
PDF
Nitro for your Grails App: How to improve performance!! Greach' 18
Alberto Barón Cuevas
 
PDF
Nitro for your Grails App: how to improve performance. Greach '18
Alberto De Ávila Hernández
 
PDF
Grails @ Java User Group Silicon Valley
Sven Haiges
 
PPTX
Gear up for Continuous Integration with Salesforce DX, Circle CI and Clayton
Daniel Stange
 
PDF
GraphQL Bangkok Meetup 6.0
Tobias Meixner
 
PDF
Testing Grails 3, the goob (unit), the bad (integration) and the ugly (functi...
Alberto De Ávila Hernández
 
PPTX
Golang 101 for IT-Pros - Cisco Live Orlando 2018 - DEVNET-1808
Cisco DevNet
 
PDF
(Live) build and run golang web server on android.avi
SeongJae Park
 
PDF
Becoming a Git Master - Nicola Paolucci
Atlassian
 
ODP
Gopenflow demo v1 (english)
Hiroaki Kawai
 
PDF
Cross-platform Desktop application with AngularJS and build with Node-webkit
Wittawas Wisarnkanchana
 
PDF
No more conflicts - Jamstack that works for developers & business users with ...
Arisa Fukuzaki
 
PDF
Let’s be productive with spring boot
JUGBD
 
PDF
Use groovy & grails in your spring boot projects
Fátima Casaú Pérez
 
PDF
Monitoring at a SAAS Startup: Tradeoffs and Tools
bridgetkromhout
 
Graalvm with Groovy and Kotlin - Madrid GUG 2019
Alberto De Ávila Hernández
 
Git workflows presentation
Mack Hardy
 
Emacs verilog-mode is coming to Debian, again
Kiwamu Okabe
 
JavaScript All The Things
Jordan Yaker
 
Intro. to Git and Github
Olmo F. Maldonado
 
Nitro for your Grails App: How to improve performance!! Greach' 18
Alberto Barón Cuevas
 
Nitro for your Grails App: how to improve performance. Greach '18
Alberto De Ávila Hernández
 
Grails @ Java User Group Silicon Valley
Sven Haiges
 
Gear up for Continuous Integration with Salesforce DX, Circle CI and Clayton
Daniel Stange
 
GraphQL Bangkok Meetup 6.0
Tobias Meixner
 
Testing Grails 3, the goob (unit), the bad (integration) and the ugly (functi...
Alberto De Ávila Hernández
 
Golang 101 for IT-Pros - Cisco Live Orlando 2018 - DEVNET-1808
Cisco DevNet
 
(Live) build and run golang web server on android.avi
SeongJae Park
 
Becoming a Git Master - Nicola Paolucci
Atlassian
 
Gopenflow demo v1 (english)
Hiroaki Kawai
 
Cross-platform Desktop application with AngularJS and build with Node-webkit
Wittawas Wisarnkanchana
 
No more conflicts - Jamstack that works for developers & business users with ...
Arisa Fukuzaki
 
Let’s be productive with spring boot
JUGBD
 
Use groovy & grails in your spring boot projects
Fátima Casaú Pérez
 
Monitoring at a SAAS Startup: Tradeoffs and Tools
bridgetkromhout
 
Ad

Recently uploaded (20)

PDF
July Patch Tuesday
Ivanti
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Python basic programing language for automation
DanialHabibi2
 
July Patch Tuesday
Ivanti
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Python basic programing language for automation
DanialHabibi2
 
Ad

Graalvm with Groovy and Kotlin - Greach 2019

  • 1. Salenda GraalVM
 with Groovy & Kotlin Alberto De Ávila Hernández
  • 2. A B O U T M E ✴ Team Lead at Salenda ✴ Groovy & Grails dev ✴ Atlassian certified @alberto_deavila
  • 3. S A L E N D A
  • 4. S O F T WA R E D E V E L O P M E N T Turnkey development Atlassian Solution Partner Consulting and support in software architecture and analysis Application integration Evolutionary support of our own developments or inherited ones @alberto_deavila
  • 7. G O A L S ✴ Increase our JVM performance ✴ Future of JVM ✴ Programming languagues interoperability ✴ System independence ✴ Serverless @alberto_deavila
  • 8. ✴ GraalVM & features ✴ Show me more code ✴ Limits using GraalVM ✴ Future S U M M A RY @alberto_deavila
  • 11. G R A A L @alberto_deavila A dynamic just-in-time compiler that improves efficiency and speed
  • 12. G R A A L @alberto_deavila A (JIT) compiler for Java transforms bytecode to machine code
  • 13. G R A A L @alberto_deavila Source: https://www.dynatrace.com/news/blog/new-ways-introducing-compiled-code-java-9/
  • 14. G R A A LV M A R Q U I T E C T U R E @alberto_deavila Source: https://res.infoq.com/presentations/polyglot-jvm-graal/en/slides/sl13.jpg
  • 16. G R A A LV M @alberto_deavila Ecosystem and shared runtime offering performance advantages to multiples languages
  • 17. G R A A LV M @alberto_deavila Source: https://www.graalvm.org/docs/
  • 18. S U P P O R T E D L A N G U A G E S @alberto_deavila ✴ Native support: 
 
 ✴ Support with installations: Ruby, Python, R ✴ JVM languages: Groovy, Kotlin, Java... ✴ LLVM: C, C++ ✴ Javascript
  • 19. ✴ Graal: the JIT compiler ✴ Graal Polyglot APIs: API to combine programming languages ✴ Graal SDK: embedding Graal and configure native images ✴ Oracle HotSpot JVM G R A A LV M @alberto_deavila
  • 21. ✴ Community edition: free to use ✴ Enterprise edition: Oracle support G R A A L L I C E N S E @alberto_deavila
  • 23. ✴ Interoperate with other languages ✴ Includes consoles for JS, R... ✴ Create compiled native images ✴ Run code faster & efficiently ✴ Tools to monitor, debug, and profile code G R A A LV M F E AT U R E S @alberto_deavila
  • 27. ✴ Framework ✴ Allow to create languages interpreters ✴ Based on annotations ✴ Contains common things across any language G R A A LV M T R U F F L E @alberto_deavila
  • 28. G R A A LV M T R U F F L E @alberto_deavila Source: https://res.infoq.com/presentations/polyglot-jvm-graal/en/slides/sl13.jpg
  • 29. G R A A LV M I N T E R O P E R A B I L I T Y @alberto_deavila JS RubyPython Source: https://www.graalvm.org/docs/reference-manual/polyglot/
  • 30. G R A A LV M I N T E R O P E R A B I L I T Y @alberto_deavila JS RubyPython Source: https://www.graalvm.org/docs/reference-manual/polyglot/
  • 31. G R A A LV M I N T E R O P E R A B I L I T Y @alberto_deavila JS RubyPython Source: https://www.graalvm.org/docs/reference-manual/polyglot/
  • 32. G R A A LV M I N T E R O P E R A B I L I T Y @alberto_deavila Node with R Source: https://docs.google.com/presentation/d/1cBuq4rjaNTOMJOOeGvqnI2TJjWH2VBId7NtVVhXWJkY/edit#slide=id.g495524223b_0_179
  • 33. ✴ Use the appropiate languague for any task ✴ Use libraries from differents languagues ✴ Create apps combining languages ✴ One environment for all requirements G R A A LV M I N T E R O P E R A B I L I T Y @alberto_deavila
  • 35. ✴ Self-contained executable ✴ Fast startup ✴ Low memory consumption ✴ Can generate binary library ✴ Useful for lambdas, containers or command line G R A A LV M N AT I V E I M A G E S @alberto_deavila
  • 36. G R A A LV M N AT I V E I M A G E S @alberto_deavila GraalVM can generate native images BUT not yet cross platform Source: https://github.com/oracle/graal/issues/407
  • 38. ✴ Analyze statically all code ✴ Compile reachable code ✴ Generates native code ✴ Package it with SubstrateVM G R A A LV M A O T C @alberto_deavila
  • 39. ✴ Framework subset of JVM ✴ No JIT ✴ No optimization ✴ No Graal neither any related with bytecode ✴ Just runtime: GC, threads, I/O, ... G R A A LV M S U B S T R AT E V M @alberto_deavila
  • 40. G R A A LV M N AT I V E I M A G E S @alberto_deavila Source: https://twitter.com/cstancu/status/1103413247305166849
  • 42. ✴ Depends on code optimizations ✴ Native images startup time is very fast ✴ Each languague has different perfomance G R A A LV M P E R F O R M A N C E @alberto_deavila
  • 43. G R A A LV M P E R F O R M A N C E @alberto_deavila Source: https://lafo.ssw.uni-linz.ac.at/pub/papers/2016_PLDI_Truffle.pdf
  • 44. G R A A LV M P E R F O R M A N C E @alberto_deavila Source: https://2017.jokerconf.com/en/2017/talks/3qdblcadmqy0me2uuieqaq/ Twitter performance using Graal
  • 46. ✴ Use one debugger for all languages, like chrome-dev-tools ✴ VisualVM to show stats about other languages G R A A LV M T O O L S @alberto_deavila
  • 47. G R A A LV M T O O L S @alberto_deavila Source: https://github.com/chrisseaton/graalvm-ten-things#5-tools-that-work-across-all-languages
  • 48. G R A A LV M T O O L S @alberto_deavila Source: https://github.com/chrisseaton/graalvm-ten-things#5-tools-that-work-across-all-languages
  • 49. Show me more code
  • 51. ✴ Download manually ✴ Use SDKman ✴ Docker G R A A LV M S E T U P @alberto_deavila
  • 53. ✴ Install SDKMAN! ✴ Download GraalVM G R A A LV M S E T U P W I T H S D K M A N ! @alberto_deavila
  • 55. G R A A LV M FA C T O R I A L @alberto_deavila Groovy Class
  • 56. G R A A LV M FA C T O R I A L @alberto_deavila Groovy Script
  • 57. G R A A LV M FA C T O R I A L @alberto_deavila Trying to generate an image you'll get:
  • 58. ✴ You need some config: G R A A LV M FA C T O R I A L @alberto_deavila Groovy reflection.json compiler.groovy
  • 59. ✴ Then you can compile code:
 ✴ And generate the image G R A A LV M FA C T O R I A L @alberto_deavila Groovy
  • 60. ✴ Compile code
 ✴ Generate image G R A A LV M FA C T O R I A L @alberto_deavila Kotlin
  • 62. ✴ Generate native images from Micronaut app ✴ Java and Kotlin supported, Groovy partially ✴ Includes scripts or Dockerfile to generate it ✴ Generate automatically reflect.json G R A A LV M + M I C R O N A U T @alberto_deavila
  • 63. ✴ Create a Micronaut app ✴ Create a controller: G R A A LV M M I C R O N A U T @alberto_deavila Kotlin
  • 64. ✴ Generate the image: G R A A LV M M I C R O N A U T @alberto_deavila Kotlin ✴ Use it:
  • 66. ✴ Evaluate static code at compile time ✴ No dynamic code ✴ Some strange exceptions appears ✴ Take long time to generate executable ✴ Only for Mac/Linux & 64 bits L I M I TAT I O N S @alberto_deavila
  • 68. K O T L I N L I M I TAT I O N S @alberto_deavila Source: https://github.com/oracle/graal/issues/366#issuecomment-383547970 ✴ Almost all features work ✴ Some bugs / features to work, like: ✴ Does not support compilation of non- reducible loops
  • 70. ✴ Sometimes requires lot of changes / rewrite ✴ No metaprogramming ✴ Closures requires manual config ✴ Grape doesn't work on standalone native images G R O O V Y L I M I TAT I O N S @alberto_deavila
  • 71. G R O O V Y L I M I TAT I O N S @alberto_deavila Source: https://e.printstacktrace.blog/graalvm-and-groovy-how-to-start/
  • 72. L I M I TAT I O N S @alberto_deavila Source: https://github.com/oracle/graal/blob/master/substratevm/LIMITATIONS.md
  • 74. F U T U R E @alberto_deavila ✴ More languages and tools will be available ✴ Apps with many languages working ✴ A native image compatible with all OS ✴ Better perfomance ✴ ...
  • 75. M O R E I N F O @alberto_deavila ✴ Offial Doc ✴ List of resources for Graal and related topics ✴ Videos and presentations ✴ Top 10 things to do with GraalVM ✴ Kotlin performance with GraalVM