Skip to content

Commit 58e1a8a

Browse files
docs: Update project docs.
1 parent ab9837a commit 58e1a8a

3 files changed

Lines changed: 97 additions & 35 deletions

File tree

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Edge Python
2+
3+
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.
4+
5+
Built for deterministic execution in sandboxed and embedded environments. The release WASM build is ~130 KB.
6+
7+
- **Demo:** [demo.edgepython.com](https://demo.edgepython.com/)
8+
- **Docs:** [edgepython.com](https://edgepython.com/)
9+
10+
## Repository layout
11+
12+
```text
13+
# Rust crate: lexer, parser, optimizer, VM
14+
compiler/
15+
16+
# Browser playground (HTML + WASM + Web Worker)
17+
demo/
18+
19+
# Mintlify documentation source
20+
documentation/
21+
22+
# CI/CD pipelines (lint, native builds, WASM, demo)
23+
.github/
24+
```
25+
26+
## Quick start
27+
28+
```bash
29+
# Native binary
30+
cd compiler
31+
cargo build --release
32+
./target/release/edge -c 'print((lambda x: x * 2)(21))'
33+
34+
# Run a file with sandbox limits
35+
./target/release/edge --sandbox script.py
36+
```
37+
38+
Pre-built binaries for Linux, macOS, and Windows are available on the [releases page](https://github.com/dylan-sutton-chavez/edge-python/releases).
39+
40+
## What it is
41+
42+
Edge Python targets functional edge computing: first-class functions, lambdas, closures, generators, comprehensions, and pure-function memoization. Classes and imports parse for compatibility but raise at runtime. There is no object model and no module system.
43+
44+
For architecture details, see [`compiler/README.md`](compiler/README.md). For language reference and implementation notes, see the [docs](https://edgepython.com/).
45+
46+
## License
47+
48+
MIT OR Apache-2.0

compiler/README.md

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -78,35 +78,49 @@ Mark-and-sweep with roots: stack, globals, iterator frames, current slot window,
7878
## 7. Project Structure
7979

8080
```text
81-
src/
82-
├── lib.rs
83-
├── main.rs
84-
└── modules/
85-
├── fstr.rs
86-
├── fx.rs
87-
├── lexer/
88-
│ ├── mod.rs
89-
│ ├── scan.rs
90-
│ └── tables.rs
91-
├── parser/
92-
│ ├── mod.rs
93-
│ ├── expr.rs
94-
│ ├── stmt.rs
95-
│ ├── control.rs
96-
│ ├── literals.rs
97-
│ └── types.rs
98-
└── vm/
99-
├── mod.rs
100-
├── cache.rs
101-
├── optimizer.rs
102-
├── ops.rs
103-
├── types.rs
104-
├── builtins.rs
105-
└── handlers/
106-
├── arith.rs
107-
├── data.rs
108-
├── function.rs
109-
└── methods.rs
81+
├── Cargo.lock
82+
├── Cargo.toml
83+
├── README.md
84+
├── src
85+
│ ├── lib.rs
86+
│ ├── main.rs
87+
│ ├── modules
88+
│ │ ├── fstr.rs
89+
│ │ ├── fx.rs
90+
│ │ ├── lexer
91+
│ │ │ ├── mod.rs
92+
│ │ │ ├── scan.rs
93+
│ │ │ └── tables.rs
94+
│ │ ├── parser
95+
│ │ │ ├── control.rs
96+
│ │ │ ├── expr.rs
97+
│ │ │ ├── literals.rs
98+
│ │ │ ├── mod.rs
99+
│ │ │ ├── stmt.rs
100+
│ │ │ └── types.rs
101+
│ │ └── vm
102+
│ │ ├── builtins.rs
103+
│ │ ├── cache.rs
104+
│ │ ├── handlers
105+
│ │ │ ├── arith.rs
106+
│ │ │ ├── data.rs
107+
│ │ │ ├── function.rs
108+
│ │ │ ├── methods.rs
109+
│ │ │ └── mod.rs
110+
│ │ ├── mod.rs
111+
│ │ ├── ops.rs
112+
│ │ ├── optimizer.rs
113+
│ │ └── types.rs
114+
│ └── wasm.rs
115+
└── tests
116+
├── cases
117+
│ ├── lexer.json
118+
│ ├── parser.json
119+
│ └── vm.json
120+
├── lexer.rs
121+
├── main.rs
122+
├── parser.rs
123+
└── vm.rs
110124
```
111125

112126
---

documentation/reference/methods.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ True
9898

9999
```python
100100
print("a,b,c".split(","))
101-
print("hello world".split()) # any whitespace
101+
print("hello world".split()) # any whitespace
102102
print(",".join(["a", "b", "c"]))
103103
print("hello".replace("l", "L"))
104104
```
@@ -136,7 +136,7 @@ print(xs.count(2))
136136

137137
ys = xs.copy()
138138
ys.append(99)
139-
print(xs) # original unchanged
139+
print(xs) # original unchanged
140140
print(ys)
141141
```
142142

@@ -173,13 +173,13 @@ print(xs)
173173
```python
174174
xs = [1, 2, 3, 2]
175175

176-
xs.remove(2) # first occurrence
176+
xs.remove(2) # first occurrence
177177
print(xs)
178178

179-
popped = xs.pop() # last
179+
popped = xs.pop() # last
180180
print(popped, xs)
181181

182-
popped = xs.pop(0) # by index
182+
popped = xs.pop(0) # by index
183183
print(popped, xs)
184184
```
185185

@@ -264,7 +264,7 @@ fallback
264264
```python
265265
d = {}
266266
d.setdefault("a", 1)
267-
d.setdefault("a", 999) # second call ignored
267+
d.setdefault("a", 999) # second call ignored
268268
print(d)
269269
```
270270

0 commit comments

Comments
 (0)