Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 1.58 KB

hands-on-graalvm.md

File metadata and controls

55 lines (40 loc) · 1.58 KB

autoscale: true footer: // Hands on GraalVM -> { created with ❤️ and ☕ by @LeanderReimer @qaware } slidenumbers: true

[.hide-footer] [.slidenumbers: false]

Hands on

[fit] GraalVM


original fit


GraalVM in a Nutshell

  • Polyglot Runtime: JVM Languages, R, JavaScript, NodeJS, Ruby, Python, C/C++ via LLVM
  • Ahead-of-time Compilation
    • Memory management, thread scheduling via SubstrateVM
  • GraalVM as a Platform
    • Embed and extend GraalVM with Truffle
    • Implement your own language and tools

[fit] Demos


Build CLIs with Picocli and GraalVM

  • Picocli is a framework to easily build JVM command line apps.
  • Support for ANSI colors, completion, sub commands, annotations and programmatic API.
  • Good support for GraalVM AOT Compilation to Native Images via the ReflectionConfigGenerator utility.
  • Native utilities and sidecar containers can now also be build using Java! Golang is still cool.

Polyglot Mayhem

  • The Graal Polyglot API allows you to embed and use different languages with full bidirectional interop.
private static void helloR(PolyglotMessage message) {
    try (Context context = Context.newBuilder().allowAllAccess(true).build()) {
        context.getPolyglotBindings().putMember("message", message);
        context.eval("R",
                "message <- import('message');" +
                "message$invocations <- message$invocations + 1;" +
                "print(message$text);");
    }
}
  • This is not the same as with the Java Scripting API (defined by JSR 223)!