Skip to content

Commit 84daad0

Browse files
committed
[GR-57679] Use Espresso project name instead of Java on Truffle.
PullRequest: graal/18692
2 parents 28e1526 + ecf5970 commit 84daad0

File tree

6 files changed

+193
-190
lines changed

6 files changed

+193
-190
lines changed

docs/reference-manual/java-on-truffle/Demos.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
layout: docs
33
toc_group: espresso
44
link_title: Demo Applications
5-
permalink: /reference-manual/java-on-truffle/demos/
5+
permalink: /reference-manual/espresso/demos/
6+
redirect_from: /reference-manual/java-on-truffle/demos/
67
---
78

89
# Running Demo Applications
910

10-
Java on Truffle is an implementation of the Java Virtual Machine Specification, which offers some interesting capabilities in addition to being able to run applications in Java or other JVM languages.
11+
Espresso is an implementation of the Java Virtual Machine Specification, which offers some interesting capabilities in addition to being able to run applications in Java or other JVM languages.
1112
For example, the enhanced [HotSwap capabilities](HotSwap.md) boosts developer productivity by enabling unlimited hot code reloading.
12-
Moreover, to illustrate what Java on Truffle can do, consider the following short examples.
13+
Moreover, to illustrate what Espresso can do, consider the following short examples.
1314

1415
## Mixing AOT and JIT for Java
1516

