You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -65,58 +65,11 @@ Open the [playground](https://demo.edgepython.com) and try the SimplePerceptron
65
65
greet =lambdaname: f"Hello, {name}!"
66
66
67
67
for who in ["world", "edge", "python"]:
68
-
print(greet(who))
68
+
print(greet(who))
69
69
```
70
70
71
71
```text Output
72
72
Hello, world!
73
73
Hello, edge!
74
74
Hello, python!
75
75
```
76
-
77
-
## Language overview
78
-
79
-
Edge Python is a Python subset with classes, async/await, structural pattern matching, and `packages.json` imports, compiled to bytecode and run on a sandboxed WebAssembly VM.
80
-
81
-
```python
82
-
# First-class functions
83
-
ops = [abs, len, str]
84
-
print([f(-3) for f in ops])
85
-
86
-
# Currying with closures
87
-
add =lambdax: lambday: x + y
88
-
print(add(3)(4))
89
-
90
-
# Pure functions are template-memoised after two hits with the same arguments (no decorators needed, this is detected by the VM)
91
-
deffib(n):
92
-
if n <2: return n
93
-
return fib(n -1) + fib(n -2)
94
-
95
-
print(fib(20))
96
-
```
97
-
98
-
```text Output
99
-
[3, 2, '-3']
100
-
7
101
-
6765
102
-
```
103
-
104
-
## Next steps
105
-
106
-
<CardGroupcols={2}>
107
-
<Cardtitle="What it is"icon="compass"href="/getting-started/what-it-is">
108
-
Scope, paradigm, and what intentionally isn't supported.
Pre-built `.wasm` is served from `https://std.edgepython.com/json.wasm`. Full API: [`std/json/README.md`](https://github.com/dylan-sutton-chavez/edge-python/tree/main/std/json).
34
34
35
-
> **`json` is an external package, but the browser runtime resolves it by default.** It isn't compiled into `compiler_lib.wasm`, it's this `.wasm` package. In the browser runtime you can write `from json import ...` with no `packages.json` (a built-in [default](#defaults), fetched lazily on first import). Other hosts, or `defaults: false`, need it declared (alias or URL) like any other module.
35
+
> **`json` is an external `.wasm`package, not built into `compiler_lib.wasm`** — the browser runtime just resolves it by [default](#defaults), so `from json import ...` works with no manifest.
0 commit comments