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.
- Secure by default. No file, network, or environment access, unless explicitly enabled by the host.
- Less than 200 KB footprint. The full compiler and runtime ship as a single WASM binary.
- Compile-time imports. Every module resolves at parse time no dynamic loading, no runtime surprises.
- No AST, source compiles directly to bytecode in a single pass: o(n)
- Demo: demo.edgepython.com
- Docs: edgepython.com
Cargo workspace; commands work from any directory.
├── cli
├── compiler
├── demo
├── docs
├── host
├── runtime
├── std
├── target
├── wasm-abi
└── wasm-pdk
cargo wasm # release .wasm (the distributed artifact)
cargo build --release # host .rlib + cdylib for Rust embedders
cargo test --release # full test suiteNative modules ship via three delivery paths (CDN .wasm, host capability, JS host module), see Writing modules.
download it to your machine (reference docs):
curl -fsSL https://dylan-sutton-chavez.github.io/edge-python/install.sh | sh
edge -h # List all commandsedge 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.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script type="module" src="https://cdn.edgepython.com/runtime/src/element.js"></script>
</head>
<body>
<edge-python entry="./app/main.py" packages="./app/packages.json"></edge-python>
</body>
</html>The runtime spawns a Web Worker that pre-fetches imports, dispatches native calls, and streams print() output back.
Declare edge-python as a dependency and compiler.wasm from the matching GitHub Release is fetched into OUT_DIR automatically, no manual download.
# Cargo.toml
[dependencies]
edge-python = { git = "https://github.com/dylan-sutton-chavez/edge-python", tag = "v0.1.0" }// build.rs
fn main() {
println!("cargo::rerun-if-changed=build.rs");
let wasm = std::env::var("DEP_COMPILER_LIB_WASM").expect("`DEP_COMPILER_LIB_WASM` unset, upstream must declare `links = \"compiler\"`");
std::fs::copy(&wasm, "runtime/compiler.wasm").expect("copy failed");
}Pin to a tag for reproducible builds; use branch = "main" for unreleased changes. Requires curl on PATH. Gated by the default-on prebuilt feature.
Edge Python is a cdylib, your host instantiates compiler.wasm and calls its exports. The same .wasm you serve to browsers is the server-side artifact; the host owns I/O, fetching, and output (WASI / runtime APIs instead of fetch / postMessage). No server-side CLI ships here (the cli/ tool targets the browser runtime), so embed compiler.wasm in around 50 LOC wasmtime shell for local dev.
Edge Python targets sandboxed edge computing: a dynamic, multi-paradigm Python subset with classes, async/await, structural pattern matching, and compile-time module resolution. There is no bundled stdlib, modules are external artifacts.
Full language reference, scope, and what intentionally isn't supported: What Edge Python is. Architecture details: compiler/README.md.
One workflow .github/workflows/main.yml that runs the complete CI/CD, where each package is a steps in a composite action under .github/actions/.
On pushes to main it deploys three Cloudflare Pages projects: edge-python-cdn (the bundled package artifacts), edge-python-demo, and edge-python-docs (served at edgepython.com).
MIT OR Apache-2.0
- PyneSys, since May 2026