Skip to content

Commit

Permalink
Review and move espresso-shell demo to archive
Browse files Browse the repository at this point in the history
  • Loading branch information
olyagpl committed Dec 17, 2024
1 parent b84ba48 commit 5874f81
Show file tree
Hide file tree
Showing 41 changed files with 16 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
name: espresso-jshell
name: archive/espresso-jshell
on:
push:
paths:
- 'espresso-jshell/**'
- '.github/workflows/espresso-jshell.yml'
- 'archive/espresso-jshell/**'
- '.github/workflows/archive-espresso-jshell.yml'
pull_request:
paths:
- 'espresso-jshell/**'
- '.github/workflows/espresso-jshell.yml'
schedule:
- cron: "0 0 1 * *" # run every month
- 'archive/espresso-jshell/**'
- '.github/workflows/archive-espresso-jshell.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
run:
name: Run 'espresso-jshell'
name: Run 'archive/espresso-jshell'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
Expand All @@ -26,8 +24,8 @@ jobs:
distribution: 'graalvm'
components: 'espresso'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run 'espresso-jshell'
- name: Run 'archive/espresso-jshell
run: |
cd espresso-jshell
cd archive/espresso-jshell
./build-espresso-jshell.sh
echo "Math.PI" | ./espresso-jshell
echo "Math.PI" | ./espresso-jshell
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,23 +115,6 @@ cd graalvm-demos
</tbody>
</table>

### Java on Truffle (Espresso)

<table>
<thead>
<tr>
<th align="left">Name</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" width="30%"><a href="/espresso-jshell/">espresso-jshell</a><br><a href="https://github.com/graalvm/graalvm-demos/actions/workflows/espresso-jshell.yml"><img alt="espresso-jshell" src="https://github.com/graalvm/graalvm-demos/actions/workflows/espresso-jshell.yml/badge.svg" /></a></td>
<td align="left" width="70%">Demonstrates how to build a native executable of JShell, that executes the dynamically generated bytecode on Espresso<br><strong>Technologies: </strong>Java on Truffle, Native Image, JShell<br><strong>Reference: </strong><a href="https://www.graalvm.org/dev/reference-manual/java-on-truffle/demos/#mixing-aot-and-jit-for-java">Mixing AOT and JIT for Java</a>, <a href="https://medium.com/graalvm/java-on-truffle-going-fully-metacircular-215531e3f840">Java on Truffle — Going Fully Metacircular</a></td>
</tr>
</tbody>
</table>

### Micronaut

<table>
Expand Down
File renamed without changes.
15 changes: 7 additions & 8 deletions espresso-jshell/README.md → archive/espresso-jshell/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# Native JShell and Espresso: Mixing AOT and JIT for Java

This demo showcases the integration between [GraalVM Native Image](https://www.graalvm.org/reference-manual/native-image/) and [Java-on-Truffle (Espresso)](https://www.graalvm.org/reference-manual/java-on-truffle/).
It builds a native executable version of `jshell`, that executes the dynamically generated bytecodes on Espresso. This hybrid mode achieves instant startup, beating the vanilla `jshell` in both: time to the first interaction and time to evaluate a simple expression.
This demo showcases the integration between [GraalVM Native Image](https://www.graalvm.org/reference-manual/native-image/) and [Espresso (Java on Truffle)](https://www.graalvm.org/latest/reference-manual/espresso/).
It builds a native executable version of `jshell`, that executes the dynamically generated bytecode on Espresso. This hybrid mode achieves instant startup, beating the vanilla `jshell` in both: time to the first interaction and time to evaluate a simple expression.

JShell is a Java read-eval-print loop tool first introduced in Java 9, this demo also allows running `jshell` on Java 8.
For further discussions and questions please join our `#espresso` channel on the [GraalVM Slack Community](https://graalvm.slack.com/).

## Prerequisites

- GraalVM for Java 11, 17 or higher
- Native Image support
- Java-on-Truffle (Espresso) support
- Espresso (Java on Truffle) support

## Preparation

1. Download and install the latest GraalVM JDK with Native Image and Java on Truffle (Espresso) components using the [GraalVM JDK Downloader](https://github.com/graalvm/graalvm-jdk-downloader).
1. Download and install the GraalVM JDK with Native Image and Espresso support using the [GraalVM JDK Downloader](https://github.com/graalvm/graalvm-jdk-downloader).
```bash
bash <(curl -sL https://get.graalvm.org/jdk) -c 'espresso'
```
Expand All @@ -25,10 +24,10 @@ For further discussions and questions please join our `#espresso` channel on the
git clone https://github.com/graalvm/graalvm-demos
```
```bash
cd graalvm-demos/espresso-jshell
cd graalvm-demos/archive/espresso-jshell
```

## How to Build
## Building Native `jshell`

1. Execute the `build-espresso-jshell.sh` script:
```bash
Expand Down Expand Up @@ -97,4 +96,4 @@ Since the Java compiler is part of the host code compiled by `native-image`, dyn

### Learn more

Learn more about Java on Truffle on the [GraalVM website](https://www.graalvm.org/latest/reference-manual/java-on-truffle/).
Learn more about mixing JIT and native modes in the [official Espresso documentation](https://www.graalvm.org/latest/reference-manual/espresso/demos/#mixing-aot-and-jit-for-java).
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 5874f81

Please sign in to comment.