Questions tagged [graalvm]

Graal is a just-in-time compiler for the JVM focused on peak performance and multi-language support. Graal offers performance advantages not only to Java code, but also to scripting languages such as JavaScript, Ruby, and R.

GraalVM is a universal virtual machine for running applications written in , , , , JVM-based languages like , , , , and LLVM-based languages such as and .

GraalVM removes the isolation between programming languages and enables interoperability in a shared runtime. It can run either standalone or in the context of OpenJDK, Node.js, Oracle Database, or MySQL.

Userful links:

Official site

GitHub

Wikipedia

752 questions
0
votes
1 answer

Running LLVM for C++ is not working on GraalVM docker container - oracle/graalvm-ce:19.1.1

I tried to execute simple cpp code from graalvm documents https://www.graalvm.org/docs/getting-started/#running-llvm-interpreter , it is giving below error. bash-4.2# lli --version LLVM (GraalVM CE Native 19.1.1) bash-4.2# clang++ -c -O1 -emit-llvm…
Prabu Subra
  • 353
  • 7
  • 17
0
votes
1 answer

Class does not implement org.graalvm.nativeimage.hosted.Feature error of Quarkus project with GraalVM native-image

I'm trying to compile sample Quarkus project to native image using GraalVM and Maven. Here is the code of my Quarkus service: package gk.testquarkus; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import…
Hleb
  • 7,037
  • 12
  • 58
  • 117
0
votes
3 answers

GraalVM/Polyglot: how to get SourceLocation programmatically

Is there a way to get the current source location (SourceSection) from java? e.g. a js script executed via context.eval() calls a java method, the java method logs the current js script name+line PolyglotException has a getSourceLocation() that…
th30z
  • 1,902
  • 1
  • 19
  • 28
0
votes
1 answer

Substrate VM generated binaries licensing issues

The SubstrateVM is licensed under GPLv2 and binaries compiled with the nativeimage ship with parts of the substractevm such as memory and thread management. Does that mean the binaries are also under GPLv2? Isn't the substratevm statically linked…
Luis Santos
  • 41
  • 1
  • 4
0
votes
1 answer

container_linux.go:247: invalid header field value - permission > denied - Problem with Quarkus native image on OpenShift

I'm trying to run a Quarkus native image application on Openshift 3.x. I've generated the native image in a Fedora machine following Quarkus' instructions: ./mvnw package -Pnative I've verified that the generated binary runs ok in the Fedora…
codependent
  • 23,193
  • 31
  • 166
  • 308
0
votes
3 answers

How can I pass a Map from Java to graal.js?

I have a Map in Scala/Java I want to be visible in Javascript running on graal.js engine. case class Thing() { def foo() { println("FOO!") } // just to see if this is callable from js (it is) val m = Map("foo" -> "bar", "one" -> 1) val d1 =…
Greg
  • 10,696
  • 22
  • 68
  • 98
0
votes
1 answer

GraalVM: How to implement compiler optimizations?

I want to develop a tool that performs certain optimizations in a program based on the program structure. For example, let's say I want to identify if-else within a loop, and my tool shall rewrite it into two loops. I want the tool to be able to…
Neo
  • 3,465
  • 5
  • 26
  • 37
0
votes
1 answer

GraalVM: Allow external scripts to have access to native compiled objects

I'm creating a java/groovy application that also supports scripting via groovy. There is a lot of legacy java code and new parts written in Groovy. Beyond that, the app is also scriptable with groovy. I can keep everything running under the VM and…
GnoSiS
  • 55
  • 8
0
votes
1 answer

what host object to use for javascript event handlers

I want to allow JavaScript to register events, with a syntax like object.on('eventName', (event) => { event.something(); }); The event object provides different methods depending on what 'eventName' is (depending on what type of event I'd like to…
theonlygusti
  • 11,032
  • 11
  • 64
  • 119
0
votes
0 answers

java type for javascript anonymous function

What data type will the javascript function like (event) => { event.preventDefault(); host.somethingsomething(); } be cast to in Java? I have host objects for event and for host. I don't know how to turn that ^^ into a function I can run in…
theonlygusti
  • 11,032
  • 11
  • 64
  • 119
0
votes
1 answer

set method on host object

public class Thing { public Thing() { } public void run() { } public void out(String s) { System.out.println(s); } } Context context = Context.create("js"); Value jsBindings =…
theonlygusti
  • 11,032
  • 11
  • 64
  • 119
0
votes
1 answer

allow javascript to control some environmental things

I want to use GraalVM to run user-written javascript code (I am writing a Java 11 project). Can I give Java objects to the javascript file, in javascript I want to write something like shrek.shedLayer(); and when my Java program executes this…
theonlygusti
  • 11,032
  • 11
  • 64
  • 119
0
votes
1 answer

Garbage collector is not supported by Graal

I am trying to run a Java program on GraalVM Community Edition 1.0 RC4 , the code works with last JDK 8 version. The code runs the same way with GraalVM but the same error message is printed in the console 100 times per second (I think every time…
Baptiste Merliot
  • 841
  • 11
  • 24
0
votes
1 answer

How to sandbox java using Graalvm

graal can sandbox js, ruby and other languages when create context, but how to sandbox a dynamic loaded jar? For example, how to sandbox a custom uploaded jar when used in flink as udf.
flypig
  • 43
  • 6
-1
votes
0 answers

GraalVM + Java. How to verify JS code before its execution?

I have Java with Spring Boot and Mvc + GraalVM. I have a specific endpoint (script/evaluate) that receives JavaScript code for execution. I want to validate(check some Syntax mistakes such as missing brackets....) this code before running via…