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/introduction.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,10 +22,14 @@ Run live in your browser at [demo.edgepython.com](https://demo.edgepython.com/).
22
22
23
23
### Command Line Interface:
24
24
25
-
Or download it to your machine ([reference docs](/reference/builtins)):
25
+
Or download it to your machine ([reference docs](/reference/cli)):
26
26
27
27
```bash
28
28
curl -fsSL https://dylan-sutton-chavez.github.io/edge-python/install.sh | sh
29
29
30
30
edge -h # List all commands
31
31
```
32
+
33
+
## Need help?
34
+
35
+
Looking to integrate Edge into your app: run Python business logic in your users browsers, or anything else? Get in touch: [email](mailto:c.sutton.dylan@gmail.com)
Copy file name to clipboardExpand all lines: docs/pages/getting-started/quickstart.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,17 +5,17 @@ description: "Run your first Edge Python program in under a minute."
5
5
6
6
## Run it
7
7
8
-
Edge Python ships as a less 200 KB WASM module. Fastest way to try it, the playground, no install, fully client-side.
8
+
Edge Python ships as a sub-200 KB WASM module. Fastest way to try it: the playground, where no install is needed and everything runs client-side.
9
9
10
10
[Open the playground ->](https://demo.edgepython.com)
11
11
12
12
## Embed it
13
13
14
-
The playground is the fastest path; to put Edge Python in your own page, drop in the `<edge-python>` element below. Building the `.wasm` from source or embedding in Rust/WASI is covered in [Where it runs](/getting-started/what-it-is#where-it-runs).
14
+
To put Edge Python in your own page, drop in the `<edge-python>` element below. Building the `.wasm` from source or embedding in Rust/WASI is covered in [Where it runs](/getting-started/what-it-is#where-it-runs).
15
15
16
16
### Drop-in HTML element
17
17
18
-
In the browser, the runtime's `<edge-python>` element runs a `.py` file declaratively, no JS wiring. With a host library like the DOM (declared in `packages.json`), the script renders straight into the page:
18
+
In the browser, the runtime's `<edge-python>` element runs a `.py` file declaratively, no JS wiring. With a host library like `dom` (declared in `packages.json`), the script renders straight into the page:
19
19
20
20
```html
21
21
<!DOCTYPE html>
@@ -42,11 +42,11 @@ from dom import query, set_text
42
42
set_text(query("#app"), "Hello from Python")
43
43
```
44
44
45
-
`dom` is one of the official [host libraries](/reference/packages#host-libraries) (`dom`, `network`, `storage`,...); standard `.wasm` packages like [`json`](/reference/packages#json) sit alongside them. The `packages.json` above declares `dom` explicitly, but the browser runtime also resolves the official packages by bare name with no manifest at all (see [Defaults](/reference/packages#defaults)), fetching each lazily on first import. See [Official packages](/reference/packages) for the full catalog, and the [runtime README](https://github.com/dylan-sutton-chavez/edge-python/tree/main/runtime) for all `<edge-python>` attributes and the `imports` field for `.py` / `.wasm` modules.
45
+
`dom` is one of the official [host libraries](/reference/packages#host-libraries) (`dom`, `network`, `storage`...); standard `.wasm` packages like [`json`](/reference/packages#json) sit alongside them. The `packages.json` above declares `dom` explicitly, but the browser runtime also resolves the official packages by bare name with no manifest (see [Defaults](/reference/packages#defaults)), fetching each lazily on first import. See [Official packages](/reference/packages) for the full catalog, and the [runtime README](https://github.com/dylan-sutton-chavez/edge-python/tree/main/runtime) for all `<edge-python>` attributes and the `imports` field for `.py` / `.wasm` modules.
46
46
47
47
## Your first program
48
48
49
-
Open the [playground](https://demo.edgepython.com) and try the SimplePerceptron Rosenblatt implementation or try a Python snippet:
49
+
Open the [playground](https://demo.edgepython.com) and try the Rosenblatt perceptron example, or paste your own Python snippet:
Copy file name to clipboardExpand all lines: docs/pages/getting-started/what-it-is.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: "A subset of Python, compiled to bytecode and run on a sandboxed VM
5
5
6
6
A sandboxed Python subset with classes, async/await, structural pattern matching, and `packages.json` imports, compiled to bytecode and run on a stack VM with adaptive inline caching and pure-function memoisation. See [Design](/implementation/design) for internals.
7
7
8
-
Reads like Python (parses Python syntax). Runs differently, what it executes is curated.
8
+
Reads like Python (parses Python syntax). Runs differently, where what it executes is curated.
9
9
10
10
## What it supports
11
11
@@ -16,25 +16,25 @@ Reads like Python (parses Python syntax). Runs differently, what it executes is
16
16
***Pattern matching**: `match` / `case` with literals, captures, OR-patterns, guards, and sequence patterns (one star permitted).
17
17
***Exceptions**: `try` / `except` / `else` / `finally`, named handlers, `raise X from Y` (chain info discarded but `X` is what propagates), and subclass-aware matching (`except Exception` catches `RuntimeError`).
18
18
***Context managers**: `with` and `async with` invoke `__enter__` / `__exit__` on the context-manager value; a truthy return from `__exit__` suppresses the raised exception.
19
-
***Protocol dunders**: operator overloading, indexing, iteration, hashing, and `repr` / `str` / `format` dispatch through user-defined dunders, see [Dunders](/language/dunders) for the full matrix.
19
+
***Protocol dunders**: operator overloading, indexing, iteration, hashing, and `repr` / `str` / `format` dispatch through user-defined dunders; see [Dunders](/language/dunders) for the full matrix.
20
20
***Numbers**: bounded integers (fast inline path, auto-promoting to wide; see [Integer width](/reference/limits-and-errors#integer-width)) and full IEEE-754 floats. No `complex`, `Decimal`, or `Fraction`.
***f-strings**: full grammar, embedded expressions, `{expr=}` self-doc, `!r` / `!s` / `!a` conversions, and format specs covering `s d b o x X f F e E g G n % c` plus fill / align / sign / `#` / `0` / width / `,` / precision.
23
23
***Walrus operator**: `:=` in expressions (Name target only).
24
24
***Type annotations**: parsed and discarded, no runtime `__annotations__`, no enforcement.
25
25
***Module identity**: `__name__` is bound to `"__main__"` in the entry chunk and to the module's spec inside imported modules, so the canonical `if __name__ == "__main__":` guard works as expected.
26
-
***Modules**: `import`, `from <spec> import names`, and `from <spec> import *` resolve at parse time through a host-injected resolver, with optional `#sha256-<hex>` integrity on URL specs. Two flavors: `.py` source modules and native modules, see [Imports](/reference/imports) for resolution semantics, [Writing modules](/reference/writing-modules) for the three delivery paths, and [Official packages](/reference/packages) for the ready-made modules (`json`, `dom`, `network`, `storage` and more).
26
+
***Modules**: `import`, `from <spec> import names`, and `from <spec> import *` resolve at parse time through a host-injected resolver, with optional `#sha256-<hex>` integrity on URL specs. Two flavors: `.py` source modules and native modules; see [Imports](/reference/imports) for resolution semantics, [Writing modules](/reference/writing-modules) for the three delivery paths, and [Official packages](/reference/packages) for the ready-made modules (`json`, `dom`, `network`, `storage`, and more).
27
27
28
28
## What it doesn't support
29
29
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 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()`.
33
+
-**I/O**: `input()` reads from a host-provided buffer. There is no file system, no network, no `os`, no `sys`: these 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).
Inherits WASM-host guarantees (no syscalls, no FS, no network, isolated linear memory). On top, embedders enforce per-VM caps via `Limits::sandbox()`, hits raise recoverable `RuntimeError` / `MemoryError` / `RecursionError` rather than crashing the host. See [Limits and errors](/reference/limits-and-errors#sandbox-limits).
51
+
Inherits WASM-host guarantees (no syscalls, no FS, no network, isolated linear memory). On top, embedders enforce per-VM caps via `Limits::sandbox()`; hits raise recoverable `RuntimeError` / `MemoryError` / `RecursionError` rather than crashing the host. See [Limits and errors](/reference/limits-and-errors#sandbox-limits).
52
52
53
53
## Where it runs
54
54
55
-
Single `.wasm` artifact (`compiler_lib.wasm`, 170 KB), runs anywhere WebAssembly does:
55
+
Single `.wasm` artifact (`compiler_lib.wasm`, to a less than 200 KB release) runs anywhere WebAssembly does:
56
56
57
57
-**Browser**: served alongside the [`runtime/`](https://github.com/dylan-sutton-chavez/edge-python/tree/main/runtime) JS package, which bridges `print()` and module imports across the `WASM <-> JS` boundary.
58
58
-**Server / edge runtimes**: Wasmtime, Wasmer, Cloudflare Workers, Fastly Compute, Spin. The host runtime owns I/O, fetching, and module loading.
0 commit comments