Skip to content

Commit ebcdd02

Browse files
committed
document missing modules and tools a little
1 parent 53c032d commit ebcdd02

File tree

2 files changed

+98
-0
lines changed

2 files changed

+98
-0
lines changed

docs/contributor/MISSING.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# (Largely) Missing Core Modules
2+
3+
This is just a snapshot as of:
4+
Thu 2020-03-19 - 5:19 PM
5+
6+
### Builtin modules from sys.builtin_module_names that we don't have built-in or care shared object modules
7+
8+
#### These we might want to use from C
9+
* **_blake2**: hashing extension module, we could use it from C
10+
* **_sha3**: We should just run the C module
11+
* **grp**: UNIX group file access. We need to use this from the C module.
12+
* **spwd**: UNIX shadow password file access. We need to use this from the C module.
13+
* **syslog**: Access to syslog. We should probable just use this from the C module.
14+
* **audioop**: Should be useable from C
15+
* **_curses, _curses_panel**: Use from C
16+
* **_csv**: We can use it from C
17+
* **_gdbm**: Use from C
18+
* **_dbm**: Use from C
19+
* **nis**: We should just use the C module
20+
* **_sqlite3**: Either use from C, or use a Java API.
21+
* **termios**: Posix terminal module IO. Use from C
22+
* **_tkinter**: Should be used from C
23+
24+
#### These are not strictly needed for now
25+
* **_abc**: Just a performance optimization, not necessary.
26+
* **_bisect**: Just a performance optimization, not necessary.
27+
* **_datetime**: Just a performance optimization, not necessary.
28+
* **_elementtree**: Just a performance optimization, not necessary.
29+
* **_heapq**: Just a performance optimization, not necessary.
30+
* **_pickle**: Just a performance optimization, not necessary.
31+
* **_stat**: Just a performance optimization, not necessary.
32+
* **_warnings**: Warnings filtering, not strictly needed.
33+
* **_asyncio**: We should write this ourselves, but I think the pure Python should be enough for a while
34+
* **_decimal**: Just performance, not necessary
35+
* **_hashlib**: Just for performance
36+
* **_json**: Just for performance
37+
* **_queue**: Just for performance, not needed
38+
39+
#### These we actually have, just not in Java
40+
* **_struct**: We already use this from the C module.
41+
* **_bz2**: We're already using this from C
42+
* **_md5**: We use the Python impl from PyPy
43+
* **_sha1**: We use the Python impl from PyPy
44+
* **_sha256**: We use the Python impl from PyPy
45+
* **_sha512**: We use the Python impl from PyPy
46+
* **mmap**: We already use this from the C module.
47+
48+
#### These we probably won't support
49+
* **_symtable**: Interface for the compilers internal symboltable, we cannot easily support this
50+
* **_opcode**: We won't have it
51+
* **ossaudiodev**: Not needed, it's for Linux OSS audio
52+
53+
#### These we should re-implement
54+
* **_lsprof**: We'll probably just want to replace this with the Truffle profiler
55+
* **_tracemalloc**: Memory allocation tracing, we should substitute with the Truffle instrument.
56+
* **cmath**: Complex math module. We should implement this in Java, I think.
57+
* **_codecs_cn, _codecs_hk, _codecs_iso2022, _codecs_jp, _codecs_kr, _codecs_tw, _multibytecodec**: We can just use our own codecs
58+
* **_crypt**: We can just implement this in Java, it's a single function
59+
* **_ctypes, _ctypes_test**: We might be able to use these directly, but reimplement would be faster
60+
* **parser**: We need to implement this for our parser
61+
* **_ssl**: To use this from C, we have to use the socketmodule from C also
62+
* **_uuid**: Can be implemented ourselves, is just 1 function
63+
64+
### Very incomplete on our part:
65+
66+
* **_ast**: Used in various places, including the help system. Would be nice to support, ours is an empty shell
67+
* **_socket**: We map to Java sockets, but not much else.
68+
* **resource**: This is about resources, there should be Truffle APIs for this (there are issues open)
69+
* **_multiprocessing**: We need to implement this with the Context API

docs/user/TOOLS.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Tooling for Python on GraalVM
2+
3+
We will try to support all the Truffle tools in a way the user would expect.
4+
5+
### Debugger
6+
7+
To enable debugging, pass the `--inspect` option to the `graalpython`
8+
launcher. For example:
9+
10+
$ graalpython --inspect -c "breakpoint(); import os; os.exit()"
11+
Debugger listening on port 9229.
12+
To start debugging, open the following URL in Chrome:
13+
chrome-devtools://devtools/bundled/js_app.html?ws=127.0.1.1:9229/76fcb6dd-35267eb09c3
14+
15+
As you see, the standard Python built-in `breakpoint()` will work with our
16+
debugger. You can inspect variables, set watch expressions, interactively
17+
evaluate code snippets etc. However, this only works if you pass `--inspect` or
18+
some other inspect option. Otherwise, `pdb` is triggered as on CPython (and
19+
doesn't currently work).
20+
21+
### Coverage
22+
23+
We are going to support the `trace` module API, but using the Truffle *coverage*
24+
tool.
25+
26+
### Profiling
27+
28+
We are going to support the `cProfile` module API, but using the Truffle
29+
*cpusampler* tool

0 commit comments

Comments
 (0)