From f4054c6b5ed003393914c0896727dc00c4427f84 Mon Sep 17 00:00:00 2001 From: Olya Gupalo Date: Mon, 11 Dec 2023 18:53:37 +0100 Subject: [PATCH] Update FunctionGraph Demo README --- functionGraphDemo/README.md | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/functionGraphDemo/README.md b/functionGraphDemo/README.md index 25b041652..fe25c220e 100644 --- a/functionGraphDemo/README.md +++ b/functionGraphDemo/README.md @@ -1,20 +1,23 @@ -# FunctionGraph Demo - Polyglot JavaScript, Java, R application +# FunctionGraph Demo - Polyglot JavaScript, Java, R Application -This repository contains the code for a demo application for [GraalVM](graalvm.org). +This is a multi-language application mixing JavaScript, Java, and R to demonstrate GraalVM polyglot capabilities. + +> This demo requires GraalVM R runtime version 22.3.1 or lower. ### Prerequisites -- GraalVM -- [Node.js support](https://www.graalvm.org/latest/reference-manual/js/NodeJS/) -- [Ruby support](https://www.graalvm.org/latest/reference-manual/ruby/) -- [R support](https://www.graalvm.org/latest/eference-manual/r/) +- [GraalVM 22.3.0 or lower](https://www.graalvm.org/) +- [GraalVM Node.js runtime](https://www.graalvm.org/22.3/reference-manual/js/NodeJS/) +- [GraalVM Ruby runtime](https://www.graalvm.org/22.3/reference-manual/ruby/) +- [GraalVM R runtime](https://www.graalvm.org/22.3/reference-manual/r/) ## Preparation -1. Download and install the latest GraalVM JDK with Node.js, R, and Ruby languages support, using the [GraalVM JDK Downloader](https://github.com/graalvm/graalvm-jdk-downloader). +1. Download and install GraalVM 22.3 with the Node.js, R, and Ruby languages support, using the [GraalVM JDK Downloader](https://github.com/graalvm/graalvm-jdk-downloader). ```bash - bash <(curl -sL https://get.graalvm.org/jdk) -c 'nodejs,R,ruby' + bash <(curl -sL https://get.graalvm.org/jdk) graalvm-ce-java17-22.3.0 -c 'nodejs,R,ruby' ``` + Follow the post-install message. 2. Download or clone GraalVM demos repository and navigate into the `functionGraphDemo` directory: ```bash @@ -26,10 +29,10 @@ This repository contains the code for a demo application for [GraalVM](graalvm.o 3. Build the application by running `npm install`. ```bash - $JAVA_HOME/bin/npm install + $JAVA_HOME/bin/npm install ``` -Now you are all set to run the polyglot JavaScript, Java, R application. +Now you are all set to run this polyglot application. ## Running the Application @@ -39,14 +42,10 @@ To run the application, you need to execute the `server.js` file providing `--j $JAVA_HOME/bin/node --jvm --polyglot server.js ``` -If you would like to run the benchmark on a different instance of Node, you can run it with whatever `node` you have. -However, usually the polyglot capability will not be supported and the app will not run successfully. - Open [localhost:8088](http://localhost:8088/) and enjoy the output. Play with the source code, for example, type `1 * 7` in a function field and press "Draw Function". Restart the application to see what else can you do with the mix of JavaScript, Java, and R. ## Debugging Polyglot Applications -GraalVM supports [debugging polyglot applications](https://www.graalvm.org/tools/chrome-debugger/) too, add the `--inspect` parameter to the command line, open the URL the application prints at the startup in Chrome browser. -You can debug, set breakpoints, evaluate expressions in this app in the JavaScript and R code alike. +GraalVM supports [debugging polyglot applications](https://www.graalvm.org/22.3/tools/chrome-debugger/) too, add the `--inspect` parameter to the command line, open the URL the application prints at the startup in Chrome browser. You can debug, set breakpoints, evaluate expressions in this app in the JavaScript and R code alike.