You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pages/getting-started/what-it-is.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,8 +30,8 @@ Reads like Python (parses Python syntax). Runs differently, what it executes is
30
30
These parse for syntactic compatibility but raise at runtime, or simply don't exist:
31
31
32
32
-**Standard library**: no bundled stdlib; every module is external (see **Modules** above).
33
-
-**I/O**: `input()` reads from a host-provided buffer. There is no file system, no network, no `os`, no `sys`, those surface only when the host runtime registers them as [host packages](/reference/writing-modules#path-c-host-capability) (the same mechanism behind `print` and `input` themselves).
34
-
-**Async surface**: `async def` creates real coroutines and the VM runs a cooperative scheduler, but there is no `asyncio` module; primitives are top-level builtins (`run`, `sleep`, `gather`, `with_timeout`, `cancel`, `receive`). Coroutines do not expose `.send()` / `.throw()` / `.close()`.
33
+
-**I/O**: `input()` reads from a host-provided buffer. There is no file system, no network, no `os`, no `sys`, those surface only when the host runtime registers them as [host capabilities](/reference/writing-modules#path-b-host-capability) (the same mechanism behind `print` and `input` themselves).
34
+
-**Async surface**: `async def` creates real coroutines and the VM runs a cooperative scheduler, but there is no `asyncio` module — primitives are top-level builtins ([Async](/language/async)). Coroutines do not expose `.send()` / `.throw()` / `.close()`.
35
35
-**Metaclasses, descriptor protocol, `__slots__`**: not modeled.
36
36
-**Dynamic code**: no `exec`, no `eval`, no `compile`, no `__import__` (use the `import_module(name)` builtin to look up an already-imported module by alias).
-**`Compiler <-> host` imports**, embedder-declared, covering output, module fetching, native dispatch, wall-clock time. Custom embedders that ship [host packages](/reference/writing-modules#path-c-host-capability) declare additional imports (DOM, FS) without touching the plugin ABI.
63
+
-**`Compiler <-> host` imports**, embedder-declared, covering output, module fetching, native dispatch, wall-clock time. Custom embedders that ship [host capabilities](/reference/writing-modules#path-b-host-capability) declare additional imports (DOM, FS) without touching the plugin ABI.
64
64
-**Plugin ABI (sealed v1)**, contract for CDN-distributed `.wasm` plugin modules. Exactly 6 `env.*` imports, never extended. See the [WASM module ABI](/reference/wasm-abi).
Copy file name to clipboardExpand all lines: docs/pages/reference/builtins.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ hello world
47
47
48
48
### abs
49
49
50
-
`abs(x)`: absolute value of int or float. Non-numeric -> `TypeError`. Works on inline and `LongInt` i128; literals beyond +/-2^127 are rejected at parse time.
50
+
`abs(x)`: absolute value of int or float. Non-numeric -> `TypeError`. Works across the full integer range (see [Integer width](/reference/limits-and-errors#integer-width)).
Copy file name to clipboardExpand all lines: docs/pages/reference/wasm-abi.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: "WASM module ABI"
3
3
description: "The wire format a `.wasm` module must follow to be importable by Edge Python."
4
4
---
5
5
6
-
> **Sealed contract, plugin ABI v1.** Every signature, op code, tag, and error kind here is the public contract for CDN-distributed `.wasm` plugin modules (Path A). New host packages arrive as new `Op` values, never new imports; a future wire-level break would ship as `env_v2.*` without removing v1. Distinct from the `compiler<->host` interface embedders declare (see [host packages](/reference/writing-modules#path-c-host-capability)), embedders aren't bound by the 6-import limit here.
6
+
> **Sealed contract, plugin ABI v1.** Every signature, op code, tag, and error kind here is the public contract for CDN-distributed `.wasm` plugin modules (Path A). New host packages arrive as new `Op` values, never new imports; a future wire-level break would ship as `env_v2.*` without removing v1. Distinct from the `compiler<->host` interface embedders declare (see [host capabilities](/reference/writing-modules#path-b-host-capability)), embedders aren't bound by the 6-import limit here.
7
7
8
8
A `.wasm` module imported via `from "<url>" import <names>` follows the contract below. Handle-based API: the host owns all values, the guest sees only opaque `u32` handles, and one universal dispatch primitive (`edge_op`) covers every operation. New types, methods, and language features become available to existing modules with no ABI change.
Copy file name to clipboardExpand all lines: docs/pages/reference/writing-modules.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Edge Python has no bundled stdlib. Three ways to add native functionality:
9
9
|---|---|---|---|
10
10
|**`.wasm` module via URL** ([WASM ABI](/reference/wasm-abi)) | Publish `.wasm` to a CDN; any host loads dynamically | Primitives only (None, bool, i128, f64, bytes/str) | Reference [`wasm-pdk`](https://github.com/dylan-sutton-chavez/edge-python/tree/main/wasm-pdk) (Rust), community PDKs, or hand-written wire boilerplate |
11
11
|**Host capability**| Custom `compiler.wasm` (additional host imports declared) + host runtime they bridge to | Primitives + access to host services (DOM, FS, fetch) through embedder host imports | You own embedder + host runtime; bindings travel together |
12
-
|**JS host module**| Plain ESM registered via `createWorker({ mainThreadModules })`| Primitives only (same as Path A) | Pure JS; no Rust, no `.wasm`, no build step |
12
+
|**JS host module**| Plain ESM via `createWorker` (`mainThreadModules` eager, `hostModules` lazy) or the `host` field of `packages.json`| Primitives only (same as Path A) | Pure JS; no Rust, no `.wasm`, no build step |
13
13
14
14
`.wasm` matches the marketplace pattern (`from "https://x.wasm" import f` works in any host). Host capability is for runtime distributions that own their `compiler.wasm` and expose host services to scripts (the same pattern `print` and `input` use). JS host modules keep upstream `compiler_lib.wasm` untouched while exposing main-thread surface (DOM, dialogs, FileReader, observers, anything `window.*`).
0 commit comments