@@ -21,46 +22,45 @@ GraalVM Native Image technology allows compiling applications ahead-of-time (AOT
2122
The main trade off for using Native Image is that the analysis and compilation of your program happens under the closed world assumption, meaning the static analysis needs to process all bytecode which will ever be executed in the application.
2223
This makes using some language features such as dynamic class loading or reflection tricky.
2324

24-
Java on Truffle is a JVM implementation of a JVM bytecode interpreter, built on the [Truffle framework](../../../truffle/docs/README.md).
25+
Espresso is a JVM implementation of a JVM bytecode interpreter, built on the [Truffle framework](../../../truffle/docs/README.md).
2526
It is essentially a Java application, as are the Truffle framework itself and the GraalVM JIT compiler.
2627
All three of them can be compiled ahead-of-time with `native-image`.
27-
Using Java on Truffle for some parts of your application makes it possible to isolate the required dynamic behavior and still use the native executable on the rest of your code.
28+
Using Espresso for some parts of your application makes it possible to isolate the required dynamic behavior and still use the native executable on the rest of your code.
2829

2930
Consider a canonical Java Shell tool (JShell) as an example command line application.
3031
It is a REPL capable of evaluating Java code and consists of two parts:
3132
* the UI - CLI app handling input-output
3233
* the backend processor for running code you enter into Shell.
3334

34-
This design naturally fits the point we are trying to illustrate. We can build a native executable of the JShell's UI part, and make it include Java on Truffle to run the code dynamically specified at run time.
35+
This design naturally fits the point we are trying to illustrate. We can build a native executable of the JShell's UI part, and make it include Espresso to run the code dynamically specified at run time.
3536

36-
Prerequisites:
37-
* [Latest GraalVM](https://www.graalvm.org/downloads/)
38-
* [Java on Truffle](README.md#getting-started)
37+
#### Prerequisites:
38+
* [GraalVM JDK](https://www.graalvm.org/downloads/)
39+
* [Espresso](README.md#getting-started)
3940

40-
1. Clone the [project](https://github.com/graalvm/graalvm-demos) with the demo applications and navigate to the `espresso-jshell` directory:
41-
42-
```
41+
Clone the [project](https://github.com/graalvm/graalvm-demos) with the demo applications and navigate to the `espresso-jshell` directory:
42+
```shell
4343
git clone https://github.com/graalvm/graalvm-demos.git
4444
cd graalvm-demos/espresso-jshell
4545
```
4646

47-
The JShell implementation is actually the normal JShell launcher code, which only accepts Java on Truffle implementation (the project code-name is "Espresso") of the execution engine.
47+
The JShell implementation is actually the normal JShell launcher code, which only accepts Espresso implementation of the execution engine.
4848

4949
The "glue" code that binds the part which is AOT compiled with the component that dynamically evaluates the code is located in the `EspressoExecutionControl` class.
50-
It loads the JShell classes within the Java on Truffle context and delegate the input to them:
50+
It loads the JShell classes within the Espresso context and delegate the input to them:
5151

52-
```
53-
protected final Lazy<Value> ClassBytecodes = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$ClassBytecodes"));
54-
protected final Lazy<Value> byte_array = Lazy.of(() -> loadClass("[B"));
55-
protected final Lazy<Value> ExecutionControlException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$ExecutionControlException"));
56-
protected final Lazy<Value> RunException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$RunException"));
57-
protected final Lazy<Value> ClassInstallException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$ClassInstallException"));
58-
protected final Lazy<Value> NotImplementedException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$NotImplementedException"));
59-
protected final Lazy<Value> EngineTerminationException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$EngineTerminationException"));
60-
protected final Lazy<Value> InternalException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$InternalException"));
61-
protected final Lazy<Value> ResolutionException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$ResolutionException"));
62-
protected final Lazy<Value> StoppedException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$StoppedException"));
63-
protected final Lazy<Value> UserException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$UserException"));
52+
```shell
53+
protected final Lazy<Value> ClassBytecodes = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$ClassBytecodes"));
54+
protected final Lazy<Value> byte_array = Lazy.of(() -> loadClass("[B"));
55+
protected final Lazy<Value> ExecutionControlException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$ExecutionControlException"));
56+
protected final Lazy<Value> RunException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$RunException"));
57+
protected final Lazy<Value> ClassInstallException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$ClassInstallException"));
58+
protected final Lazy<Value> NotImplementedException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$NotImplementedException"));
59+
protected final Lazy<Value> EngineTerminationException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$EngineTerminationException"));
60+
protected final Lazy<Value> InternalException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$InternalException"));
61+
protected final Lazy<Value> ResolutionException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$ResolutionException"));
62+
protected final Lazy<Value> StoppedException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$StoppedException"));
63+
protected final Lazy<Value> UserException = Lazy.of(() -> loadClass("jdk.jshell.spi.ExecutionControl$UserException"));
6464
```
6565

6666
There is more code to pass the values correctly and transform the exceptions.
@@ -69,7 +69,7 @@ To try it out, build the `espresso-jshell` binary using the provided script, whi
6969
2. Build the JAR file
7070
3. Build a native executable
7171

72-
After the build you can observe the resulting binary file (`file` and `ldd` are Linux commands)
72+
After the build you can observe the resulting binary file (`file` and `ldd` are Linux commands):
7373
```shell
7474
file ./espresso-jshell
7575
ldd ./espresso-jshell
@@ -85,9 +85,9 @@ jshell> 1 + 1
8585
1 ==> 2
8686
```
8787

88-
Experiment with loading new code into JShell and see how Java on Truffle executes it.
88+
Experiment with loading new code into JShell and see how Espresso executes it.
8989

90-
Watch a video version of the mixing AOT and JIT compiled code with Java on Truffle demo.
90+
Watch a video version of the mixing AOT and JIT compiled code with the Espresso demo.
9191

9292
<div class="row">
9393
<div class="col-sm-12">
@@ -109,14 +109,14 @@ Watch a video version of the mixing AOT and JIT compiled code with Java on Truff
109109
<br>
110110

111111

112-
## GraalVM Tools with Java on Truffle
112+
## GraalVM Tools with Espresso
113113

114-
Java on Truffle is a proper part of the GraalVM ecosystem, and like other GraalVM-supported languages gets the support of developer tooling by default. The [Truffle framework](/graalvm-as-a-platform/language-implementation-framework/) integrates with the tools such as the debugger, profiler, memory analyzer, the [Instrumentation API](https://www.graalvm.org/truffle/javadoc/com/oracle/truffle/api/instrumentation/TruffleInstrument.html).
114+
Espresso is a proper part of the GraalVM ecosystem, and like other GraalVM-supported languages gets the support of developer tooling by default. The [Truffle framework](/graalvm-as-a-platform/language-implementation-framework/) integrates with the tools such as the debugger, profiler, memory analyzer, the [Instrumentation API](https://www.graalvm.org/truffle/javadoc/com/oracle/truffle/api/instrumentation/TruffleInstrument.html).
115115
The interpreter for a language needs to mark the AST nodes with some annotations to support those tools.
116116

117117
For example, to be able to use a profiler, a language interpreter needs to mark the root nodes.
118118
For the debugger purposes, the language expressions should be marked as instrumental, the scopes for the variables specified, and so on. The language interpreter does not need to integrate with the tools itself.
119-
As a result, you can profile a Java on Truffle program out of the box using either the CPU Sampler or Memory Tracer tools.
119+
As a result, you can profile a Java application on Espresso out of the box using either the CPU Sampler or Memory Tracer tools.
120120

121121
For example, if we have a class like the following one computing the prime numbers:
122122
```java
@@ -168,9 +168,9 @@ java -truffle --experimental-options --memtracer Main > output.txt
168168

169169
Other tools that GraalVM offers are [Chrome Debugger](../../tools/chrome-debugger.md), [Code Coverage](../../tools/code-coverage.md), and [GraalVM Insight](../../tools/insight/README.md).
170170

171-
Having the "out-of-the-box" support for the developer tooling makes Java on Truffle an interesting choice of the JVM.
171+
Having the "out-of-the-box" support for the developer tooling makes Espresso an interesting choice of the JVM.
172172

173-
Watch a short demonstration of GraalVM built-in tools for Java on Truffle.
173+
Watch a short demonstration of GraalVM built-in tools for Espresso.
174174

175175
<div class="row">
176176
<div class="col-sm-12">

docs/reference-manual/java-on-truffle/FAQ.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,54 @@
22
layout: docs
33
toc_group: espresso
44
link_title: FAQ
5-
permalink: /reference-manual/java-on-truffle/faq/
5+
permalink: /reference-manual/espresso/faq/
6+
redirect_from: /reference-manual/java-on-truffle/faq/
67
---
78

89
# Frequently Asked Questions
910

1011
### Does Java running on Truffle implement the Java language running as a Truffle interpreter?
1112

1213
Not quite: it implements the Java Virtual Machine running as a Truffle interpreter.
13-
That means it can only run a Java program once it has been compiled to Java bytecode (classes, JAR files, etc.) with your favorite Java compiler (for example, `javac`) or a build tool (Maven, Gradle, etc.).
14+
That means it can only run a Java program once it has been compiled to Java bytecode (classes, JAR files, and so on) with your favorite Java compiler (for example, `javac`) or a build tool (Maven, Gradle, and so on).
1415
In the GraalVM family, this is similar to WebAssembly or the LLVM interpreter: while both can run C programs, they have to be compiled by a C compiler first.
1516

1617
### Does Java running on Truffle run on the HotSpot JVM too?
17-
Like other languages implemented with the [Truffle framework](../../../truffle/docs/README.md), it can run both as a native executable or on top of the HotSpot JVM.
18-
Running on top of the HotSpot JVM is currently only possible on Linux x64 and macOS x64.
18+
19+
Like other languages implemented with the [Truffle framework](../../../truffle/docs/README.md), it can run both as a native executable or on the HotSpot JVM.
20+
Running on the HotSpot JVM is currently only possible on Linux x64 and macOS x64.
1921
We plan to extend this capability to other platforms.
2022

21-
### Does running Java on Truffle require the HotSpot JVM?
23+
### Does running Espresso require the HotSpot JVM?
2224

2325
No, it doesn't, it works fine as a native executable.
24-
Java on Truffle does require a standard core Java library (the _rt.jar_ library for Java 8 or the `lib/modules` file for Java 11+ as well as the associated native libraries: `libjava`, `libnio`, etc.).
26+
Espresso does require a standard core Java library (the _rt.jar_ library for Java 8 or the `lib/modules` file for Java 11+, as well as the associated native libraries: `libjava`, `libnio`, and so on).
27+
28+
### Running Java on GraalVM already brings the highest level of optimization, what benefits will Espresso give me?
2529

26-
### Running Java on GraalVM already brings the highest level of optimization, what benefits will Java on Truffle give me?
27-
- Java on Truffle will inherit the extensive tooling provided by the Truffle framework. This means that for the things like code coverage and profiling you would no longer need to rely on external tools.
28-
- Another important aspect is that Java on Truffle comes with improved isolation of the host Java VM and the Java program running on Truffle.
29-
- Moreover, Java on Truffle can run in the context of a native executable while still allowing dynamically-loaded bytecode!
30+
- Espresso inherits the extensive tooling provided by the Truffle framework. This means that for code coverage and profiling you would no longer need to rely on external tools.
31+
- Another important aspect is that Espresso comes with improved isolation of the host Java VM and the Java program running on Truffle.
32+
- Moreover, Espresso can run in the context of a native executable while still allowing dynamically-loaded bytecode!
3033
- Finally, you can enjoy the benefits of enhanced HotSwap capabilities which will help boost your productivity.
3134

32-
### What is the license for Java on Truffle?
33-
Java on Truffle is an implementation of the Java Virtual Machine. It is open source and is offered as free software under the [GNU General Public License version two (GPLv2)](https://github.com/oracle/graal/blob/master/tools/LICENSE).
35+
### What is the license for Espresso?
36+
37+
Espresso is an implementation of the Java Virtual Machine. It is open source and is offered as free software under the [GNU General Public License version two (GPLv2)](https://github.com/oracle/graal/blob/master/tools/LICENSE).
38+
39+
### Can I run Espresso in production?
3440

35-
### Can I run Java on Truffle in production?
3641
Yes, you can on Linux x64. Support for other platforms is still experimental.
3742

38-
### What performance can I expect from executing Java on Truffle?
43+
### What performance can I expect from executing Espresso?
44+
3945
Performance is currently 2-3x slower than the HotSpot JVM.
40-
It does not match the speed offered by GraalVM yet for sure, but having created a fully-working Java on Truffle runtime, the development team is now focusing on making it as performant as the GraalVM JIT.
46+
It does not match the speed offered by GraalVM yet for sure, but having created a fully-working Espresso runtime, the development team is now focusing on making it as performant as the GraalVM JIT.
4147

4248
### Can I embed Java running on Truffle in my application?
49+
4350
Yes, you can use [GraalVM's Polyglot API](https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/package-summary.html) to run Java bytecode in a separate context from the host Java VM.
44-
You can even embed a Java 8 context in a Java 11, 17 or 21 application (using the option `--java.JavaHome=/path/to/jdk8`).
51+
You can even embed a Java 8 context in a Java 11, 17, or 21 application (using the option `--java.JavaHome=/path/to/jdk8`).
4552

4653
### Why do I see "Unrecognized option: -javaagent:.../idea_rt.jar..." when I try to run my app from the IDE?
47-
It is not possible to attach an agent to Java on Truffle. For the time being, add: `-XX:+IgnoreUnrecognizedVMOptions` to the VM options too.
54+
55+
It is not possible to attach an agent to Espresso. For the time being, add `-XX:+IgnoreUnrecognizedVMOptions` to the VM options.

0 commit comments

Comments
 (0)