Skip to main content
A runtime is an interpreter built into Mirage. It runs python3 or node inside the Mirage process, on a machine with provider: in_process. Hosts, containers and sandboxes use their own installed python3 instead. Runtimes explains the split; each page here has the TypeScript install and a runnable example. Runtime output uses the normal Workspace.shell() result: stdout and stderr are Uint8Array; stdoutText and stderrText decode them.

Differences from the Python SDK

  • Monty: each run executes in a crash-isolated worker, from one pool of four that every workspace in the process shares. os.chdir() raises RuntimeError; use cd in the shell or the run’s ctx.cwd. os.stat() has only the named fields (st.st_size).
  • QuickJS: a std and os shim with the calls the QuickJS table lists. A write shows to other commands once the file is flushed or closed, or the run ends. A timeout stops the run, and the engine caps a run at 64 MiB of memory and 1 MiB of stack.
  • Pyodide is in the TypeScript SDK only; WASI is in the Python SDK only.