Skip to content

dylan-sutton-chavez/edge-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

480 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Edge Python

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.

Repository layout

# 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/

Quick start

# 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.py

Pre-built binaries for Linux, macOS, and Windows are available on the releases page.

What it is

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.

License

MIT OR Apache-2.0

About

A compact, single-pass SSA-style bytecode compiler and stack VM for a subset of CPython 3.13 syntax. Hand-written lexer, Pratt-precedence parser that emits bytecode directly (no AST), and a threaded-code interpreter with per-instruction inline caching. Built for deterministic execution in sandboxed and embedded environments (≈130 KB WASM release).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages