@@ -14,8 +14,9 @@ Abstract
1414========
1515
1616`Emscripten <https://emscripten.org/ >`__ is a complete open source compiler
17- toolchain. It compiles C/C++ code into WebAssembly/JavaScript executables,
18- for use in JavaScript runtimes, including browsers and Node.js.
17+ toolchain. It compiles C/C++ code into WebAssembly/JavaScript executables, for
18+ use in JavaScript runtimes, including browsers and Node.js. The Rust language
19+ also maintains an Emscripten target.
1920
2021This PEP formalizes the addition of Tier 3 for Emscripten support in Python 3.14
2122which `was approved by the Steering Council on October 25, 2024
@@ -195,13 +196,13 @@ shut down the runtime on exit. It also includes an implementation for all of the
195196system calls, including the file system, the dynamic loader, and any logic to
196197expose additional functionality from the JavaScript runtime to C code.
197198
198- The ``.mjs `` file exports a single :js:func: ` bootstrapEmscriptenExecutable() `
199+ The ``.mjs `` file exports a single `` bootstrapEmscriptenExecutable() ` `
199200JavaScript function that bootstraps the runtime, calls the ``main() `` function,
200201and returns an API object that can be used to call C functions. Each time it is
201202called produces a complete and independent copy of the runtime with its own
202203separate address space.
203204
204- The :js:func: ` bootstrapEmscriptenExecutable() ` takes a large number of runtime
205+ The `` bootstrapEmscriptenExecutable() ` ` takes a large number of runtime
205206settings. `The full list is described in the Emscripten documentation here.
206207<https://emscripten.org/docs/api_reference/module.html#id3> `__ The most
207208important of these are as follows:
@@ -296,7 +297,7 @@ Console and Interactive Usage
296297
297298``stdin `` defaults to always returning ``EOF ``, while ``stdout `` and ``stderr ``
298299default to calling ``console.log `` and ``console.error `` respectively. It is
299- possible to pass handlers to :js:func: ` bootstrapEmscriptenExecutable() ` to configure
300+ possible to pass handlers to `` bootstrapEmscriptenExecutable() ` ` to configure
300301the standard streams, but no matter what the I/O devices have undesirable line
301302buffering behavior that forces a new line when flushed. To implement a well
302303behaved TTY in-browser, it is necessary to remove the default I/O devices and
@@ -421,7 +422,7 @@ traceback.
421422
422423Because Emscripten Python currently has no JavaScript API and no foreign function
423424interface, the situation is much simpler. The Python Node.js runner wraps the call
424- to :js:func: ` bootstrapEmscriptenExecutable() ` in a try/catch block. If an exception is
425+ to `` bootstrapEmscriptenExecutable() ` ` in a try/catch block. If an exception is
425426caught, it displays the JavaScript exception and calls ``_Py_DumpTraceback() ``.
426427It then exits with code 1. We will stick with this approach until we add either
427428a JavaScript API or foreign function interface, which is out of scope for this PEP.
0 commit comments