Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/affinescript-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
#
# 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
Expand Down
8 changes: 4 additions & 4 deletions .machine_readable/6a2/STATE.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -58,15 +58,15 @@ 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.
"""

[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]
Expand All @@ -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."
14 changes: 7 additions & 7 deletions .machine_readable/contractiles/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions 0-AI-MANIFEST.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions ABI-FFI-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. │
└─────────────────────────────────────────────┘
```

Expand Down Expand Up @@ -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/
```

Expand Down
34 changes: 17 additions & 17 deletions CONTINUATION-GUIDE.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:**
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand All @@ -260,15 +260,15 @@ 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
6. **Computational haptics** - Visual feedback is core to learning

=== 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
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -396,8 +396,8 @@ cat CONTINUATION-GUIDE.adoc
# Run Error-Lang programs
deno run -A cli/runtime.js <file.err>

# Build ReScript compiler
cd compiler && rescript build
# Build AffineScript compiler
cd compiler && affinescript build

# Build IDE (development)
cd ide && deno task dev
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
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
Expand Down Expand Up @@ -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)
```

Expand Down
2 changes: 1 addition & 1 deletion ERROR-LANG-COMPLETION-2026-02-07.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions EXPLAINME.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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<K,V>` 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
Expand Down Expand Up @@ -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

Expand Down
14 changes: 7 additions & 7 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions PROOF-NEEDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, int>`
(`ziglang.org`) are unreachable, and the AffineScript compiler does not currently
build (`return` is not valid AffineScript — `VM.res:407`; `dict<string, int>`
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.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down Expand Up @@ -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) |
Expand Down
Loading
Loading