A compact, single-pass SSA bytecode compiler and stack VM for a functional subset of CPython 3.13 syntax. Hand-written lexer, Pratt parser that emits bytecode directly, and a threaded-code interpreter with per-instruction inline caching and pure-function memoization.
Built for deterministic execution in sandboxed and embedded environments. The release WASM build is ~130 KB.
- Demo: demo.edgepython.com
- Docs: edgepython.com
# Rust crate: lexer, parser, optimizer, VM
compiler/
# Browser playground (HTML + WASM + Web Worker)
demo/
# Mintlify documentation source
documentation/
# CI/CD pipelines (lint, native builds, WASM, demo)
.github/
# Native binary
cd compiler
cargo build --release
./target/release/edge -c 'print((lambda x: x * 2)(21))'
# Run a file with sandbox limits
./target/release/edge --sandbox script.pyPre-built binaries for Linux, macOS, and Windows are available on the releases page.
Edge Python targets functional edge computing: first-class functions, lambdas, closures, generators, comprehensions, and pure-function memoization. Classes are supported with __init__, attributes, and methods. Imports parse for compatibility but raise at runtime; there is no module system.
For architecture details, see compiler/README.md. For language reference and implementation notes, see the docs.
MIT OR Apache-2.0