Skip to content

Commit c26d43d

Browse files
committed
[GR-66235] Update reference manual entry pages.
PullRequest: graal/21254
2 parents 23ad7de + e0e4245 commit c26d43d

File tree

3 files changed

+19
-28
lines changed

3 files changed

+19
-28
lines changed

docs/reference-manual/embedding/embed-languages.md

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ permalink: /reference-manual/embed-languages/
2727

2828
The [GraalVM Polyglot API](https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/package-summary.html) lets you embed and run code from guest languages in Java host applications.
2929

30-
Throughout this section, you will learn how to create a host application in Java that runs on GraalVM and directly calls a guest language.
30+
Throughout this section, you will learn how to create a host application in Java that runs on GraalVM and directly calls a guest language.
3131
You can use the tabs beneath each code example to choose between JavaScript, R, Ruby, and Python.
3232

3333
> Note: The usage description for polyglot embeddings was revised with GraalVM for JDK 21 and Polyglot API version 23.1.0. If you are still using Polyglot API version older than 23.1.0, ensure the correct version of the documentation is displayed. More information on the change can be found in the [release notes](https://www.graalvm.org/release-notes/JDK_21/#graalvm-for-jdk-21).
@@ -40,23 +40,23 @@ See the [polyglot embedding demonstration](https://github.com/graalvm/polyglot-e
4040

4141
Here is an example Maven dependency setup that you can put into your project:
4242
```xml
43-
<dependency>
44-
<groupId>org.graalvm.polyglot</groupId>
45-
<artifactId>polyglot</artifactId>
43+
<dependency>
44+
<groupId>org.graalvm.polyglot</groupId>
45+
<artifactId>polyglot</artifactId>
4646
<version>${graalvm.polyglot.version}</version>
4747
</dependency>
48-
<dependency>
48+
<dependency>
4949
<groupId>org.graalvm.polyglot</groupId>
5050
<!-- Select a language: js, ruby, python, java, llvm, wasm, languages-->
51-
<artifactId>js</artifactId>
51+
<artifactId>js</artifactId>
5252
<version>${graalvm.polyglot.version}</version>
5353
<type>pom</type>
5454
</dependency>
5555
<!-- Add additional languages if needed -->
56-
<dependency>
57-
<groupId>org.graalvm.polyglot</groupId>
56+
<dependency>
57+
<groupId>org.graalvm.polyglot</groupId>
5858
<!-- Select a tool: profiler, inspect, coverage, dap, tools -->
59-
<artifactId>profiler</artifactId>
59+
<artifactId>profiler</artifactId>
6060
<version>${graalvm.polyglot.version}</version>
6161
<type>pom</type>
6262
</dependency>
@@ -68,7 +68,7 @@ Language and tool dependencies use the [GraalVM Free Terms and Conditions (GFTC)
6868
To use community-licensed versions instead, add the `-community` suffix to each artifact (for example, `js-community`).
6969
To access [polyglot isolate](#polyglot-isolates) artifacts, use the `-isolate` suffix instead (for example, `js-isolate`).
7070

71-
The artifacts `languages` and `tools` include all available languages and tools as dependencies.
71+
The artifacts `languages` and `tools` include all available languages and tools as dependencies.
7272
This artifact might grow or shrink between major releases.
7373
We recommend selecting only the needed language(s) for a production deployment.
7474

@@ -125,13 +125,12 @@ You can use this application with other code examples to demonstrate more advanc
125125

126126
Polyglot applications let you take values from one programming language and use them with other languages.
127127

128-
Use the code example in this section with your polyglot application to show how the Polyglot API can return JavaScript, Python, or Ruby functions as Java values.
128+
Use the code example in this section with your polyglot application to show how the Polyglot API can return JavaScript or Python functions as Java values.
129129

130130
{%
131131
include snippet-tabs
132132
tab1type="java" tab1id="Function_JS" tab1name="JavaScript" tab1path="embed/function_js.java"
133133
tab2type="java" tab2id="Function_Python" tab2name="Python" tab2path="embed/function_python.java"
134-
tab3type="java" tab3id="Function_Ruby" tab3name="Ruby" tab3path="embed/function_ruby.java"
135134
%}
136135

137136
In this code:
@@ -153,7 +152,6 @@ Use the code example in this section with your polyglot application to show how
153152
include snippet-tabs
154153
tab1type="java" tab1id="Access_JS" tab1name="JavaScript" tab1path="embed/access_js_from_java.java"
155154
tab2type="java" tab2id="Access_Python" tab2name="Python" tab2path="embed/access_python_from_java.java"
156-
tab3type="java" tab3id="Access_Ruby" tab3name="Ruby" tab3path="embed/access_ruby_from_java.java"
157155
%}
158156

159157
In this code:
@@ -183,7 +181,6 @@ Use the code example in this section with your polyglot application to show how
183181
include snippet-tabs
184182
tab1type="java" tab1id="Access_Java_from_JS" tab1name="JavaScript" tab1path="embed/access_java_from_js.java"
185183
tab2type="java" tab2id="Access_Java_from_Python" tab2name="Python" tab2path="embed/access_java_from_python.java"
186-
tab3type="java" tab3id="Access_Java_from_Ruby" tab3name="Ruby" tab3path="embed/access_java_from_ruby.java"
187184
%}
188185
189186
In this code:
@@ -221,7 +218,6 @@ Use the code example in this section with your polyglot application to show how
221218
include snippet-tabs
222219
tab1type="java" tab1id="Lookup_Java_from_JS" tab1name="JavaScript" tab1path="embed/lookup_java_from_js.java"
223220
tab2type="java" tab2id="Lookup_Java_from_Python" tab2name="Python" tab2path="embed/lookup_java_from_python.java"
224-
tab3type="java" tab3id="Lookup_Java_from_Ruby" tab3name="Ruby" tab3path="embed/lookup_java_from_ruby.java"
225221
%}
226222
227223
In this code:
@@ -248,7 +244,6 @@ Use the code example in this section with your polyglot application to see how y
248244
include snippet-tabs
249245
tab1type="java" tab1id="Proxy_JS" tab1name="JavaScript" tab1path="embed/proxy_js.java"
250246
tab2type="java" tab2id="Proxy_Python" tab2name="Python" tab2path="embed/proxy_python.java"
251-
tab3type="java" tab3id="Proxy_Ruby" tab3name="Ruby" tab3path="embed/proxy_ruby.java"
252247
%}
253248
254249
In this code:
@@ -425,7 +420,7 @@ This table shows the level of optimizations the Java runtimes currently provide:
425420
* **Optimized with additional compiler passes:** Oracle GraalVM implements additional optimizations performed during runtime compilation. For example, it uses a more advanced inlining heuristic. This typically leads to better runtime performance and memory consumption.
426421
* **Optimized via VM option:** Optimization is enabled by specifying `-XX:+EnableJVMCI` to the `java` launcher.
427422
* **Optimized via VM option and `--upgrade-module-path`:** Optimization is enabled by specifying `-XX:+EnableJVMCI` to the `java` launcher. Additionally, the Graal compiler must be downloaded as a JAR file and specified to the `java` launcher with `--upgrade-module-path`. In this mode, the compiler runs as a Java application and may negatively affect the execution performance of the host application.
428-
* **No runtime optimizations:** With no runtime optimizations or if JVMCI is not enabled, the guest application code is executed in interpreter-only mode.
423+
* **No runtime optimizations:** With no runtime optimizations or if JVMCI is not enabled, the guest application code is executed in interpreter-only mode.
429424
* **JVMCI:** Refers to the [Java-Level JVM Compiler Interface](https://openjdk.org/jeps/243) supported by most Java runtimes.
430425
431426
A project has been created to enable runtime optimization by default for Oracle JDK and OpenJDK.
@@ -442,8 +437,8 @@ Execution without runtime compilation will negatively impact the guest applicati
442437
443438
This indicates that the guest application is executed with no runtime optimizations enabled.
444439
The warning can be suppressed by either suppressing using the `--engine.WarnInterpreterOnly=false` option or the `-Dpolyglot.engine.WarnInterpreterOnly=false` system property.
445-
In addition, the `compiler.jar` file and its dependencies must be downloaded from [Maven Central](https://central.sonatype.com/artifact/org.graalvm.compiler/compiler/) and referred to use the option `--upgrade-module-path`.
446-
Note that `compiler.jar` must *not* be put on the module or class path.
440+
In addition, the `compiler.jar` file and its dependencies must be downloaded from [Maven Central](https://central.sonatype.com/artifact/org.graalvm.compiler/compiler/) and referred to use the option `--upgrade-module-path`.
441+
Note that `compiler.jar` must *not* be put on the module or class path.
447442
Refer to the [polyglot embedding demonstration](https://github.com/graalvm/polyglot-embedding-demo) for an example configuration using Maven or Gradle.
448443
449444
### Switching to the Fallback Engine
@@ -736,7 +731,7 @@ public class PolyglotIsolate {
736731
try (Context context = Context.newBuilder("js")
737732
.allowHostAccess(HostAccess.SCOPED)
738733
.option("engine.SpawnIsolate", "true").build()) {
739-
734+
740735
Value function = context.eval("js", "x => x+1");
741736
assert function.canExecute();
742737
int x = function.execute(41).asInt();
@@ -1091,7 +1086,7 @@ public final class CHANGE_NAME_EngineFactory implements ScriptEngineFactory {
10911086
private static final String LANGUAGE_ID = "<<INSERT LANGUAGE ID HERE>>";
10921087
```
10931088
1094-
Rename the class as desired and change the `LANGUAGE_ID` to the desired Truffle language (for example, "python" for GraalPy or "ruby" for TruffleRuby).
1089+
Rename the class as desired and change the `LANGUAGE_ID` to the desired Truffle language (for example, "python" for GraalPy or "js" for GraalJS).
10951090
To use it, include a `META-INF/services/javax.script.ScriptEngineFactory` file in your resources with the chosen class name.
10961091
This will allow the default `javax.script.ScriptEngineManager` to discover the language automatically.
10971092
Alternatively, the factory can be registered via `javax.script.ScriptEngineManager#registerEngineName` or instantiated and used directly.

docs/reference-manual/languages.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ permalink: /reference-manual/languages/
77

88
# Graal Languages
99

10-
GraalVM provides runtimes for JavaScript, Ruby, Python, and a number of other popular languages.
10+
GraalVM provides runtimes for JavaScript, Python, and a number of other languages.
1111
GraalVM's polyglot capabilities make it possible to mix multiple programming languages in a single application while eliminating any foreign language call costs.
1212

1313
If you are mostly interested in a specific language runtime on GraalVM, see the following:
1414
* [Espresso](java-on-truffle/README.md)
1515
* [GraalJS](https://github.com/oracle/graaljs/blob/master/docs/user/README.md)
1616
* [GraalPy](https://www.graalvm.org/python/docs/)
17-
* [GraalWasm](https://www.graalvm.org/webassembly/docs/)
18-
* [LLVM Languages](llvm/README.md)
19-
* [TruffleRuby](https://github.com/oracle/truffleruby/blob/master/doc/user/README.md)
17+
* [GraalWasm](https://www.graalvm.org/webassembly/docs/)

docs/reference-manual/reference-manuals.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,4 @@ If you are mostly interested in a specific language runtime on GraalVM, see the
2020
* [Espresso](java-on-truffle/README.md)
2121
* [GraalJS](https://github.com/oracle/graaljs/blob/master/docs/user/README.md)
2222
* [GraalPy](https://www.graalvm.org/python/docs/)
23-
* [GraalWasm](https://www.graalvm.org/webassembly/docs/)
24-
* [LLVM Languages](llvm/README.md)
25-
* [TruffleRuby](https://github.com/oracle/truffleruby/blob/master/doc/user/README.md)
23+
* [GraalWasm](https://www.graalvm.org/webassembly/docs/)

0 commit comments

Comments
 (0)