|
| 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 | + * **_csv**: We can use it from C |
| 11 | + * **_curses, _curses_panel**: Use from C |
| 12 | + * **_dbm**: Use from C |
| 13 | + * **_gdbm**: Use from C |
| 14 | + * **_sha3**: We should just run the C module |
| 15 | + * **_sqlite3**: Either use from C, or use a Java API. |
| 16 | + * **_tkinter**: Should be used from C |
| 17 | + * **audioop**: Should be useable from C |
| 18 | + * **grp**: UNIX group file access. We need to use this from the C module. |
| 19 | + * **nis**: We should just use the C module |
| 20 | + * **spwd**: UNIX shadow password file access. We need to use this from the C module. |
| 21 | + * **syslog**: Access to syslog. We should probable just use this from the C module. |
| 22 | + * **termios**: Posix terminal module IO. Use from C |
| 23 | + |
| 24 | +#### These are not strictly needed for now |
| 25 | + * **_abc**: Just a performance optimization, not necessary. |
| 26 | + * **_asyncio**: We should write this ourselves, but I think the pure Python should be enough for a while |
| 27 | + * **_bisect**: Just a performance optimization, not necessary. |
| 28 | + * **_datetime**: Just a performance optimization, not necessary. |
| 29 | + * **_decimal**: Just performance, not necessary |
| 30 | + * **_elementtree**: Just a performance optimization, not necessary. |
| 31 | + * **_hashlib**: Just for performance |
| 32 | + * **_heapq**: Just a performance optimization, not necessary. |
| 33 | + * **_json**: Just for performance |
| 34 | + * **_pickle**: Just a performance optimization, not necessary. |
| 35 | + * **_queue**: Just for performance, not needed |
| 36 | + * **_queue**: Just an optimization, we stubbed it out |
| 37 | + * **_stat**: Just a performance optimization, not necessary. |
| 38 | + * **_warnings**: Warnings filtering, not strictly needed. |
| 39 | + |
| 40 | +#### These we probably won't support |
| 41 | + * **_opcode**: We won't have it |
| 42 | + * **_symtable**: Interface for the compilers internal symboltable, we cannot easily support this |
| 43 | + * **ossaudiodev**: Not needed, it's for Linux OSS audio |
| 44 | + |
| 45 | +#### These we should re-implement |
| 46 | + * **_codecs_cn, _codecs_hk, _codecs_iso2022, _codecs_jp, _codecs_kr, _codecs_tw, _multibytecodec**: We can just use our own codecs |
| 47 | + * **_crypt**: We can just implement this in Java, it's a single function |
| 48 | + * **_ctypes, _ctypes_test**: We might be able to use these directly, but reimplement would be faster |
| 49 | + * **_lsprof**: We'll probably just want to replace this with the Truffle profiler |
| 50 | + * **_ssl**: To use this from C, we have to use the socketmodule from C also |
| 51 | + * **_string**: Empty right now, but its only two methods that we can re-implement |
| 52 | + * **_tracemalloc**: Memory allocation tracing, we should substitute with the Truffle instrument. |
| 53 | + * **_uuid**: Can be implemented ourselves, is just 1 function |
| 54 | + * **cmath**: Complex math module. We should implement this in Java, I think. |
| 55 | + * **faulthandler**: Needs to deal with Java stacks |
| 56 | + * **fcntl**: Should use the TruffleFile APIs |
| 57 | + * **parser**: We need to implement this for our parser |
| 58 | + * **select**: Needs to work with TruffleFile and future Truffle socket abstractions |
| 59 | + |
| 60 | +### Incompleteness on our part: |
| 61 | + * **_ast**: Used in various places, including the help system. Would be nice to support, ours is an empty shell |
| 62 | + * **_contextvars**: Very incomplete |
| 63 | + * **_multiprocessing**: We need to implement this with the Context API |
| 64 | + * **_signal**: Needs a Truffle API for Signal handling, until then this is the bare minimum |
| 65 | + * **_socket**: We map to Java sockets, but not much else. |
| 66 | + * **array**: This just exposes the array type. Missing some methods and major optimizations. |
| 67 | + * **mmap**: We use this as a mixture from the C module, Python, and Java code. Needs major optimizations. |
| 68 | + * **posix**: Missing quite a bit of functionality that isn't easy to expose with Truffle API |
| 69 | + * **resource**: This is about resources, there should be Truffle APIs for this (there are issues open) |
| 70 | + * **thread**: The module is incomplete, and we don't have proper multi-threading in our impl, yet |
| 71 | + * **unicodedata**: A bit incomplete, but not difficult. Maybe should use a Java ICU library |
| 72 | + |
| 73 | +### Basically complete or easy to make so |
| 74 | + * **_bz2**: We're already using this from C |
| 75 | + * **_collections** |
| 76 | + * **_imp** |
| 77 | + * **_io**: We have built the bare minimum and are using _pyio mostly, which has everything we need |
| 78 | + * **_md5**: We use the Python impl from PyPy |
| 79 | + * **_posixsubprocess** |
| 80 | + * **_random** |
| 81 | + * **_sha1**: We use the Python impl from PyPy |
| 82 | + * **_sha256**: We use the Python impl from PyPy |
| 83 | + * **_sha512**: We use the Python impl from PyPy |
| 84 | + * **_sre**: We use TRegex with fallback to the CPython module for special features |
| 85 | + * **_struct**: We already use this from the C module. |
| 86 | + * **_weakref** |
| 87 | + * **atexit** |
| 88 | + * **binascii**: Just missing a methods |
| 89 | + * **builtins**: Missing very few functions |
| 90 | + * **codecs** |
| 91 | + * **errno** |
| 92 | + * **functools**: Missing a few functions, we mostly implemented it in Python |
| 93 | + * **gc** |
| 94 | + * **itertools**: We mostly just implement all this in Python (a lot is taken from PyPy) |
| 95 | + * **locale**: Partially Truffle APIs, should probably use more to play nice for embedders |
| 96 | + * **marshal** |
| 97 | + * **math** |
| 98 | + * **operator** |
| 99 | + * **pwd** |
| 100 | + * **pyexpat**: We've re-implemented this in Java. If too incompatible, we should just switch to the C code. |
| 101 | + * **readline**: We re-implemented this in terms of JLine used in our launcher |
| 102 | + * **sys** |
| 103 | + * **time**: Missing a few methods, but nothing hard |
| 104 | + * **zipimport**: We have reimplemented this, but Python 3.8 is moving to a pure-Python impl that we can use |
| 105 | + * **zlib** |
0 commit comments