Skip to content

Commit d9d0b3c

Browse files
committed
[GR-32720] Set up documentation versioning and use rel paths.
PullRequest: graalpython/1980
2 parents a74315a + 1e7e0ea commit d9d0b3c

File tree

7 files changed

+41
-65
lines changed

7 files changed

+41
-65
lines changed

docs/user/FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ For native extensions running as LLVM bitcode, CPython is currently slower -- yo
4646
### I heard languages with JIT compilers have slow startup. Is that true for GraalVM's Python runtime?
4747

4848
It depends.
49-
When you use [Native Image](https://www.graalvm.org/reference-manual/native-image/) with Python, or the `graalpython` launcher of GraalVM, startup is competitive with CPython.
49+
When you use [Native Image](https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/README.md) with Python, or the `graalpython` launcher of GraalVM, startup is competitive with CPython.
5050
In any case, both with Native Image or when running on the JVM, you first need to warm up to reach peak performance. This is a complicated story in itself, but, in general, it can take a while (a minute or two) after you have reached and are running your core workload.
5151

5252
### Can I share warmed-up code between multiple Python contexts?

docs/user/Interoperability.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ print(java.instanceof(my_list, ArrayList))
188188
# prints True
189189
```
190190

191-
See [Polyglot Programming](https://www.graalvm.org/reference-manual/polyglot-programming/) and [Embed Languages](https://www.graalvm.org/reference-manual/embed-languages/) for more information about interoperability with other programming languages.
191+
See [Polyglot Programming](https://github.com/oracle/graal/blob/master/docs/reference-manual/polyglot-programming.md) and [Embed Languages](https://github.com/oracle/graal/blob/master/docs/reference-manual/embedding/embed-languages.md) for more information about interoperability with other programming languages.
192192

193193
## The Behaviour of Types
194194

@@ -197,18 +197,12 @@ ways and have restrictions on how they can interact with Python.
197197

198198
### Interop Types to Python
199199

200-
Most importantly and upfront - all foreign objects passing into Python have the
201-
Python type `foreign`. There is no emulation of i.e., objects that are interop
202-
booleans to have the Python type `bool`. This is because interop types can
203-
overlap in ways that the Python builtin types cannot, and it would not be clear
204-
what should take precendence. Instead, the `foreign` type defines all of the
205-
Python special methods for type conversion that are used throughout the
206-
interpreter (methods like `__add__`, `__int__`, `__str__`, `__getitem__` etc)
207-
and these try to do the right thing based on the interop type (or raise an
208-
exception.)
209-
210-
Types not listed in the below table have no special interpretation in Python
211-
right now.
200+
Most importantly and upfront - all foreign objects passing into Python have the Python type `foreign`.
201+
There is no emulation of i.e., objects that are interop booleans to have the Python type `bool`.
202+
This is because interop types can overlap in ways that the Python builtin types cannot, and it would not be clear what should take precendence.
203+
Instead, the `foreign` type defines all of the Python special methods for type conversion that are used throughout the interpreter (methods like `__add__`, `__int__`, `__str__`, `__getitem__`, etc.) and these try to do the right thing based on the interop type (or raise an exception.)
204+
205+
Types not listed in the below table have no special interpretation in Python right now.
212206

213207
| Interop type | Python interpretation |
214208
|:-------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

docs/user/Jython.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,4 +245,4 @@ There are no APIs particular to Python that are exposed, and everything is done
245245

246246
It is important to note that as long as your application is executed on GraalVM with the Python language installed,
247247
you can embed Python in your programs.
248-
For more details, refer to the [Embed Languages](https://www.graalvm.org/reference-manual/embed-languages/) guide.
248+
For more details, refer to the [Embed Languages](https://github.com/oracle/graal/blob/master/docs/reference-manual/embedding/embed-languages.md) guide.

docs/user/OsInterface.md

Lines changed: 27 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,31 @@
1+
---
2+
layout: docs-experimental
3+
toc_group: python
4+
link_title: Operating System Interfaces
5+
permalink: /reference-manual/python/OSInterface/
6+
---
7+
18
# Operating System Interfaces
29

3-
Truffle based GraalVM languages usually implement the system related
4-
functions using the [Truffle abstraction layer](https://www.graalvm.org/graalvm-as-a-platform/language-implementation-framework/), which is OS independent
5-
and provides extension points for the users when embedding GraalVM Python
6-
or other Truffle based languages into Java applications. See, for example,
7-
[Truffle FileSystem service-provider](https://www.graalvm.org/truffle/javadoc/org/graalvm/polyglot/io/FileSystem.html).
10+
Truffle-based GraalVM languages usually implement the system related functions using the [Truffle abstraction layer](https://github.com/oracle/graal/blob/master/truffle/docs/README.md), which is OS independent and provides extension points for the users when embedding GraalVM Python or other Truffle based languages into Java applications.
11+
See, for example, [Truffle FileSystem service-provider](https://www.graalvm.org/truffle/javadoc/org/graalvm/polyglot/io/FileSystem.html).
812

9-
The Python standard library also provides OS abstraction, but exposes lower level interfaces,
10-
for instance, the OS module directly exposes some POSIX functions. On non-POSIX platforms,
11-
this interface is emulated to a degree.
13+
The Python standard library also provides OS abstraction, but exposes lower level interfaces, for instance, the OS module directly exposes some POSIX functions.
14+
On non-POSIX platforms, this interface is emulated to a degree.
1215

13-
GraalVM Python runtime provides two alternative implementations of the system related
14-
functionality offered by the builtin Python modules such as `os`.
15-
Which implementation is used can be controlled by the option `PosixModuleBackend`:
16-
valid values are `native` and `java`.
16+
GraalVM Python runtime provides two alternative implementations of the system related functionality offered by the builtin Python modules such as `os`.
17+
Which implementation is used can be controlled by the option `PosixModuleBackend`: valid values are `native` and `java`.
1718

1819
## Native backend
1920

20-
The `native` backend calls directly the POSIX API in mostly the same way
21-
as CPython, the reference Python implementation, does.
21+
The `native` backend calls directly the POSIX API in mostly the same way as CPython, the reference Python implementation, does.
2222

23-
This approach is the most compatible with CPython and provides bare access
24-
to the underlying OS interface without any emulation layer in between.
23+
This approach is the most compatible with CPython and provides bare access to the underlying OS interface without any emulation layer in between.
2524

26-
By default, this implementation bypasses the Truffle abstraction layer,
27-
therefore it is not sandboxed and does not support custom implementations
28-
of [Truffle FileSystem service-provider](https://www.graalvm.org/truffle/javadoc/org/graalvm/polyglot/io/FileSystem.html)
29-
and other Polyglot API providers related to system interfaces.
25+
By default, this implementation bypasses the Truffle abstraction layer, therefore it is not sandboxed and does not support custom implementations of [Truffle FileSystem service-provider](https://www.graalvm.org/truffle/javadoc/org/graalvm/polyglot/io/FileSystem.html) and other Polyglot API providers related to system interfaces.
3026

31-
The native backend is chosen by default when GraalVM Python
32-
is started via the `graalpython` or any other Python related
33-
launcher inside GraalVM. The exception are Python related launchers
34-
with `-managed` suffix available only in GraalVM Enterprise
35-
(e.g., `graalpython-managed`), which by default use the `java` POSIX backend.
27+
The native backend is chosen by default when GraalVM Python is started via the `graalpython` or any other Python related launcher inside GraalVM.
28+
The exception are Python related launchers with `-managed` suffix available only in GraalVM Enterprise (e.g., `graalpython-managed`), which by default use the `java` POSIX backend.
3629

3730
### Limitations of the native backend
3831

@@ -43,21 +36,15 @@ Known limitations:
4336

4437
## Java backend
4538

46-
The `java` backend uses the [Truffle abstraction layer](https://www.graalvm.org/graalvm-as-a-platform/language-implementation-framework/)
47-
and therefore supports custom Polyglot API providers related to system interfaces and sandboxing.
48-
Since this abstraction is POSIX agnostic, it does not expose
49-
all the necessary functionality. Some functionality is emulated, and some
50-
functionality is not supported at all.
39+
The `java` backend uses the [Truffle abstraction layer](https://github.com/oracle/graal/blob/master/truffle/docs/README.md) and therefore supports custom Polyglot API providers related to system interfaces and sandboxing.
40+
Since this abstraction is POSIX agnostic, it does not expose all the necessary functionality. Some functionality is emulated, and some functionality is not supported at all.
5141

52-
The java backend is the default when GraalVM Python is run via
53-
the `Context` API, i.e., [embedded in Java applications](https://www.graalvm.org/reference-manual/embed-languages), or when it is launched using Python related launchers
54-
with `-managed` suffix available only in GraalVM Enterprise.
42+
The java backend is the default when GraalVM Python is run via the `Context` API, i.e., [embedded in Java applications](https://github.com/oracle/graal/blob/master/docs/reference-manual/embedding/embed-languages.md), or when it is launched using Python related launchers with `-managed` suffix available only in GraalVM Enterprise.
5543

5644
### Limitations of the emulated backend
5745

58-
GraalVM Python can log info about known incompatibility of functions executed at runtime,
59-
which includes the OS interface related functions. To turn on this logging use
60-
`--log.python.compatibility=FINE` or other desired logging level.
46+
GraalVM Python can log info about known incompatibility of functions executed at runtime, which includes the OS interface related functions.
47+
To turn on this logging, use `--log.python.compatibility=FINE` or other desired logging level.
6148

6249
Known limitations of the emulated layer are:
6350

@@ -76,12 +63,8 @@ Known limitations of the emulated layer are:
7663

7764
## Relation to Python native extensions
7865

79-
Apart from operating system interfaces exposed as builtin Python level modules,
80-
Python native extensions executed via the GraalVM LLVM runtime may also access
81-
OS interfaces at the C level. How such accesses are handled depends on the
82-
GraalVM LLVM runtime configuration.
66+
Apart from operating system interfaces exposed as builtin Python level modules, Python native extensions executed via the GraalVM LLVM runtime may also access OS interfaces at the C level.
67+
How such accesses are handled depends on the GraalVM LLVM runtime configuration.
8368

84-
At this point, the only combination where OS handles, such as file descriptors,
85-
can be shared between Python and the C code of Python extensions is with
86-
`native` PosixModuleBackend and `native` mode of GraalVM LLVM runtime.
87-
This combination is the default for the `graalpython` launcher.
69+
At this point, the only combination where OS handles, such as file descriptors, can be shared between Python and the C code of Python extensions is with `native` PosixModuleBackend and `native` mode of GraalVM LLVM runtime.
70+
This combination is the default for the `graalpython` launcher.

docs/user/ParserDetails.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This guide elaborates on how Python files are parsed on the GraalVM Python runti
1414

1515
Creating the abstract syntax tree (AST) for a Python source has two phases.
1616
The first one creates a simple syntax tree (SST) and a scope tree.
17-
The second phase transforms the SST to the [Language Implementation framework](https://www.graalvm.org/graalvm-as-a-platform/language-implementation-framework/) tree.
17+
The second phase transforms the SST to the [Truffle Language Implementation framework](https://github.com/oracle/graal/blob/master/truffle/docs/README.md) tree.
1818

1919
For the transformation, the scope tree it needed.
2020
The scope tree contains scope locations for variable and function definitions, and information about scopes.

docs/user/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ See [FAQ](FAQ.md) for commonly asked questions about this implementation.
1515

1616
## Installing Python
1717

18-
The Python runtime is not provided by default, and can be added to GraalVM with the [GraalVM Updater](https://www.graalvm.org/reference-manual/graalvm-updater), `gu`, tool:
18+
The Python runtime is not provided by default, and can be added to GraalVM with the [GraalVM Updater](https://github.com/oracle/graal/blob/master/docs/reference-manual/graalvm-updater.md), `gu`, tool:
1919
```shell
2020
gu install python
2121
```
2222

23-
The above command will install Python from the GitHub catalog for GraalVM Community Edition users.
24-
For GraalVM Enterprise users, the [manual installation](https://www.graalvm.org/reference-manual/graalvm-updater/#manual-installation) is required.
23+
The above command will install Python from the catalog.
2524

2625
## Running Python
2726

@@ -70,7 +69,7 @@ For more information, continue reading to the [Installing Supported Packages](Pa
7069

7170
## Native Image and JVM Runtime
7271

73-
By default, GraalVM runs Python from a binary, compiled ahead-of-time with [Native Image](https://www.graalvm.org/reference-manual/native-image/), yielding faster startup time and lower footprint.
72+
By default, GraalVM runs Python from a binary, compiled ahead-of-time with [Native Image](https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/README.md), yielding faster startup time and lower footprint.
7473
Although the ahead-of-time compiled binary includes the Python and LLVM interpreters, in order to interoperate with
7574
other languages you have to supply the `--jvm` argument.
7675
This instructs the launcher to run on the JVM instead of in Native Image mode.

docs/user/Tooling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ To start debugging, open the following URL in Chrome:
2121
chrome-devtools://devtools/bundled/js_app.html?ws=127.0.1.1:9229/76fcb6dd-35267eb09c3
2222
```
2323

24-
The standard Python built-in `breakpoint()` will work using the [GraalVM's Chrome Inspector](https://www.graalvm.org/tools/chrome-debugger/) implementation.
24+
The standard Python built-in `breakpoint()` will work using the [GraalVM's Chrome Inspector](https://github.com/oracle/graal/blob/master/docs/tools/chrome-debugger.md) implementation.
2525
You can inspect variables, set watch expressions, interactively evaluate code snippets, etc.
2626
However, this only works if you pass `--inspect` or some other inspect option. Otherwise, `pdb` is triggered as on CPython (and does not currently work).
2727

0 commit comments

Comments
 (0)