Skip to content

Commit 7505125

Browse files
olyagplfniephaus
authored andcommitted
Review and update GraalJS user documentation and project's README
1 parent 29ff209 commit 7505125

17 files changed

+958
-824
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# GraalVM JavaScript (Graal.js) Changelog
1+
# GraalJS Changelog
22

33
This changelog summarizes major changes between GraalVM versions of the GraalVM JavaScript (ECMAScript) language runtime.
44
The main focus is on user-observable behavior of the engine.

README.md

Lines changed: 78 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,120 @@
11
[![https://graalvm.slack.com](https://img.shields.io/badge/slack-join%20channel-active)](https://www.graalvm.org/slack-invitation/)
22

3-
A high performance implementation of the JavaScript programming language.
4-
Built on the GraalVM by Oracle Labs.
3+
# GraalJS
54

6-
The goals of GraalVM JavaScript are:
5+
GraalJS is a JavaScript engine implemented in Java on top of GraalVM.
6+
It is an ECMAScript-compliant runtime to execute JavaScript and Node.js applications, and includes all the benefits from the GraalVM stack including interoperability with Java.
7+
GraalJS is an open-source project.
78

8-
* Execute JavaScript code with best possible performance
9+
The goals of GraalJS are:
910
* [Full compatibility with the latest ECMAScript specification](docs/user/JavaScriptCompatibility.md)
10-
* Support Node.js applications, including native packages ([check](https://www.graalvm.org/compatibility/))
11-
* Allow simple upgrading from [Nashorn](docs/user/NashornMigrationGuide.md) or [Rhino](docs/user/RhinoMigrationGuide.md) based applications
12-
* [Fast interoperability](https://www.graalvm.org/reference-manual/polyglot-programming/) with Java, Scala, or Kotlin, or with other GraalVM languages like Ruby, Python, or R
13-
* Be embeddable in systems like [Oracle RDBMS](https://labs.oracle.com/pls/apex/f?p=LABS:project_details:0:15) or MySQL
14-
11+
* [Interoperability with Java](docs/user/JavaInteroperability.md)
12+
* Interoperability with WebAssembly using the JavaScript WebAssembly API
13+
* Running JavaScript with the best possible performance
14+
* Support for Node.js applications, including native packages
15+
* Simple upgrading from applications based on [Nashorn](docs/user/NashornMigrationGuide.md) or [Rhino](docs/user/RhinoMigrationGuide.md)
16+
* Embeddability in systems like [Oracle RDBMS](https://labs.oracle.com/pls/apex/f?p=LABS:project_details:0:15) or MySQL
1517

1618
## Getting Started
17-
The preferred way to run GraalVM JavaScript (a.k.a. GraalJS) is from a [GraalVM](https://www.graalvm.org/downloads/).
18-
As of GraalVM for JDK 21, (23.1), GraalVM JavaScript and Node.js runtimes are available as [standalone distributions](https://github.com/oracle/graaljs/releases) and [Maven artifacts](https://central.sonatype.com/artifact/org.graalvm.polyglot/js) (but no longer as GraalVM components).
19-
See the documentation on the [GraalVM website](https://www.graalvm.org/latest/reference-manual/js/) for more information on how to set up GraalVM JavaScript.
2019

21-
### Standalone Distribution
22-
To install GraalVM JavaScript using the [standalone distribution], simply download and extract the desired archive from the [GitHub Releases](https://github.com/oracle/graaljs/releases) page.
23-
The standalone archives for the JavaScript and Node.js distributions are named `graaljs[-community][-jvm]-<version>-<os>-<arch>.tar.gz` and `graalnodejs[-community][-jvm]-<version>-<os>-<arch>.tar.gz`, respectively.
24-
Four different available configurations are available for each component and platform combination:
20+
As of version 23.1.0, GraalJS is available as [Maven artifacts](https://central.sonatype.com/artifact/org.graalvm.polyglot/js).
21+
We also provide [standalone distributions](https://github.com/oracle/graaljs/releases) of the JavaScript and Node.js runtimes.
2522

26-
| Runtime | License | Archive Infix |
27-
| -------------| ------- | ---------------- |
28-
| Native | GFTC | _none_ |
29-
| JVM | GFTC | `-jvm` |
30-
| Native | UPL | `-community` |
31-
| JVM | UPL | `-community-jvm` |
23+
### Maven Artifacts
3224

33-
After installation, the `js` or `node` executable in the `bin` subdirectory can be used to run JavaScript files or Node modules, respectively.
34-
If no file is provided on the command line, an interactive shell (REPL) will be spawned.
25+
Thanks to GraalJS, you can easily embed JavaScript into a Java application.
26+
All necessary artifacts can be downloaded directly from Maven Central.
3527

36-
### Maven Artifact
37-
All required artifacts for embedding GraalVM JavaScript can be found in the Maven dependency group [`org.graalvm.polyglot`](https://central.sonatype.com/namespace/org.graalvm.polyglot).
28+
All artifacts relevant to embedders can be found in the Maven dependency group [org.graalvm.polyglot](https://central.sonatype.com/namespace/org.graalvm.polyglot).
3829

39-
Here is a minimal Maven dependency setup that you can copy into your `pom.xml`:
30+
Below is a minimal Maven dependency setup that you can copy into your _pom.xml_:
4031
```xml
4132
<dependency>
42-
<groupId>org.graalvm.polyglot</groupId>
43-
<artifactId>polyglot</artifactId>
44-
<version>23.1.0</version>
33+
<groupId>org.graalvm.polyglot</groupId>
34+
<artifactId>polyglot</artifactId>
35+
<version>${graaljs.version}</version>
4536
</dependency>
4637
<dependency>
47-
<groupId>org.graalvm.polyglot</groupId>
48-
<artifactId>js</artifactId>
49-
<version>23.1.0</version>
50-
<type>pom</type>
38+
<groupId>org.graalvm.polyglot</groupId>
39+
<artifactId>js</artifactId>
40+
<version>${graaljs.version}</version>
41+
<type>pom</type>
5142
</dependency>
52-
<!-- add additional languages and tools, if needed -->
5343
```
44+
This enables GraalJS which is built on top of Oracle GraalVM and licensed under the [GraalVM Free Terms and Conditions (GFTC)](https://www.oracle.com/downloads/licenses/graal-free-license.html).
45+
Use `js-community` if you want to use GraalJS built on GraalVM Community Edition.
5446

55-
See the [polyglot embedding demonstration](https://github.com/graalvm/polyglot-embedding-demo) on GitHub for a complete runnable example.
5647

57-
Language and tool dependencies use the [GraalVM Free Terms and Conditions (GFTC)](https://www.oracle.com/downloads/licenses/graal-free-license.html) license by default.
58-
To use community-licensed versions instead, add the `-community` suffix to each language and tool dependency, e.g.:
59-
```xml
60-
<dependency>
61-
<groupId>org.graalvm.polyglot</groupId>
62-
<artifactId>js-community</artifactId>
63-
<version>23.1.0</version>
64-
<type>pom</type>
65-
</dependency>
66-
```
67-
To access [polyglot isolate](https://www.graalvm.org/latest/reference-manual/embed-languages/#polyglot-isolates) artifacts (GFTC only), use the `-isolate` suffix instead (e.g. `js-isolate`).
48+
To access [polyglot isolate](https://www.graalvm.org/reference-manual/embed-languages/#polyglot-isolates) artifacts (GFTC only), use the `-isolate` suffix instead (e.g. `js-isolate`).
49+
50+
See the [polyglot embedding demonstration](https://github.com/graalvm/polyglot-embedding-demo) on GitHub for a complete runnable example.
6851

69-
If you prefer running it on a stock JVM, please have a look at the documentation in [`RunOnJDK.md`](https://github.com/graalvm/graaljs/blob/master/docs/user/RunOnJDK.md).
52+
You can use GraalJS with GraalVM JDK, Oracle JDK, or OpenJDK.
53+
If you prefer running on a stock JVM, have a look at [Run GraalJS on a Stock JDK](docs/user/RunOnJDK.md).
7054
Note that in this mode many features and optimizations of GraalVM are not available.
7155
Due to those limitations, running on a stock JVM is not a supported feature - please use a GraalVM instead.
7256

73-
## Documentation
57+
### Standalone Distributions
58+
59+
Standalone distributions are published on [GitHub](https://github.com/oracle/graaljs/releases).
60+
There are two language runtime options to choose from:
61+
- Native launcher compiled ahead of time with GraalVM Native Image;
62+
- JVM-based runtime.
63+
64+
To distinguish between them, a standalone that comes with a JVM has a `-jvm` infix in the name.
65+
Also, the GraalVM Community Edition version has `-community` in the name, for example, `graaljs-community-<version>-<os>-<arch>.tar.gz`.
7466

75-
Extensive documentation is available on [graalvm.org](https://www.graalvm.org/): see [Getting Started](https://www.graalvm.org/docs/getting-started/) and the more extensive [JavaScript and Node.js Reference Manual](https://www.graalvm.org/reference-manual/js/).
76-
In addition, there is documentation in the source code repository in the [`docs`](https://github.com/graalvm/graaljs/tree/master/docs) directory, for [users](https://github.com/graalvm/graaljs/tree/master/docs/user) and [contributors](https://github.com/graalvm/graaljs/tree/master/docs/contributor).
67+
Four different configurations are available for each component and platform combination:
7768

78-
For contributors, a guide how to build GraalVM JavaScript from source code can be found in [`Building.md`](https://github.com/graalvm/graaljs/tree/master/docs/Building.md).
69+
| Runtime | License | Archive Infix |
70+
| -------------| ------- | ---------------- |
71+
| Native | GFTC | _none_ |
72+
| JVM | GFTC | `-jvm` |
73+
| Native | UPL | `-community` |
74+
| JVM | UPL | `-community-jvm` |
7975

80-
## Current Status
76+
To install GraalJS from a standalone, download and extract the archive from the [GitHub Releases](https://github.com/oracle/graaljs/releases) page.
77+
After the installation, the `js` or `node` executable in the `bin` subdirectory can be used to run JavaScript files or Node modules, respectively.
78+
If no file is provided on the command line, an interactive shell (REPL) will be spawned.
8179

82-
GraalVM JavaScript is compatible with the [ECMAScript 2023 specification](https://262.ecma-international.org/14.0/).
83-
New features, e.g. `ECMAScript proposals` scheduled to land in future editions, are added frequently and are accessible behind a flag.
84-
See the [CHANGELOG.md](https://github.com/graalvm/graaljs/tree/master/CHANGELOG.md) for the proposals already adopted.
80+
## Node.js Runtime
8581

86-
In addition, some popular extensions of other engines are supported, see [`JavaScriptCompatibility.md`](https://github.com/graalvm/graaljs/tree/master/docs/user/JavaScriptCompatibility.md).
82+
GraalJS can run unmodified Node.js applications.
83+
GraalVM's Node.js runtime is based on a recent version of Node.js, and runs the GraalJS engine instead of Google V8.
84+
It provides high compatibility with the existing NPM packages.
85+
This includes NPM packages with native implementations.
86+
Note that some NPM modules may require to be recompiled from source with GraalJS (if they ship with binaries that have been compiled for Node.js based on V8).
8787

88-
### Node.js support
88+
Node.js is available as a separate [standalone distribution](#standalone-distributions).
89+
See [how to get started with Node.js](NodeJS.md).
8990

90-
GraalVM JavaScript can execute Node.js applications.
91-
It provides high compatibility with existing npm packages, with high likelihood that your application will run out of the box.
92-
This includes npm packages with native implementations.
93-
Note that some npm modules will require to be re-compiled from source with GraalVM JavaScript if they ship with binaries that have been compiled for Node.js based on V8.
94-
Node.js is a separate [standalone distribution](#standalone-distribution).
91+
## Documentation
9592

96-
### Compatibility on Operating Systems
93+
Extensive user documentation is available on the [website](https://www.graalvm.org/reference-manual/js/).
94+
In addition, there is documentation in this repository under [docs](https://github.com/oracle/graaljs/tree/master/docs), for [users](https://github.com/oracle/graaljs/tree/master/docs/user) and [contributors](https://github.com/oracle/graaljs/tree/master/docs/contributor).
95+
For contributing, see also a [guide on how to build GraalJS from source code](docs/Building.md).
9796

98-
The core JavaScript engine is a Java application and is thus in principle compatible with every operating system that provides a compatible JVM, [see `RunOnJDK.md`](https://github.com/graalvm/graaljs/tree/master/docs/user/RunOnJDK.md).
99-
We provide binary distributions and fully support GraalVM JavaScript on Linux (AMD64, AArch64), MacOS (AMD64, AArch64), and Windows (AMD64), currently.
97+
## Compatibility
10098

101-
## GraalVM JavaScript Reference Manual
99+
GraalJS is compatible with the [ECMAScript 2024 specification](https://262.ecma-international.org/).
100+
New features, new ECMAScript proposals, scheduled to land in future editions, are added frequently and are accessible behind an option.
101+
See the [CHANGELOG.md](CHANGELOG.md) for the proposals already adopted.
102102

103-
A reference manual for GraalVM JavaScript is available on the [GraalVM website](https://www.graalvm.org/reference-manual/js/).
103+
In addition, some popular extensions of other engines are supported. See [GraalJS Compatibility](docs/user/JavaScriptCompatibility.md).
104104

105-
## Stay connected with the community
105+
## Operating Systems Compatibility
106106

107-
See [graalvm.org/community](https://www.graalvm.org/community/) on how to stay connected with the development community.
108-
The channel _graaljs_ on [graalvm.slack.com](https://www.graalvm.org/slack-invitation) is a good way to get in touch with us.
109-
Please report JavaScript-specific issues on the [`oracle/graaljs`](https://github.com/oracle/graaljs/) GitHub repository.
107+
The core JavaScript engine is a Java application and is thus compatible with every operating system that provides a compatible JVM. See [Run GraalJS on a Stock JDK](docs/user/RunOnJDK.md).
108+
We provide binary distributions and fully support GraalJS on Linux (x64, AArch64), macOS (x64, AArch64), and Windows (x64), currently.
110109

111-
## License
110+
## Stay Connected with the Community
112111

113-
GraalVM JavaScript source code and community distributions are available under the following license:
112+
See [graalvm.org/community](https://www.graalvm.org/community/) for how to stay connected with the development community.
113+
The channel _graaljs_ on [graalvm.slack.com](https://www.graalvm.org/slack-invitation) is a good way to get in touch with the team behind GraalJS.
114+
Report any GraalJS-specific issues at the [oracle/graaljs](https://github.com/oracle/graaljs/) GitHub repository.
114115

115-
* [The Universal Permissive License (UPL), Version 1.0](https://opensource.org/licenses/UPL)
116+
## License
116117

117-
Non-community artifacts are provided under the following license:
118+
GraalJS source code and community distributions are available under the [Universal Permissive License (UPL), Version 1.0](https://opensource.org/licenses/UPL).
118119

119-
* [GraalVM Free Terms and Conditions (GFTC) including License for Early Adopter Versions](https://www.oracle.com/downloads/licenses/graal-free-license.html)
120+
Non-community artifacts are provided under the [GraalVM Free Terms and Conditions (GFTC) including License for Early Adopter Versions](https://www.oracle.com/downloads/licenses/graal-free-license.html).

0 commit comments

Comments
 (0)