8383node --experimental-wasm-threads --experimental-wasm-bulk-memory builddir/emscripten-node/python.js
8484```
8585
86- ## wasm32-emscripten limitations and issues
86+ # wasm32-emscripten limitations and issues
8787
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 .
9797- Only `` AF_INET `` and `` AF_INET6 `` with `` SOCK_STREAM `` (TCP) or
9898 `` SOCK_DGRAM `` (UDP) are available. `` AF_UNIX `` is not supported.
9999- `` socketpair `` does not work.
@@ -102,8 +102,21 @@ node --experimental-wasm-threads --experimental-wasm-bulk-memory builddir/emscri
102102 does not resolve to a real IP address. IPv6 is not available.
103103- The `` select `` module is limited. `` select.select() `` crashes the runtime
104104 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 `` .
105110- Signal support is limited. `` signal.alarm `` , `` itimer `` , `` sigaction ``
106111 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+
107120- Most user, group, and permission related function and modules are not
108121 supported or don't work as expected, e.g.`` pwd `` module, `` grp `` module,
109122 `` 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
117130 and are disabled.
118131- Large file support crashes the runtime and is disabled.
119132- `` 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.
122144- glibc extensions for date and time formatting are not available.
123145- `` locales `` module is affected by musl libc issues,
124146 [ bpo-46390] ( https://bugs.python.org/issue46390 ) .
125147- Python's object allocator `` obmalloc `` is disabled by default.
126148- `` ensurepip `` is not available.
127149
128- ### wasm32-emscripten in browsers
150+ ## wasm32-emscripten in browsers
129151
152+ - The interactive shell does not handle copy 'n paste and unicode support
153+ well.
130154- The bundled stdlib is limited. Network-related modules,
131155 distutils, multiprocessing, dbm, tests and similar modules
132156 are not shipped. All other modules are bundled as pre-compiled
133157 `` pyc `` files.
134158- Threading is not supported.
159+ - In-memory file system (MEMFS) is not persistent and limited.
135160
136- ### wasm32-emscripten in node
161+ ## wasm32-emscripten in node
137162
138163Node builds use `` NODERAWFS `` , `` USE_PTHREADS `` and `` PROXY_TO_PTHREAD ``
139164linker options.
0 commit comments