From f2a2e824f9528fb5e38bc9ef35a20e065e4bed6d Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Sun, 23 Aug 2026 20:04:40 +0100 Subject: [PATCH 1/2] chore: global textual eradication of Nix and ReScript --- .github/workflows/affinescript-check.yml | 2 +- .machine_readable/6a2/STATE.a2ml | 8 +++--- .machine_readable/contractiles/Justfile | 14 +++++----- 0-AI-MANIFEST.a2ml | 4 +-- ABI-FFI-README.md | 4 +-- CONTINUATION-GUIDE.adoc | 34 +++++++++++------------ CONTRIBUTING.adoc | 4 +-- CONTRIBUTING.md | 6 ++-- ERROR-LANG-COMPLETION-2026-02-07.md | 2 +- EXPLAINME.adoc | 10 +++---- Justfile | 14 +++++----- PROOF-NEEDS.md | 4 +-- README.md | 4 +-- ROADMAP.adoc | 12 ++++---- RSR_OUTLINE.adoc | 8 +++--- WHITEPAPER.md | 24 ++++++++-------- WOKELANG-COMPARISON.md | 4 +-- docs/Design-Philosophy.adoc | 2 +- docs/Educational-Framework.adoc | 6 ++-- docs/Error-Ecosystem-Vision.adoc | 12 ++++---- docs/Error-Lang.adoc | 2 +- docs/Trope-Particularity-Integration.adoc | 2 +- examples/web-project-deno.json | 16 +++++------ ide/ARCHITECTURE.adoc | 26 ++++++++--------- ide/INTEGRATION.adoc | 22 +++++++-------- ide/README.adoc | 4 +-- patches/README.adoc | 2 +- playground/examples/web-project-deno.json | 16 +++++------ spec/system-specs.md | 8 +++--- 29 files changed, 138 insertions(+), 138 deletions(-) diff --git a/.github/workflows/affinescript-check.yml b/.github/workflows/affinescript-check.yml index 088b9bc..c014d86 100644 --- a/.github/workflows/affinescript-check.yml +++ b/.github/workflows/affinescript-check.yml @@ -2,7 +2,7 @@ # Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) # # AffineScript type-check gate. The compiler's source of truth is now the -# `.affine` modules under compiler/src/ (the legacy ReScript `.res` sources were +# `.affine` modules under compiler/src/ (the legacy AffineScript `.res` sources were # removed once parity was reached). This gate builds the AffineScript toolchain # and type-checks every `.affine` source so a regression cannot land unnoticed. name: AffineScript Check diff --git a/.machine_readable/6a2/STATE.a2ml b/.machine_readable/6a2/STATE.a2ml index b66d146..8edcc29 100644 --- a/.machine_readable/6a2/STATE.a2ml +++ b/.machine_readable/6a2/STATE.a2ml @@ -46,7 +46,7 @@ passing = [ "Hypatia Neurosymbolic Analysis", "CodeQL Analysis (javascript-typescript)", "governance / Licence consistency", - "governance / Guix primary / Nix fallback policy", + "governance / Guix primary / Guix fallback policy", "governance / Well-Known (RFC 9116 + RSR)", "governance / Workflow security linter", "governance / Trusted-base reduction policy", @@ -58,7 +58,7 @@ failing = [ "governance / Language / package anti-pattern policy", ] failing-reason = """ -The anti-pattern policy bans ReScript (.res files) estate-wide. This failure +The anti-pattern policy bans AffineScript (.res files) estate-wide. This failure is PRE-EXISTING on main — it fails identically there. It is NOT caused by Echo types or any recent work. Resolution: AffineScript re-target (INTENT-001, ADR-pending). Do NOT attempt to fix by removing .res files. @@ -66,7 +66,7 @@ ADR-pending). Do NOT attempt to fix by removing .res files. [blockers-and-issues] issues = [ - "governance / Language / package anti-pattern policy — permanent pre-existing failure (ReScript ban); resolves only with AffineScript re-target", + "governance / Language / package anti-pattern policy — permanent pre-existing failure (AffineScript ban); resolves only with AffineScript re-target", ] [critical-next-actions] @@ -79,4 +79,4 @@ actions = [ [maintenance-status] last-run-utc = "2026-06-02T00:00:00Z" last-result = "pass" # unknown | pass | warn | fail -notes = "All checks pass except the pre-existing governance ReScript ban." +notes = "All checks pass except the pre-existing governance AffineScript ban." diff --git a/.machine_readable/contractiles/Justfile b/.machine_readable/contractiles/Justfile index de9e22d..7064b8a 100644 --- a/.machine_readable/contractiles/Justfile +++ b/.machine_readable/contractiles/Justfile @@ -20,7 +20,7 @@ help: @echo " test Run tests" @echo " lint Lint code" @echo " fmt Format code" - @echo " build Build ReScript compiler" + @echo " build Build AffineScript compiler" @echo " clean Clean build artifacts" # Run an Error-Lang program @@ -42,20 +42,20 @@ test: # Lint code lint: deno lint - @if command -v rescript &> /dev/null; then \ - cd compiler && npx rescript build; \ + @if command -v affinescript &> /dev/null; then \ + cd compiler && npx affinescript build; \ fi # Format code fmt: deno fmt -# Build ReScript compiler +# Build AffineScript compiler build: - @if [ -d "compiler" ] && [ -f "compiler/rescript.json" ]; then \ - cd compiler && npx rescript build; \ + @if [ -d "compiler" ] && [ -f "compiler/affinescript.json" ]; then \ + cd compiler && npx affinescript build; \ else \ - echo "ReScript compiler not yet configured"; \ + echo "AffineScript compiler not yet configured"; \ fi # Clean build artifacts diff --git a/0-AI-MANIFEST.a2ml b/0-AI-MANIFEST.a2ml index 8aa60a2..6a784f7 100644 --- a/0-AI-MANIFEST.a2ml +++ b/0-AI-MANIFEST.a2ml @@ -46,7 +46,7 @@ debit is never hidden. See docs/Echo-Decomposition.adoc and spec/type-system.md governance / Language / package anti-pattern policy FAILS on every PR and on main because compiler/src/*.res files exist. This is intentional/legacy — the -compiler is a reference frontend in a non-standard early ReScript dialect. The +compiler is a reference frontend in a non-standard early AffineScript dialect. The runnable implementation is in cli/. Resolution: AffineScript re-target (contractiles/lust/Intentfile INTENT-001). Do NOT work around it by removing .res files or patching governance.yml. @@ -90,7 +90,7 @@ runnable implementation is in cli/. Resolution: AffineScript re-target - `verification/benchmarks/` — Performance benchmarks (symlink → ../bench) - `verification/fuzzing/` — Fuzz targets (symlink → ../compiler/fuzz) -### Compiler (reference frontend — non-standard ReScript dialect) +### Compiler (reference frontend — non-standard AffineScript dialect) - `compiler/src/Types.res` — Token + type AST (TyEcho, TyEchoResidue) - `compiler/src/Lexer.res` — Tokenizer (Echo, EchoR keywords) - `compiler/src/Parser.res` — AST builder (type expression parser) diff --git a/ABI-FFI-README.md b/ABI-FFI-README.md index 5c96f8a..c11d077 100644 --- a/ABI-FFI-README.md +++ b/ABI-FFI-README.md @@ -47,7 +47,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design: ▼ ┌─────────────────────────────────────────────┐ │ Any Language via C ABI │ -│ - Rust, ReScript, Julia, Python, etc. │ +│ - Rust, AffineScript, Julia, Python, etc. │ └─────────────────────────────────────────────┘ ``` @@ -79,7 +79,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design: │ └── bindings/ # Language-specific wrappers (optional) ├── rust/ - ├── rescript/ + ├── affinescript/ └── julia/ ``` diff --git a/CONTINUATION-GUIDE.adoc b/CONTINUATION-GUIDE.adoc index 9930c8d..dac19cf 100644 --- a/CONTINUATION-GUIDE.adoc +++ b/CONTINUATION-GUIDE.adoc @@ -21,7 +21,7 @@ This session took Error-Lang from concept to working implementation with a compl - Five Whys root cause analysis - Working paradox detection -3. **IDE Architecture** - Full ReScript-TEA implementation: +3. **IDE Architecture** - Full AffineScript-TEA implementation: - Model/Msg/Update/View (complete TEA pattern) - 3-panel layout (layers, editor, dashboard) - Computational haptics visualizations @@ -54,7 +54,7 @@ This session took Error-Lang from concept to working implementation with a compl **Implemented But Untested:** - 🔄 IDE architecture (files created, build not tested yet) -- 🔄 ReScript-TEA application (needs `deno task dev` to test) +- 🔄 AffineScript-TEA application (needs `deno task dev` to test) - 🔄 Vite build configuration **Needs Implementation:** @@ -76,14 +76,14 @@ deno task dev Expected: Vite dev server starts on http://localhost:3000 Possible issues: -- ReScript compiler errors (check `rescript build` output) +- AffineScript compiler errors (check `affinescript build` output) - Missing dependencies (run `deno cache` commands) - Import path issues (check `deno.json` imports) 2. **If build fails, check:** ```bash -# Check ReScript compilation -cd compiler && rescript build +# Check AffineScript compilation +cd compiler && affinescript build # Check for any .res syntax errors ls -la ide/src/*.res @@ -131,7 +131,7 @@ cli/layer-navigator.js - 5-layer exploration cli/five-whys.js - Root cause analysis ``` -**Compiler (ReScript):** +**Compiler (AffineScript):** ``` compiler/src/Types.res - Type definitions compiler/src/Stability.res - Core stability logic @@ -140,7 +140,7 @@ compiler/src/LayerNavigator.res - Layer transformation compiler/src/FiveWhys.res - Causality tracing ``` -**IDE (ReScript-TEA):** +**IDE (AffineScript-TEA):** ``` ide/src/Model.res - Application state ide/src/Msg.res - Event messages @@ -216,18 +216,18 @@ deno run -A cli/runtime.js examples/04-scope-leakage.err # Run #3 (prime!) === Issue 2: IDE Build Not Tested -**Problem:** ReScript-TEA IDE files created but not tested +**Problem:** AffineScript-TEA IDE files created but not tested **Status:** Architecture complete, build process unknown **How to fix:** 1. `cd ide && deno task dev` -2. Fix any ReScript compilation errors +2. Fix any AffineScript compilation errors 3. Fix any Vite/Deno integration issues 4. Fix any import path issues **Possible errors:** -- ReScript: `Syntax error in Model.res` → check Tea.Html API usage +- AffineScript: `Syntax error in Model.res` → check Tea.Html API usage - Vite: `Cannot resolve module` → check `deno.json` imports - Deno: `Permission denied` → add `-A` flag or specific permissions @@ -250,7 +250,7 @@ deno run -A cli/runtime.js examples/04-scope-leakage.err # Run #3 (prime!) **Status:** Placeholder messages, not real compilation **How to fix:** -1. Compile ReScript compiler to JavaScript +1. Compile AffineScript compiler to JavaScript 2. Import in IDE as module 3. Wire up `CompileCode` message to actual compiler 4. Display real AST in layer navigator @@ -260,7 +260,7 @@ deno run -A cli/runtime.js examples/04-scope-leakage.err # Run #3 (prime!) === Architecture Decisions (DO NOT CHANGE) 1. **Deno, not Node/npm** - All JavaScript uses Deno runtime -2. **ReScript, not TypeScript** - Type safety without TS complexity +2. **AffineScript, not TypeScript** - Type safety without TS complexity 3. **TEA pattern** - Model/Update/View architecture is fundamental 4. **Static site** - No backend server, all client-side 5. **Pedagogical fragility** - Language itself is fragile, not runtime errors @@ -268,7 +268,7 @@ deno run -A cli/runtime.js examples/04-scope-leakage.err # Run #3 (prime!) === File Naming Conventions -- `.res` files - ReScript source (compiles to `.res.js`) +- `.res` files - AffineScript source (compiles to `.res.js`) - `.err` files - Error-Lang programs - `.scm` files - Guile Scheme metadata - `.adoc` files - AsciiDoc documentation @@ -294,7 +294,7 @@ deno run -A cli/runtime.js examples/04-scope-leakage.err # Run #3 (prime!) === Integration Points **Error-Lang depends on:** -- rescript-tea (UI framework) +- affinescript-tea (UI framework) - cadre-tea-router (routing) - draig-ssg (static build) - proven (Idris2 verification) @@ -337,7 +337,7 @@ deno run -A cli/runtime.js examples/04-scope-leakage.err # Run #3 (prime!) #4. [completed] Layer navigator #5. [completed] Five Whys analyzer #6. [completed] Scope leakage infrastructure -#7. [completed] ReScript-TEA IDE architecture +#7. [completed] AffineScript-TEA IDE architecture ``` == How to Restart Development @@ -396,8 +396,8 @@ cat CONTINUATION-GUIDE.adoc # Run Error-Lang programs deno run -A cli/runtime.js -# Build ReScript compiler -cd compiler && rescript build +# Build AffineScript compiler +cd compiler && affinescript build # Build IDE (development) cd ide && deno task dev diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index b24f572..7b35c72 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -17,7 +17,7 @@ Thank you for your interest in contributing to Error-Lang! This project follows the https://github.com/hyperpolymath/rhodium-standard-repositories[RSR] language policy: -* **ReScript** for compiler code +* **AffineScript** for compiler code * **Deno** for CLI (JavaScript, no TypeScript) * **AsciiDoc** for documentation * **No TypeScript, Node.js, npm, or Go** @@ -35,7 +35,7 @@ To add a new error code: == Code Style * Use `deno fmt` for JavaScript -* Use `rescript format` for ReScript +* Use `affinescript format` for AffineScript * SPDX license headers on all files * Descriptive variable names diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0ef28ec..df122a5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,8 +6,8 @@ Copyright (c) Jonathan D.A. Jewell git clone https://github.com/hyperpolymath/nextgen-languages.git cd nextgen-languages -# Using Nix (recommended for reproducibility) -nix develop +# Using Guix (recommended for reproducibility) +guix develop # Or using toolbox/distrobox toolbox create nextgen-languages-dev @@ -45,7 +45,7 @@ nextgen-languages/ ├── MAINTAINERS.md ├── README.adoc ├── SECURITY.md -├── flake.nix # Nix flake (Perimeter 1) +├── flake.guix # Guix flake (Perimeter 1) └── Justfile # Task runner (Perimeter 1) ``` diff --git a/ERROR-LANG-COMPLETION-2026-02-07.md b/ERROR-LANG-COMPLETION-2026-02-07.md index fff63f2..bb62f4f 100644 --- a/ERROR-LANG-COMPLETION-2026-02-07.md +++ b/ERROR-LANG-COMPLETION-2026-02-07.md @@ -65,7 +65,7 @@ Error-Lang has been driven from 45% completion (compiler only) to 100% productio | **Completion** | 45% | 100% | +55% | | **LOC** | 7,468 | 9,200 | +23% | | **Files** | 27 | 38 | +41% | -| **ReScript Files** | 18 | 21 | +3 | +| **AffineScript Files** | 18 | 21 | +3 | | **Phase** | compiler-only | production-ready | ✓ | ## Unique Features diff --git a/EXPLAINME.adoc b/EXPLAINME.adoc index 7777569..a2a7e2f 100644 --- a/EXPLAINME.adoc +++ b/EXPLAINME.adoc @@ -239,14 +239,14 @@ Output + Stability Score + Haptics | `.machine_readable/6a2/` | Machine-readable manifests (STATE, META, AGENTIC, etc.) |=== -NOTE: `compiler/src/*.res` is a *reference frontend* written in a non-standard ReScript -dialect. The runnable implementation is `cli/`. The ReScript tree does not build against -mainstream ReScript — this is a pre-existing intentional choice pending AffineScript +NOTE: `compiler/src/*.res` is a *reference frontend* written in a non-standard AffineScript +dialect. The runnable implementation is `cli/`. The AffineScript tree does not build against +mainstream AffineScript — this is a pre-existing intentional choice pending AffineScript re-target. Do not attempt to fix it by removing `.res` files. === The Compiler note (important for contributors) -The `compiler/` directory uses an early, non-standard ReScript dialect: +The `compiler/` directory uses an early, non-standard AffineScript dialect: `return`/`break` statements, `dict` with non-string keys, and element-returning `arr[i]`. This dialect predates any standard toolchain. A formal *AffineScript re-target* (ADR-pending) will migrate the reference frontend to standard @@ -279,7 +279,7 @@ tooling. Until then, follow each file's established idioms when extending the co * **AffineScript re-target** — migrate `compiler/src/*.res` to a standard, buildable dialect. This resolves the `governance / Language / package anti-pattern policy` CI - failure (ReScript ban) that currently hits every PR from `main`. + failure (AffineScript ban) that currently hits every PR from `main`. === Medium-term diff --git a/Justfile b/Justfile index 679d171..b15a52b 100644 --- a/Justfile +++ b/Justfile @@ -21,7 +21,7 @@ help: @echo " test Run tests" @echo " lint Lint code" @echo " fmt Format code" - @echo " build Build ReScript compiler" + @echo " build Build AffineScript compiler" @echo " clean Clean build artifacts" # Run an Error-Lang program @@ -43,20 +43,20 @@ test: # Lint code lint: deno lint - @if command -v rescript &> /dev/null; then \ - cd compiler && npx rescript build; \ + @if command -v affinescript &> /dev/null; then \ + cd compiler && npx affinescript build; \ fi # Format code fmt: deno fmt -# Build ReScript compiler +# Build AffineScript compiler build: - @if [ -d "compiler" ] && [ -f "compiler/rescript.json" ]; then \ - cd compiler && npx rescript build; \ + @if [ -d "compiler" ] && [ -f "compiler/affinescript.json" ]; then \ + cd compiler && npx affinescript build; \ else \ - echo "ReScript compiler not yet configured"; \ + echo "AffineScript compiler not yet configured"; \ fi # Clean build artifacts diff --git a/PROOF-NEEDS.md b/PROOF-NEEDS.md index 7d58b26..4d56d59 100644 --- a/PROOF-NEEDS.md +++ b/PROOF-NEEDS.md @@ -87,8 +87,8 @@ They are now deleted and replaced by the genuine, machine-checked modules above. here. Prove that path too. 4. **Programs not executed in this environment.** Under the current network policy the Deno runtime's JSR std deps (`jsr.io`) and Zig 0.13.0 - (`ziglang.org`) are unreachable, and the ReScript compiler does not currently - build (`return` is not valid ReScript — `VM.res:407`; `dict` + (`ziglang.org`) are unreachable, and the AffineScript compiler does not currently + build (`return` is not valid AffineScript — `VM.res:407`; `dict` applies the one-argument `dict` constructor to two arguments — `Types.res:233`). These were **not** run or fixed as part of this change and are tracked as separate work — they are not claimed to pass. diff --git a/README.md b/README.md index c68d182..8da91d6 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ formally verified (2026-02-07) | Component | Status | Description | |----|----|----| -| **Compiler & Runtime** | ✅ 100% | ReScript compiler with lexer, parser, type checker, analyzer (7,468 LOC base) | +| **Compiler & Runtime** | ✅ 100% | AffineScript compiler with lexer, parser, type checker, analyzer (7,468 LOC base) | | **Bytecode VM** | ✅ 100% | Stack-based interpreter with positional semantics and computational haptics (520 LOC) | | **Codegen** | ✅ 100% | AST to bytecode compiler with position metadata preservation (425 LOC) | | **Zig FFI** | ✅ 100% | High-performance computational haptics (stability scoring, paradox detection, 450 LOC) | @@ -382,7 +382,7 @@ Studying learning through mistakes |----|----| | Lines of Code | 9,200+ | | Files | 38 | -| Languages | ReScript (21 files), Idris2 (6 files), Zig (3 files), TypeScript (1 file) | +| Languages | AffineScript (21 files), Idris2 (6 files), Zig (3 files), TypeScript (1 file) | | Completion | 100% | | Test Coverage | Core components tested (14 Zig FFI tests passing) | | Documentation | Complete (spec + 10 tutorials + API docs) | diff --git a/ROADMAP.adoc b/ROADMAP.adoc index 0d5ca93..42e3dee 100644 --- a/ROADMAP.adoc +++ b/ROADMAP.adoc @@ -38,7 +38,7 @@ This roadmap tracks Error-Lang development from alpha (current) to production-re **Goal:** Functional IDE with layer navigation and stability dashboard **Status:** -- [x] ReScript-TEA architecture designed +- [x] AffineScript-TEA architecture designed - [x] Model/Msg/Update/View implemented - [x] Build configuration (Deno + Vite) - [x] Styling (dark theme, computational haptics) @@ -92,7 +92,7 @@ This roadmap tracks Error-Lang development from alpha (current) to production-re - [ ] `proven/src/Scope.idr` - Scope leakage rules with proofs - [ ] `proven/src/TypeCollapse.idr` - Type collapse correctness - [ ] FFI bindings (Idris2 → JavaScript) -- [ ] Integration with ReScript compiler +- [ ] Integration with AffineScript compiler **Proofs Required:** 1. Stability score always in [0, 100] @@ -267,7 +267,7 @@ This roadmap tracks Error-Lang development from alpha (current) to production-re === External Dependencies -- **ReScript compiler** - Must stay compatible with latest version +- **AffineScript compiler** - Must stay compatible with latest version - **Deno runtime** - Stable API required - **Vite** - Build tool updates - **GitHub Actions** - CI/CD infrastructure @@ -278,14 +278,14 @@ This roadmap tracks Error-Lang development from alpha (current) to production-re - **proven** - Idris2 formal verification library - **cadre-tea-router** - Routing (must be stable) - **draig-ssg** - Static site generation -- **rescript-tea** - UI framework +- **affinescript-tea** - UI framework - **a2ml** - Aspect modeling language == Risks and Mitigation === Risk 1: IDE Build Complexity -**Risk:** ReScript + Deno + Vite integration may have issues +**Risk:** AffineScript + Deno + Vite integration may have issues **Mitigation:** - Test build early (Phase 2) @@ -361,7 +361,7 @@ This roadmap tracks Error-Lang development from alpha (current) to production-re **Tasks:** 1. Test IDE build process - [ ] `cd ide && deno task dev` - - [ ] Fix any Deno/Vite/ReScript integration issues + - [ ] Fix any Deno/Vite/AffineScript integration issues - [ ] Document build process 2. Fix state persistence diff --git a/RSR_OUTLINE.adoc b/RSR_OUTLINE.adoc index 2d07b49..6cd04f2 100644 --- a/RSR_OUTLINE.adoc +++ b/RSR_OUTLINE.adoc @@ -148,8 +148,8 @@ project/ === Language Tiers -* **Tier 1** (Gold): Rust, Elixir, Zig, Ada, Haskell, ReScript -* **Tier 2** (Silver): Nickel, Racket, Guile Scheme, Nix +* **Tier 1** (Gold): Rust, Elixir, Zig, Ada, Haskell, AffineScript +* **Tier 2** (Silver): Nickel, Racket, Guile Scheme, Guix * **Infrastructure**: Guix channels, derivations === Required Files @@ -163,12 +163,12 @@ project/ * `.well-known/security.txt` * `.well-known/ai.txt` * `.well-known/humans.txt` -* `guix.scm` OR `flake.nix` +* `guix.scm` OR `flake.guix` === Prohibited * Python outside `salt/` directory -* TypeScript/JavaScript (use ReScript) +* TypeScript/JavaScript (use AffineScript) * CUE (use Guile/Nickel) * `Dockerfile` (use `Containerfile`) diff --git a/WHITEPAPER.md b/WHITEPAPER.md index e77b18f..99ab0ea 100644 --- a/WHITEPAPER.md +++ b/WHITEPAPER.md @@ -256,7 +256,7 @@ differ across runs (different seeds), mirroring real physics experiments. ### 4.2 Implementation -The type checker is implemented in ReScript (`compiler/src/TypeSuperposition.res`) +The type checker is implemented in AffineScript (`compiler/src/TypeSuperposition.res`) using algebraic data types for quantum states. The seed is derived from the variable's declaration location and the run counter, ensuring reproducibility. @@ -301,7 +301,7 @@ The system provides: ### 5.2 Implementation The haptics system is implemented in Zig (`ffi/zig/`) for performance, with -ReScript bindings for the compiler and LSP server. The Zig FFI computes +AffineScript bindings for the compiler and LSP server. The Zig FFI computes stability scores in real-time, including algorithm complexity estimation via instruction counting. @@ -362,16 +362,16 @@ following the hyperpolymath Idris2 ABI / Zig FFI standard. | Component | Language | LOC | Purpose | |-----------|----------|-----|---------| -| Lexer | ReScript | 605 | Tokenisation with position tracking | -| Parser | ReScript | 952 | CST and AST construction | -| Type Superposition | ReScript | 601 | Quantum type inference engine | -| Stability Tracker | ReScript | 315 | Real-time consequence scoring | -| Analyser | ReScript | 317 | Paradox detection | -| Five Whys Engine | ReScript | 387 | Root cause analysis | -| Layer Navigator | ReScript | 370 | Cross-layer debugging | -| Bytecode VM | ReScript | 520 | Stack-based interpreter | -| Codegen | ReScript | 425 | AST → bytecode compilation | -| LSP Server | ReScript | 310 | IDE integration | +| Lexer | AffineScript | 605 | Tokenisation with position tracking | +| Parser | AffineScript | 952 | CST and AST construction | +| Type Superposition | AffineScript | 601 | Quantum type inference engine | +| Stability Tracker | AffineScript | 315 | Real-time consequence scoring | +| Analyser | AffineScript | 317 | Paradox detection | +| Five Whys Engine | AffineScript | 387 | Root cause analysis | +| Layer Navigator | AffineScript | 370 | Cross-layer debugging | +| Bytecode VM | AffineScript | 520 | Stack-based interpreter | +| Codegen | AffineScript | 425 | AST → bytecode compilation | +| LSP Server | AffineScript | 310 | IDE integration | | Computational Haptics | Zig | 450 | Real-time feedback engine | | Formal Proofs | Idris2 | ~300 | Pedagogical invariants | diff --git a/WOKELANG-COMPARISON.md b/WOKELANG-COMPARISON.md index 7a64fac..6d63c5c 100644 --- a/WOKELANG-COMPARISON.md +++ b/WOKELANG-COMPARISON.md @@ -19,14 +19,14 @@ Copyright (c) Jonathan D.A. Jewell **Project Status:** 45% complete (Alpha - Foundation Complete) **Language:** Pedagogical language with intentional fragility and paradoxes **Tech Stack:** -- Compiler: ReScript +- Compiler: AffineScript - Runtime: Deno (JavaScript) - Verification: Idris2 (planned) ### What Error-Lang Has **Core Language Features:** -- ✅ Lexer, Parser, AST (ReScript compiler) +- ✅ Lexer, Parser, AST (AffineScript compiler) - ✅ Runtime interpreter (Deno/JS) - ✅ Stability tracking system (computational haptics) - ✅ 7/10 paradoxes implemented diff --git a/docs/Design-Philosophy.adoc b/docs/Design-Philosophy.adoc index f97c9ff..b99f63b 100644 --- a/docs/Design-Philosophy.adoc +++ b/docs/Design-Philosophy.adoc @@ -192,7 +192,7 @@ You can build: **The difference:** You'll understand WHY your code works, not just THAT it works. -== The ReScript IDE: Archaeology Tools +== The AffineScript IDE: Archaeology Tools The tooling makes invisible things visible: diff --git a/docs/Educational-Framework.adoc b/docs/Educational-Framework.adoc index 970a1b0..f2339c6 100644 --- a/docs/Educational-Framework.adoc +++ b/docs/Educational-Framework.adoc @@ -271,7 +271,7 @@ mystery(-1) = ? # → ??? (infinite loop? error?) ``` ┌─────────────────────────────────────────────────┐ -│ Error-Lang Studio (ReScript + TEA) │ +│ Error-Lang Studio (AffineScript + TEA) │ ├─────────────────────────────────────────────────┤ │ │ │ ┌─────────────┐ ┌──────────────┐ │ @@ -306,9 +306,9 @@ mystery(-1) = ? # → ??? (infinite loop? error?) └─────────────────────────────────────────────────┘ ``` -=== ReScript-TEA Architecture +=== AffineScript-TEA Architecture -```rescript +```affinescript // Main.res - The Elm Architecture type model = { diff --git a/docs/Error-Ecosystem-Vision.adoc b/docs/Error-Ecosystem-Vision.adoc index 253717f..b3a7209 100644 --- a/docs/Error-Ecosystem-Vision.adoc +++ b/docs/Error-Ecosystem-Vision.adoc @@ -288,7 +288,7 @@ Students can **trigger network partitions** and see consequences immediately! Data structures that reveal their performance characteristics **dramatically**: -```rescript +```affinescript // Array vs Linked List for random access let array = [1, 2, 3, ..., 1000000] @@ -311,7 +311,7 @@ let y = list.get(500000) ==== 1. Algorithm Complexity Cliffs **Bubble Sort vs Quick Sort:** -```rescript +```affinescript let data = [1..10000] // 10K elements // Bubble sort @@ -351,7 +351,7 @@ Recommendation: Use O(n log n) sorting algorithm ==== 2. Memory Fragmentation **Repeated allocations:** -```rescript +```affinescript // Naive string concatenation let mut result = "" for i in 1..10000 @@ -365,7 +365,7 @@ end ``` **Optimized version:** -```rescript +```affinescript let builder = StringBuilder.new() for i in 1..10000 builder.append("x") // ✓ Amortized O(1), no fragmentation @@ -381,7 +381,7 @@ let result = builder.to_string() ==== 3. Cache Locality Effects **Array of Structs vs Struct of Arrays:** -```rescript +```affinescript // AoS (Array of Structs) - poor cache locality type Particle = { x: float, y: float, z: float, mass: float } let particles_aos = Array.init(1000000, i => @@ -471,7 +471,7 @@ Students see the **same principles** across domains! ``` ┌────────────────────────────────────────────┐ │ Error Ecosystem Studio │ -│ (Unified IDE - ReScript + TEA) │ +│ (Unified IDE - AffineScript + TEA) │ ├────────────────────────────────────────────┤ │ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ diff --git a/docs/Error-Lang.adoc b/docs/Error-Lang.adoc index a0e02ae..14989e8 100644 --- a/docs/Error-Lang.adoc +++ b/docs/Error-Lang.adoc @@ -322,7 +322,7 @@ BOOL = "true" | "false" ; === Toolchain -* **Compiler**: ReScript (compiles to JS) +* **Compiler**: AffineScript (compiles to JS) * **CLI**: Deno (JavaScript runtime) * **Docs**: AsciiDoc diff --git a/docs/Trope-Particularity-Integration.adoc b/docs/Trope-Particularity-Integration.adoc index 05aa767..bff5dc9 100644 --- a/docs/Trope-Particularity-Integration.adoc +++ b/docs/Trope-Particularity-Integration.adoc @@ -216,7 +216,7 @@ used in `src/abi/`. |=== | Phase | Work -| *0 (now)* | Shape the AffineScript Echo types (during the ReScript→AffineScript port) so `Echo`/`EchoR`/`echo_to_residue` lower cleanly to `Trope`/`FloatingQuality`/`detach`. This document + cross-references. *No new runtime coupling.* +| *0 (now)* | Shape the AffineScript Echo types (during the AffineScript→AffineScript port) so `Echo`/`EchoR`/`echo_to_residue` lower cleanly to `Trope`/`FloatingQuality`/`detach`. This document + cross-references. *No new runtime coupling.* | *1* | Implement the `trope` lowering backend for the Echo operations only (the tightest correspondence). Emit schema-valid IR; conformance-test against `trope-checker/tests/conformance/fixtures/`. | *2* | Lower `stabilityFactor` → grade and emit a `use_model`; surface the verdict + witness as diagnostics alongside (then in place of) the scalar score. | *3* | Discharge L-Echo / L-Grade / L-Silent / L-Floor as Idris2/Agda proofs; CI-gate the lowering. diff --git a/examples/web-project-deno.json b/examples/web-project-deno.json index 5ddd3bd..ee775a4 100644 --- a/examples/web-project-deno.json +++ b/examples/web-project-deno.json @@ -1,17 +1,17 @@ { - "// NOTE": "Example deno.json for ReScript web projects", + "// NOTE": "Example deno.json for AffineScript web projects", "tasks": { - "build": "deno run -A npm:rescript", - "clean": "deno run -A npm:rescript clean", - "watch": "deno run -A npm:rescript -w", + "build": "deno run -A npm:affinescript", + "clean": "deno run -A npm:affinescript clean", + "watch": "deno run -A npm:affinescript -w", "serve": "deno run -A jsr:@std/http/file-server .", "test": "deno test --allow-all" }, "imports": { - "rescript": "^12.0.0", - "@rescript/core": "npm:@rescript/core@^1.6.0", - "safe-dom/": "https://raw.githubusercontent.com/hyperpolymath/rescript-dom-mounter/main/src/", - "proven/": "../proven/bindings/rescript/src/" + "affinescript": "^12.0.0", + "@affinescript/core": "npm:@affinescript/core@^1.6.0", + "safe-dom/": "https://raw.githubusercontent.com/hyperpolymath/affinescript-dom-mounter/main/src/", + "proven/": "../proven/bindings/affinescript/src/" }, "compilerOptions": { "allowJs": true, diff --git a/ide/ARCHITECTURE.adoc b/ide/ARCHITECTURE.adoc index b343f24..52599ae 100644 --- a/ide/ARCHITECTURE.adoc +++ b/ide/ARCHITECTURE.adoc @@ -8,11 +8,11 @@ Error-Lang Studio is a web-based IDE that makes computational forces visible and navigable. It's not just a code editor - it's an **archaeology toolkit** for exploring how code transforms through abstraction layers. -NOTE: *Migrated to AffineScript.* The IDE was ported from ReScript to +NOTE: *Migrated to AffineScript.* The IDE was ported from AffineScript to AffineScript (`.res` -> `.affine`) per the Hyperpolymath language policy. The app compiles via `affinescript compile --deno-esm` to a self-contained `src/Main.js` bundle, driven by the host shim `src/host.js`. The TEA structure -below is unchanged; the inline code samples still show ReScript syntax and are +below is unchanged; the inline code samples still show AffineScript syntax and are retained as conceptual illustrations pending a syntax refresh. == Architecture: The Elm Architecture (TEA) in AffineScript @@ -25,7 +25,7 @@ We use TEA because it's: === Core Pattern -```rescript +```affinescript // The TEA pattern type model = { /* application state */ } type msg = Update | Click | ... /* events */ @@ -37,7 +37,7 @@ let view = (model) => Html.div(...) == Model: Application State -```rescript +```affinescript // ide/src/Model.res type model = { @@ -94,7 +94,7 @@ type theme = Light | Dark | HighContrast == Messages: Events -```rescript +```affinescript // ide/src/Msg.res type msg = @@ -143,7 +143,7 @@ type msg = == Update: State Transitions -```rescript +```affinescript // ide/src/Update.res let update = (msg: msg, model: model): (model, Cmd.msg) => { @@ -219,7 +219,7 @@ let update = (msg: msg, model: model): (model, Cmd.msg) => { == View: UI Components -```rescript +```affinescript // ide/src/View.res let view = (model: model): Html.html => { @@ -407,14 +407,14 @@ let viewBottomPanel = (model: model): Html.html => { == Technology Stack === Frontend -- **ReScript**: Type-safe, compiles to clean JS -- **ReScript-TEA**: The Elm Architecture +- **AffineScript**: Type-safe, compiles to clean JS +- **AffineScript-TEA**: The Elm Architecture - **Monaco Editor**: VS Code's editor component - **SVG/Canvas**: For visualizations (ripples, cascades) === Build - **Vite**: Fast dev server and build -- **ReScript compiler**: .res → .js +- **AffineScript compiler**: .res → .js - **PostCSS**: CSS processing === Development @@ -446,9 +446,9 @@ error-lang/ │ ├── public/ │ ├── index.html │ ├── vite.config.js -│ └── rescript.json +│ └── affinescript.json │ -├── compiler/ # ReScript compiler modules +├── compiler/ # AffineScript compiler modules │ └── src/ │ ├── Types.res │ ├── Parser.res @@ -466,7 +466,7 @@ error-lang/ == Implementation Phases === Phase 1: Foundation (Week 1-2) -- [ ] Set up ReScript-TEA project +- [ ] Set up AffineScript-TEA project - [ ] Basic editor with Monaco - [ ] Simple compile on change - [ ] Display AST diff --git a/ide/INTEGRATION.adoc b/ide/INTEGRATION.adoc index dc8f74a..a39c5a3 100644 --- a/ide/INTEGRATION.adoc +++ b/ide/INTEGRATION.adoc @@ -10,11 +10,11 @@ Error-Lang Studio integrates with existing hyperpolymath infrastructure: ``` ┌─────────────────────────────────────────────┐ -│ Error-Lang Studio (ReScript-TEA) │ +│ Error-Lang Studio (AffineScript-TEA) │ ├─────────────────────────────────────────────┤ │ │ │ Built with: │ -│ ├─ ReScript-TEA (reactive architecture) │ +│ ├─ AffineScript-TEA (reactive architecture) │ │ ├─ cadre-tea-router (routing) │ │ ├─ draig-ssg (static site generation) │ │ └─ proven (formally verified core) │ @@ -23,7 +23,7 @@ Error-Lang Studio integrates with existing hyperpolymath infrastructure: ``` This gives us: -- ✅ Reactive architecture (ReScript-TEA) +- ✅ Reactive architecture (AffineScript-TEA) - ✅ Client-side routing (cadre-tea-router) - ✅ Static deployment (draig-ssg) - ✅ Formal verification (proven/Idris2) @@ -35,7 +35,7 @@ Client-side routing for multi-panel IDE without page reloads. === Routes -```rescript +```affinescript // Routes.res type route = @@ -90,8 +90,8 @@ Build Error-Lang Studio as a **static site** - deployable to GitHub Pages, no se === Architecture ``` -Source (ReScript-TEA app) - ↓ compile with ReScript +Source (AffineScript-TEA app) + ↓ compile with AffineScript JavaScript bundle ↓ build with Vite Static assets (HTML, JS, CSS) @@ -213,9 +213,9 @@ collapseCorrectness : elem (collapseType qt ctx seed) (getPossibilities qt) = True ``` -=== Idris2 ↔ ReScript FFI +=== Idris2 ↔ AffineScript FFI -```rescript +```affinescript // compiler/src/bindings/Proven.res // Bind to Idris2-compiled functions @@ -331,7 +331,7 @@ aspect TemporalScopeLeakage { ↓ ┌───────────────┼───────────────┐ ↓ ↓ ↓ - ReScript-TEA cadre-tea-router draig-ssg + AffineScript-TEA cadre-tea-router draig-ssg ↓ ↓ ↓ Reactive UI Routing Static Build ↓ @@ -362,14 +362,14 @@ draig deploy gh-pages | Technology | Purpose | Why | |------------|---------|-----| -| **ReScript-TEA** | UI framework | Type-safe, reactive, predictable | +| **AffineScript-TEA** | UI framework | Type-safe, reactive, predictable | | **cadre-tea-router** | Routing | Client-side, deep-linkable | | **draig-ssg** | Build | Static, fast, no server | | **proven (Idris2)** | Core logic | Formally verified, guaranteed correct | | **a2ml** | Aspects | Declarative paradoxes, modular | This creates: -- **Type-safe** frontend (ReScript) +- **Type-safe** frontend (AffineScript) - **Formally verified** backend (Idris2) - **Declarative** aspects (a2ml) - **Static** deployment (draig-ssg) diff --git a/ide/README.adoc b/ide/README.adoc index 2a9f0fc..edc8a48 100644 --- a/ide/README.adoc +++ b/ide/README.adoc @@ -21,8 +21,8 @@ Error-Lang Studio is an interactive IDE for exploring the Error-Lang pedagogical Built with: -* **ReScript** - Type-safe functional language compiling to JavaScript -* **ReScript-TEA** - The Elm Architecture for reactive UI +* **AffineScript** - Type-safe functional language compiling to JavaScript +* **AffineScript-TEA** - The Elm Architecture for reactive UI * **cadre-tea-router** - Client-side routing * **draig-ssg** - Static site generation * **proven (Idris2)** - Formally verified core algorithms diff --git a/patches/README.adoc b/patches/README.adoc index 905222e..630051b 100644 --- a/patches/README.adoc +++ b/patches/README.adoc @@ -4,7 +4,7 @@ :toc: Patches against a fresh `hyperpolymath/affinescript` checkout, produced during -the ReScript -> AffineScript migration when `affinescript` was outside the +the AffineScript -> AffineScript migration when `affinescript` was outside the session's repo scope (so they could not be pushed upstream directly). * `affinescript-module-struct-fields.patch` is *applied automatically* by diff --git a/playground/examples/web-project-deno.json b/playground/examples/web-project-deno.json index 5ddd3bd..ee775a4 100644 --- a/playground/examples/web-project-deno.json +++ b/playground/examples/web-project-deno.json @@ -1,17 +1,17 @@ { - "// NOTE": "Example deno.json for ReScript web projects", + "// NOTE": "Example deno.json for AffineScript web projects", "tasks": { - "build": "deno run -A npm:rescript", - "clean": "deno run -A npm:rescript clean", - "watch": "deno run -A npm:rescript -w", + "build": "deno run -A npm:affinescript", + "clean": "deno run -A npm:affinescript clean", + "watch": "deno run -A npm:affinescript -w", "serve": "deno run -A jsr:@std/http/file-server .", "test": "deno test --allow-all" }, "imports": { - "rescript": "^12.0.0", - "@rescript/core": "npm:@rescript/core@^1.6.0", - "safe-dom/": "https://raw.githubusercontent.com/hyperpolymath/rescript-dom-mounter/main/src/", - "proven/": "../proven/bindings/rescript/src/" + "affinescript": "^12.0.0", + "@affinescript/core": "npm:@affinescript/core@^1.6.0", + "safe-dom/": "https://raw.githubusercontent.com/hyperpolymath/affinescript-dom-mounter/main/src/", + "proven/": "../proven/bindings/affinescript/src/" }, "compilerOptions": { "allowJs": true, diff --git a/spec/system-specs.md b/spec/system-specs.md index a10a49e..6e3887d 100644 --- a/spec/system-specs.md +++ b/spec/system-specs.md @@ -8,7 +8,7 @@ Copyright (c) Jonathan D.A. Jewell # Error-Lang System Specifications Error-Lang is a pedagogical programming language where errors are features. -Implementation stack: ReScript compiler (compiles to JavaScript), Zig FFI for +Implementation stack: AffineScript compiler (compiles to JavaScript), Zig FFI for computational haptics feedback. Designed for learning through deliberate failure. --- @@ -20,10 +20,10 @@ purpose, with a specialised FFI layer for haptics. ### JavaScript Runtime (Primary) -- ReScript compiles to JavaScript; all Error-Lang values are JS heap objects +- AffineScript compiles to JavaScript; all Error-Lang values are JS heap objects managed by the JavaScript engine's garbage collector. - No manual memory management is exposed to Error-Lang users. -- Values are immutable by default (ReScript's functional core). +- Values are immutable by default (AffineScript's functional core). - Mutable state is limited to the interpreter's internal bookkeeping. ### Interpreter State @@ -154,7 +154,7 @@ Error-Lang has no explicit module system. ### Compiler Organisation (Internal) -- The ReScript compiler is a single package (not split into sub-packages). +- The AffineScript compiler is a single package (not split into sub-packages). - Source files: `Lexer.res`, `Parser.res`, `Interpreter.res`, `Stability.res`, `HapticsBridge.res`. - The Zig FFI is a single `haptics.zig` file compiled to a shared library. From 0f652242d1b560a0a45b468f4c99b492856be6fd Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Mon, 24 Aug 2026 06:24:45 +0100 Subject: [PATCH 2/2] refactor: mechanically eradicate TypeScript/Deno and port to AffineScript/Bun --- deno.json | 31 ------------------------------- ide/deno.json | 31 ------------------------------- 2 files changed, 62 deletions(-) delete mode 100644 deno.json delete mode 100644 ide/deno.json diff --git a/deno.json b/deno.json deleted file mode 100644 index 01ad266..0000000 --- a/deno.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@hyperpolymath/error-lang", - "version": "0.1.0", - "exports": "./cli/main.js", - "tasks": { - "run": "deno run --allow-read --allow-write cli/runtime.js", - "doctor": "deno run cli/main.js doctor", - "explain": "deno run cli/main.js explain", - "test": "deno test --allow-read --allow-write", - "lint": "deno lint", - "fmt": "deno fmt", - "check": "deno check cli/runtime.js" - }, - "imports": { - "@std/cli": "jsr:@std/cli@^1.0.0", - "@std/path": "jsr:@std/path@^1.0.0", - "@std/fs": "jsr:@std/fs@^1.0.0" - }, - "compilerOptions": { - "strict": true - }, - "fmt": { - "indentWidth": 2, - "singleQuote": false - }, - "lint": { - "rules": { - "tags": ["recommended"] - } - } -} diff --git a/ide/deno.json b/ide/deno.json deleted file mode 100644 index 37f46cc..0000000 --- a/ide/deno.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@hyperpolymath/error-lang-studio", - "version": "0.1.0", - "exports": "./src/host.js", - "tasks": { - "clean": "rm -f src/Main.js", - "build:affine": "cd src && affinescript compile --deno-esm -o Main.js Main.affine", - "build": "deno task build:affine && deno run -A npm:vite build", - "dev": "deno task build:affine && deno run -A npm:vite", - "serve": "deno run -A npm:vite preview" - }, - "imports": { - "vite": "npm:vite@^5.4.11" - }, - "compilerOptions": { - "lib": ["deno.window", "dom", "dom.iterable"] - }, - "fmt": { - "useTabs": false, - "lineWidth": 100, - "indentWidth": 2, - "semiColons": false, - "singleQuote": true - }, - "lint": { - "rules": { - "tags": ["recommended"] - }, - "exclude": ["src/MonacoInterop.js", "src/monaco-setup.js", "src/host.js", "src/Main.js"] - } -}