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
{{ message }}
Repository navigation
Commit be5e7f6
Browse filesBrowse the repository at this point in the historyBrowse files
feat: teach numpy view/copy on the canvas (curriculum phase 1)
Add the numpy series. An ndarray is a window over a separate buffer box, so
.copy() mints a new buffer, a slice is a view that shares the buffer, a + 1
vectorizes into a new buffer, and .sum() folds the buffer to a scalar. New
isNdarray / sharesBuffer / independentBuffer predicates and a 5-level series.
Also, as part of this increment:
- split the level catalog into per-series modules under src/levels/
- tag every level with an ELI band and make the level tests invariant-based
- add the RAM-view data model (addr / byteSize / refCount / seg) to heap objects
-**NumPy:**`np.array` → an ndarray *window* over a separate **buffer** box; `.copy()` mints a new buffer; a slice is a *view* sharing the same buffer; `a + 1` vectorizes into a new buffer; `a.sum()` folds to a scalar
Not in v0: classes, real module imports (only the simulated `copy`, `collections`, `functools`), control flow (`if`/`for`/`while`), exceptions (beyond clean parse/runtime errors), comprehensions, I/O, async, `range`/`sorted`/`min`/`max`, full CPython semantics.
73
+
Not in v0: classes, real module imports (only the simulated `copy`, `collections`, `functools`, `numpy`), control flow (`if`/`for`/`while`), exceptions (beyond clean parse/runtime errors), comprehensions, I/O, async, `range`/`sorted`/`min`/`max`, full CPython semantics.
73
74
74
-
A planned curriculum extends this with numpy, pandas, re, datetime and more — all drawn on the same memory canvas. See `docs/ENGINE-EXTENSION.md` and `docs/adr/002-library-modules.md`.
75
+
A planned curriculum extends this with pandas, re, datetime and more — all drawn on the same memory canvas. See `docs/ENGINE-EXTENSION.md` and `docs/adr/002-library-modules.md`.
@@ -90,7 +91,7 @@ The engine is intentionally a **teaching subset**, not CPython. Every state tran
90
91
91
92
## Levels
92
93
93
-
Nine series — Names & Bindings, Aliasing & Copy, Containers in Memory, **Copy Semantics** (shallow vs deep), **Iterators & Iterables**, **Defaults & Functional** (defaultdict, map, filter), Mutation & Methods, Functions & Frames, Plotting & Capstone. Each of the 35 levels has a brief, optional hint, a goal (predicate or target snapshot), a statement-par for golf, and a worked solution.
94
+
Ten series — Names & Bindings, Aliasing & Copy, Containers in Memory, **Copy Semantics** (shallow vs deep), **Iterators & Iterables**, **Defaults & Functional** (defaultdict, map, filter), **NumPy: Buffers & Views** (ndarray, buffer, `.copy()`, slice-as-view), Mutation & Methods, Functions & Frames, Plotting & Capstone. Each of the 40 levels has a brief, optional hint, a goal (predicate or target snapshot), a statement-par for golf, and a worked solution.
0 commit comments