83
83
node --experimental-wasm-threads --experimental-wasm-bulk-memory builddir/emscripten-node/python.js
84
84
```
85
85
86
- ## wasm32-emscripten limitations and issues
86
+ # wasm32-emscripten limitations and issues
87
87
88
- - Heap and stack are limited.
89
- - Most stdlib modules with a dependency on external libraries are missing:
90
- `` ctypes `` , `` readline `` , `` sqlite3 `` , `` ssl `` , and more .
91
- - Shared extension modules are not implemented yet. All extension modules
92
- are statically linked into the main binary.
93
- The experimental configure option `` --enable-wasm-dynamic-linking `` enables
94
- dynamic extensions.
95
- - Processes are not supported. System calls like fork, popen, and subprocess
96
- fail with `` ENOSYS `` or `` ENOSUP `` .
88
+ Emscripten before 3.1.8 has known bugs that can cause memory corruption and
89
+ resource leaks. 3.1.8 contains several fixes for bugs in date and time
90
+ functions .
91
+
92
+ ## Network stack
93
+
94
+ - Python's socket module does not work with Emscripten's emulated POSIX
95
+ sockets yet. Network modules like `` asyncio `` , `` urllib `` , `` selectors `` ,
96
+ etc. are not available .
97
97
- Only `` AF_INET `` and `` AF_INET6 `` with `` SOCK_STREAM `` (TCP) or
98
98
`` SOCK_DGRAM `` (UDP) are available. `` AF_UNIX `` is not supported.
99
99
- `` socketpair `` does not work.
@@ -102,8 +102,21 @@ node --experimental-wasm-threads --experimental-wasm-bulk-memory builddir/emscri
102
102
does not resolve to a real IP address. IPv6 is not available.
103
103
- The `` select `` module is limited. `` select.select() `` crashes the runtime
104
104
due to lack of exectfd support.
105
+
106
+ ## processes, threads, signals
107
+
108
+ - Processes are not supported. System calls like fork, popen, and subprocess
109
+ fail with `` ENOSYS `` or `` ENOSUP `` .
105
110
- Signal support is limited. `` signal.alarm `` , `` itimer `` , `` sigaction ``
106
111
are not available or do not work correctly. `` SIGTERM `` exits the runtime.
112
+ - Keyboard interrupt (CTRL+C) handling is not implemented yet.
113
+ - Browser builds cannot start new threads. Node's web workers consume
114
+ extra file descriptors.
115
+ - Resource-related functions like `` os.nice `` and most functions of the
116
+ `` resource `` module are not available.
117
+
118
+ ## file system
119
+
107
120
- Most user, group, and permission related function and modules are not
108
121
supported or don't work as expected, e.g.`` pwd `` module, `` grp `` module,
109
122
`` os.setgroups `` , `` os.chown `` , and so on. `` lchown `` and `lchmod`` are
@@ -117,23 +130,35 @@ node --experimental-wasm-threads --experimental-wasm-bulk-memory builddir/emscri
117
130
and are disabled.
118
131
- Large file support crashes the runtime and is disabled.
119
132
- `` mmap `` module is unstable. flush (`` msync `` ) can crash the runtime.
120
- - Resource-related functions like `` os.nice `` and most functions of the
121
- `` resource `` module are not available.
133
+
134
+ ## Misc
135
+
136
+ - Heap memory and stack size are limited. Recursion or extensive memory
137
+ consumption can crash Python.
138
+ - Most stdlib modules with a dependency on external libraries are missing,
139
+ e.g. `` ctypes `` , `` readline `` , `` sqlite3 `` , `` ssl `` , and more.
140
+ - Shared extension modules are not implemented yet. All extension modules
141
+ are statically linked into the main binary.
142
+ The experimental configure option `` --enable-wasm-dynamic-linking `` enables
143
+ dynamic extensions.
122
144
- glibc extensions for date and time formatting are not available.
123
145
- `` locales `` module is affected by musl libc issues,
124
146
[ bpo-46390] ( https://bugs.python.org/issue46390 ) .
125
147
- Python's object allocator `` obmalloc `` is disabled by default.
126
148
- `` ensurepip `` is not available.
127
149
128
- ### wasm32-emscripten in browsers
150
+ ## wasm32-emscripten in browsers
129
151
152
+ - The interactive shell does not handle copy 'n paste and unicode support
153
+ well.
130
154
- The bundled stdlib is limited. Network-related modules,
131
155
distutils, multiprocessing, dbm, tests and similar modules
132
156
are not shipped. All other modules are bundled as pre-compiled
133
157
`` pyc `` files.
134
158
- Threading is not supported.
159
+ - In-memory file system (MEMFS) is not persistent and limited.
135
160
136
- ### wasm32-emscripten in node
161
+ ## wasm32-emscripten in node
137
162
138
163
Node builds use `` NODERAWFS `` , `` USE_PTHREADS `` and `` PROXY_TO_PTHREAD ``
139
164
linker options.
0 commit comments