Skip to content

Commit 16be0e6

Browse files
docs: Clean README.md redaction.
1 parent 22e2959 commit 16be0e6

2 files changed

Lines changed: 40 additions & 18 deletions

File tree

README.md

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1-
# Edge Python
1+
<div align="center">
2+
<a href="https://edgepython.com/" target="_blank">
3+
<picture>
4+
<img width="300" src="docs/public/static/banner.svg" alt="Edge Python Logo">
5+
</picture>
6+
</a>
7+
</div>
28

3-
A compact bytecode compiler and stack VM for a sandboxed Python subset, written in Rust. See [Design](https://edgepython.com/implementation/design) for the architecture.
9+
<br/>
410

5-
Edge Python is distributed as a WebAssembly module, `compiler.wasm`, around 170 KB. It runs anywhere WebAssembly runs: browsers, Cloudflare Workers, Fastly Compute, Wasmtime, Wasmer, Spin. Sandboxed by construction.
11+
Edge is a sandboxed subset of Python, compiled to a less than 200 KB WebAssembly binary and built in Rust to run on Cloudflare Workers and in the browser. Embed your full business logic, run LLMs client-side, build frontend apps and serverless workloads.
612

7-
- **Demo:** [demo.edgepython.com](https://demo.edgepython.com/)
8-
- **Docs:** [edgepython.com](https://edgepython.com/)
13+
- Secure by default. No file, network, or environment access, unless explicitly enabled by the [host](https://edgepython.com/reference/packages#host-libraries).
14+
- Less than 200 KB footprint. The full compiler and runtime ship as a single WASM binary.
15+
- Compile-time imports. Every module resolves at parse time no dynamic loading, no runtime surprises.
16+
- No AST, source compiles directly to bytecode in a single pass: o(n)
17+
18+
## More about it
19+
20+
- Demo: [demo.edgepython.com](https://demo.edgepython.com/)
21+
- Docs: [edgepython.com](https://edgepython.com/)
922

1023
## Repository layout
1124

@@ -25,7 +38,7 @@ Cargo workspace; commands work from any directory.
2538
```
2639

2740
```bash
28-
cargo wasm # release .wasm (the distributed artifact)
41+
cargo wasm # release .wasm (the distributed artifact)
2942
cargo build --release # host .rlib + cdylib for Rust embedders
3043
cargo test --release # full test suite
3144
```
@@ -36,30 +49,32 @@ Native modules ship via three delivery paths (CDN `.wasm`, host capability, JS h
3649

3750
### CLI
3851

52+
download it to your machine ([reference docs](https://edgepython.com/reference/cli)):
53+
3954
```bash
40-
cargo install --path cli
41-
edge init my-app && cd my-app
42-
edge run main.py
55+
curl -fsSL https://dylan-sutton-chavez.github.io/edge-python/install.sh | sh
56+
57+
edge -h # List all commands
4358
```
4459

45-
`edge` hosts the runtime in a headless Chromium provisioned by `install.sh` (apt, dnf, pacman, zypper, apk, or brew on macOS); see [`cli/README.md`](cli/README.md) for `serve`, `repl`, `build`, `uninstall`.
60+
`edge` hosts the runtime in a headless Chromium provisioned by `install.sh` (apt, dnf, pacman, zypper, apk, or brew on macOS) for `serve`, `repl`, `build` and `uninstall`.
4661

4762
### Browser
4863

4964
```html
5065
<!DOCTYPE html>
5166
<html>
5267
<head>
53-
<meta charset="UTF-8">
54-
<script type="module" src="https://runtime.edgepython.com/js/src/element.js"></script>
68+
<meta charset="UTF-8">
69+
<script type="module" src="https://runtime.edgepython.com/js/src/element.js"></script>
5570
</head>
5671
<body>
57-
<edge-python entry="./app/main.py" packages="./app/packages.json"></edge-python>
72+
<edge-python entry="./app/main.py" packages="./app/packages.json"></edge-python>
5873
</body>
5974
</html>
6075
```
6176

62-
The runtime spawns a Web Worker that pre-fetches imports, dispatches native calls, and streams `print()` output back. Build the WASM yourself with `cargo wasm` (output around 390 KB unstripped; optionally `wasm-opt -Oz` to shrink).
77+
The runtime spawns a Web Worker that pre-fetches imports, dispatches native calls, and streams `print()` output back.
6378

6479
### Consume the release from a Rust host
6580

@@ -74,10 +89,9 @@ edge-python = { git = "https://github.com/dylan-sutton-chavez/edge-python", tag
7489
```rust
7590
// build.rs
7691
fn main() {
77-
println!("cargo::rerun-if-changed=build.rs");
78-
let wasm = std::env::var("DEP_COMPILER_LIB_WASM")
79-
.expect("`DEP_COMPILER_LIB_WASM` unset, upstream must declare `links = \"compiler_lib\"`");
80-
std::fs::copy(&wasm, "runtime/compiler_lib.wasm").expect("copy failed");
92+
println!("cargo::rerun-if-changed=build.rs");
93+
let wasm = std::env::var("DEP_COMPILER_LIB_WASM").expect("`DEP_COMPILER_LIB_WASM` unset, upstream must declare `links = \"compiler_lib\"`");
94+
std::fs::copy(&wasm, "runtime/compiler_lib.wasm").expect("copy failed");
8195
}
8296
```
8397

docs/public/static/banner.svg

Lines changed: 8 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)