You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user/FAQ.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,19 +3,19 @@
3
3
### Does module/package XYZ work on GraalVM's Python runtime?
4
4
5
5
It depends, but is currently unlikely.
6
-
The first goal with GraalVM's Python implementation was to show that NumPy and related packages can run using the managed GraalVM LLVM runtime.
6
+
The first goal with GraalVM's Python runtime was to show that NumPy and related packages can run using the managed GraalVM LLVM runtime.
7
7
The GraalVM team continues to improve the number of passing CPython unittests, and to track the compatibility with popular PyPI packages.
8
8
9
-
### Can the GraalVM Python implementation replace my Jython use case?
9
+
### Can the GraalVM Python runtime replace my Jython use case?
10
10
11
11
It can, but there are some caveats, like Python code subclassing Java classes or use through the `javax.script.ScriptEngine` not being supported.
12
12
See the [Jython Compatibility](Jython.md) guide for details.
13
13
14
14
### Do I need to compile and run native modules as LLVM bitcode to use on GraalVM's Python runtime?
15
15
16
-
If you want to run C extensions or use certain built-in features, yes, you need to build the module with GraalVM's Python implementation, and then it will run using the GraalVM LLVM runtime.
16
+
If you want to run C extensions or use certain built-in features, yes, you need to build the module with GraalVM's Python runtime, and then it will run using the GraalVM LLVM runtime.
17
17
However, many of the core features of Python (including, e.g., large parts of the `os` API) are implemented in pure Java and many standard library modules and packages work without running any LLVM bitcode.
18
-
So even though the Python implementation depends on the GraalVM LLVM runtime, for many use cases
18
+
So even though the Python runtime depends on the GraalVM LLVM runtime, for many use cases
19
19
you can disallow native modules entirely.
20
20
21
21
### Can I use the GraalVM sandboxing features with Python?
@@ -29,7 +29,7 @@ Also, GraalVM's managed execution mode for LLVM fully works for running extensio
29
29
30
30
The team is continuously working to ensure all polyglot features of GraalVM work as a Python user would expect.
31
31
There are still many cases where expectations are unclear or where multiple behaviors are imaginable.
32
-
The team is actively looking at use cases and continuously evolving the Python implementation to provide the most
32
+
The team is actively looking at use cases and continuously evolving the GraalVM Python runtime to provide the most
33
33
convenient and least surprising behaviour.
34
34
35
35
### What performance can I expect from GraalVM's Python runtime?
@@ -45,5 +45,5 @@ In any case, both with Native Image or when running on the JVM, you first need t
45
45
46
46
### Can I share warmed-up code between multiple Python contexts?
47
47
48
-
Yes, this works, and you will find that starting up multiple contexts in the same engine, and running the same or similar code in them will get increasingly faster, because the compiled code is shared across contexts.
48
+
Yes, this works, and you will find that starting up multiple contexts in the same engine, and running the same or similar code in them will get increasingly faster, because the compiled code is shared across contexts.
49
49
However, the peak performance in this setup is currently lower than in the single context case.
Copy file name to clipboardExpand all lines: docs/user/Jython.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ methods:
59
59
Method overloads are resolved by matching the Python arguments in a best-effort manner to the available parameter types.
60
60
This also happens during when data conversion.
61
61
The goal here is to make using Java from Python as smooth as possible.
62
-
The matching allowed here is similar to Jython, but GraalVM's Python implementation uses a more dynamic approach to matching — Python types emulating `int` or `float` are also converted to the appropriate Java types.
62
+
The matching allowed here is similar to Jython, but GraalVM's Python runtime uses a more dynamic approach to matching — Python types emulating `int` or `float` are also converted to the appropriate Java types.
63
63
This allows, for example, to use Pandas frames as `double[][]` or NumPy array elements as `int[]` when the elements fit into those Java primitive types.
Copy file name to clipboardExpand all lines: docs/user/ParserDetails.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ the SST and scope tree are serialized such a file.
28
28
29
29
## Creating and Managing pyc Files
30
30
31
-
#### `.pyc` files are created automatically by the GraalVM Python implementation when no or an invalid `.pyc` file is found matching the desired `.py` file.
31
+
#### `.pyc` files are created automatically by the GraalVM Python runtime when no or an invalid `.pyc` file is found matching the desired `.py` file.
32
32
33
33
When a Python source file (module) is imported during an execution for the first time, the appropriate `.pyc` file is created automatically.
34
34
If the same module is imported again, then the already created `.pyc` file is used.
@@ -42,14 +42,14 @@ The hashcode is generated only based on the Python source by calling `source.has
42
42
The `.pyc` files are also regenerated if a magic number in the Python parser is changed.
43
43
The magic number is hard-coded in the Python source and can not be changed by the user (unless of course that user has access to the bytecode of Python).
44
44
45
-
The developers of GraalVM's Python implementation change the magic number when the format of SST or scope tree binary data is altered.
46
-
This is an implementation detail, so the magic number does not have to correspond to the version of GraalVM's Python implementation (just like in CPython).
47
-
The magic number of pyc is a function of the concrete Python implementation Java code that is running.
45
+
The developers of GraalVM's Python runtime change the magic number when the format of SST or scope tree binary data is altered.
46
+
This is an implementation detail, so the magic number does not have to correspond to the version of GraalVM's Python runtime (just like in CPython).
47
+
The magic number of pyc is a function of the concrete Python runtime Java code that is running.
48
48
49
49
Note that if you use `.pyc` files, you will need to allow write-access to GraalVM's Python runtime at least when switching versions or changing the original source code.
50
50
Otherwise, the regeneration of source files will fail and every import will have the overhead of accessing the old `.pyc` file, parsing the code, serializing it, and trying (and failing) to write out a new `.pyc` file.
51
51
52
-
A `*.pyc` file is never deleted by GraalVM's Python implementation, only regenerated.
52
+
A `*.pyc` file is never deleted by GraalVM's Python runtime, only regenerated.
53
53
It is regenerated when the appropriate source file is changed (timestamp of last modification or hashcode of the content) or the magic number of the Python imnplementation parser changes.
54
54
Magic number changes will be communicated in the release notes so that embedders or system administrators can delete old `.pyc` files when upgrading.
55
55
@@ -123,7 +123,7 @@ these language options:
123
123
Note that a Python context will not enable writing `.pyc` files by default.
124
124
The `graalpython` launcher enables it by default, but if this is desired in the embedding use case, care should be taken to ensure that the `__pycache__` location is properly managed and the files in that location are secured against manipulation just like the source `.py` files they were derived from.
125
125
126
-
Note also that to upgrade the application sources to GraalVM Enteprise's Python implementation, old `.pyc`
126
+
Note also that to upgrade the application sources to GraalVM Enteprise's Python runtime, old `.pyc`
127
127
files must be removed by the embedder as required.
Copy file name to clipboardExpand all lines: docs/user/README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
# GraalVM Python Implementation
1
+
# GraalVM Python Runtime
2
2
3
3
GraalVM provides a Python 3.8 compliant runtime.
4
-
A primary goal of the Python implementation is to support SciPy and its constituent libraries, as well as to work with other data science and machine learning libraries from the rich Python ecosystem.
5
-
At this point, the Python implementation is made available for experimentation and curious end-users.
4
+
A primary goal of the GraalVM Python runtime is to support SciPy and its constituent libraries, as well as to work with other data science and machine learning libraries from the rich Python ecosystem.
5
+
At this point, the Python runtime is made available for experimentation and curious end-users.
6
6
See [FAQ](FAQ.md) for commonly asked questions about this implementation.
If no program file or command is given, you are dropped into a simple REPL.
27
27
28
-
GraalVM supports some of the same options as Python 3.8 as well as some additional options to control the underlying Python implementation, GraalVM's tools, and the execution engine.
28
+
GraalVM supports some of the same options as Python 3.8 as well as some additional options to control the underlying Python runtime, GraalVM's tools, and the execution engine.
29
29
These can be viewed using the following command:
30
30
```shell
31
31
graalpython --help --help:tools --help:languages
32
32
```
33
33
34
34
## Installing Supported Packages
35
35
36
-
GraalVM Python implementation comes with a tool called `ginstall` which may be used to install a small list of packages known to work to some extent with GraalVM's Python runtime.
36
+
GraalVM Python runtime comes with a tool called `ginstall` which may be used to install a small list of packages known to work to some extent with GraalVM's Python runtime.
37
37
It is recommended to always create a virtual environment first, using the standard Python module `venv`.
38
38
Creating such an environment avoids any incompatible interaction with the local user's packages that may have been
0 commit comments