ESP32-S3 Bench Guide
ESP32-S3 N16R8 bench guide: live pinout, lessons, simulators and the bench log.
Natter is a small Python interpreter written in JavaScript for teaching: fast to load, built-in debugger, never freezes the page.
EducationJavaScript · PythonGitHub @wi-wissenOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full README ↗A small Python interpreter written in JavaScript, made for teaching in the browser.
packages/core/src/browser.js). Standard modules, numpy, plots, forms and Pygame Zero are separate chunks (15 to 40 KB gzipped each) that load only when a program imports them. npm run size prints the numbers.Status: version 0.1. The language, the standard library and the browser hosts (console,
turtle,kara, Pygame Zero,guizeroforms, numpy and plots, with an image and sound library) are done and compared with CPython and the real libraries in the tests. Published on npm as@natterjs/core,@natterjs/weband@natterjs/assets; see Get started on https://natter.wi7.net/.
Natter is built to run the Python in these projects:
source -> lexer -> parser -> compiler -> bytecode VM
The VM is a stack machine with its own frame stack (no JavaScript recursion). It can stop and resume after any instruction. That allows an instruction budget per slice, suspending on input() or animated calls, and a debugger that pauses on statement boundaries. Modules reach the VM through a host bridge and do not touch the DOM from the core.
with, input(); math (correctly rounded), random, time, datetime, json, statistics, collections, itertools, functools, string, copy, sys, re, pprint, textwrap. All compared with CPython (packages/core/test).open(), os, os.path and import of your own files on an in-memory project (vm.fs); the host decides where it lives (folder, ZIP, browser). Code, errors and tracebacks carry their file, breakpoints work per file, and the web runner serves packages and relative imports from its files option. See docs/HOST-TURTLE-KARA.md.@natterjs/web (docs/HOST-TURTLE-KARA.md).@natterjs/assets (docs/PGZERO-BRIDGE.md).guizero API (a subset) on a grid that grows with its content, tested against guizero 1.6 (docs/FORMS-BRIDGE.md).matplotlib.pyplot as SVG (docs/NUMPY-PLOT.md).packages/web/DEVELOPMENT.md).eval/exec, server code, scraping and ML libraries.npm install
npm test # Vitest; compares the example programs with CPython when python3 is installed
npm run size # bundle the core, print minified and gzip size
The core lives in packages/core. Plain JavaScript with JSDoc, no TypeScript. The core must stay deterministic: a test forbids Math.sin, Math.pow, Date and similar in packages/core/src.
Example programs are in packages/core/test/cases/*.py with the output of CPython in *.out. To add a case, write the .py file and run python3 x.py > x.out.
A static overview page lives in docs/, published with GitHub Pages (source: main, folder /docs) at https://natter.wi7.net/ (custom domain natter.wi7.net, set in the repository's Pages settings).
The command reference (docs/reference/index.html) lists the language, the builtins, every standard module, turtle, kara (commands and world format), Pygame Zero (hooks, screen, Actor, keyboard, sounds, music, clock, images from the asset library), guizero, numpy, pyplot, requests with CORS, files and the asset library, each with a runnable example. It is generated from the interpreter: scripts/build-reference.mjs reads the module registries, builtins, stdlib, messages and packages/assets and adds the English text from scripts/reference/content.mjs. Every example and every language snippet runs while building. After changing a module, run
npm run reference # rewrite docs/reference/index.html
packages/core/test/reference.test.js fails when the page is stale, when a described name no longer exists or when an example stops working.
The sprite gallery (docs/sprites/index.html, https://natter.wi7.net/sprites/) shows every image and sound of @natterjs/assets by game type: the starter set first, then the rest of the packs, with search, animation previews, a detail view with code and copy-on-click names. It is generated from packages/assets/catalog.json and gametypes.json by scripts/build-sprites.mjs; the pictures are not copied into docs/ but loaded lazily from jsDelivr (https://cdn.jsdelivr.net/npm/@natterjs/assets@<version>/, version from packages/assets/package.json). To preview with local files, serve packages/assets and open the page with ?base=http://localhost:8123/. After changing the assets or bumping their version, run
npm run sprites # rewrite docs/sprites/index.html (--check only checks)
packages/assets/test/sprites-page.test.js fails when the page is stale or lists a name that is not in the catalog.
Drei Pakete auf npm, eine Version für alle:
| Paket | Inhalt |
|---|---|
@natterjs/core | Interpreter (Quelltext, ES-Module mit JSDoc), Node 18+ und Browser; @natterjs/core/browser ist der kleine Start ohne die in Python geschriebenen Module |
@natterjs/web | Browser-Host als fertiger Build dist/natter-web.js mit nachgeladenen Teilen (Kern eingebaut) |
@natterjs/assets | Bilder, Klänge, catalog.json (CC0, siehe packages/assets/LICENSE-ASSETS.md) |
Die README.md jedes Pakets ist seine englische Seite auf npm. Die ausführliche (deutsche) Entwicklerdokumentation steht in packages/web/DEVELOPMENT.md (Runner, Konsole, Turtle, Kara, Pygame Zero, Formulare, Plots) und packages/assets/DEVELOPMENT.md (Pakete, Katalog, Spielarten, neue Pakete); sie wird nicht mit veröffentlicht.
Mit npm und Bundler (Vite, esbuild, webpack):
npm install @natterjs/web @natterjs/assets
import { createRunner, createConsole } from '@natterjs/web';
const runner = createRunner();
createConsole(document.querySelector('#console')).connect(runner);
await runner.run('print(1 + 1)');
In Node (Tests, Werkzeuge):
import { runToEnd } from '@natterjs/core'; // npm install @natterjs/core
console.log(runToEnd('print(1 + 1)').output); // 2
Statische Seite ohne Build, über jsDelivr (immer mit fester Version):
<div id="console"></div>
<script type="module">
import { createRunner, createConsole, createPgzero } from 'https://cdn.jsdelivr.net/npm/@natterjs/[email protected]/dist/natter-web.js';
const runner = createRunner();
createConsole(document.querySelector('#console')).connect(runner);
await runner.run('for i in range(3):\n print("Hallo", i)');
// Bildbibliothek für Pygame Zero und Kara:
// createPgzero(el, { assets: { baseUrl: 'https://cdn.jsdelivr.net/npm/@natterjs/[email protected]/', catalog: 'catalog.json' } })
</script>
natter-web.js lädt seine Teile (stdlib-…js, numpy-…js …) von seinem eigenen Ort nach. Wer selbst hostet, kopiert den ganzen Ordner dist/ (aus node_modules/@natterjs/web/dist/ oder aus natter-web-<version>.zip der GitHub-Releases) und für Bilder den Inhalt von @natterjs/assets. import { assetsOption } from '@natterjs/assets' liefert { baseUrl, catalog } relativ zum Paket, wenn es so ausgeliefert wird, wie es ist.
Ohne npm-Registry, aus dem GitHub-Release: jedes Release hat die npm-Tarballs als Anhang (mit SHA256SUMS.txt):
npm install https://github.com/wi-wissen/Natter/releases/download/v0.1.0/natterjs-core-0.1.0.tgz \
https://github.com/wi-wissen/Natter/releases/download/v0.1.0/natterjs-web-0.1.0.tgz
(@natterjs/web hängt von @natterjs/core ab, darum beide.) jsDelivr direkt aus GitHub (https://cdn.jsdelivr.net/gh/wi-wissen/[email protected]/…) liefert nur, was im Repository liegt: die Bibliothek (…/packages/assets/catalog.json) und den Quelltext, aber nicht dist/, das nicht eingecheckt ist. Für den Browser-Build also die npm-Adresse oben nehmen.
Ein Tag v<version> startet .github/workflows/release.yml: Lizenz- und Versionsprüfung (scripts/release-check.mjs), npm ci, Tests, Build, Größenbericht, npm pack und npm publish --provenance für @natterjs/assets, @natterjs/core, @natterjs/web (in dieser Reihenfolge; was schon auf npm liegt, wird übersprungen, ein fehlgeschlagener Lauf lässt sich neu starten), dann ein GitHub-Release mit erzeugten Notizen, natter-web-<version>.zip, den drei Tarballs und SHA256SUMS.txt. Von Hand geht es auch: Actions → Release → „Run workflow“ mit der Version (legt den Tag an). Bei jedem Push und Pull Request laufen Tests, Build und Größenbericht (.github/workflows/ci.yml).
Neue Version:
node scripts/set-version.mjs 0.2.0 # alle package.json und die internen Abhängigkeiten
npm install # package-lock.json
git commit -am "Release 0.2.0" && git push origin main
Jede Veröffentlichung braucht ein npm-Token (Trusted Publishing entfällt, npm verlangt dafür einen Sicherheitsschlüssel). Ablauf bei jedem Release:
@natterjs/assets, @natterjs/core, @natterjs/web (oder den ganzen Scope @natterjs), Option Bypass two-factor authentication an, keine IP-Einschränkung (GitHub-Runner wechseln die Adresse), Laufzeit so kurz wie möglich (höchstens 90 Tage).NPM_TOKEN speichern (Settings → Secrets and variables → Actions; ein altes Secret NPM_INIT_TOKEN wird ersatzweise noch gelesen).LICENSE steht der Name des Rechteinhabers (der Release-Lauf bricht ab, solange dort ein Platzhalter steht).Code: MIT, see LICENSE (with the notices of the third-party code in packages/core). Images and sounds in packages/assets: CC0, see packages/assets/LICENSE-ASSETS.md.