oracle / graal

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀
https://www.graalvm.org
Other
20.23k stars 1.62k forks source link

Executing functions #1658

Open berombau opened 5 years ago

berombau commented 5 years ago

My use case is calling arbitrary functions from source code using the Polyglot API. The docs describe an example executing anonymous functions. Is it possible to evaluate a string containing function definitions and having these functions be named members of the resulting value?

My current approach is pasting a anonymous function using the name function at the bottom like (...args) => %functionName(...args).

chumer commented 5 years ago

Thanks for the suggestion! Not yet. But we discussed such a feature a few times already. We didn't get to it yet.

boris-spas commented 4 years ago

Tracking internally as Issue GR-20928.