|
1 | 1 | // SPDX-License-Identifier: MPL-2.0 |
2 | | -// SPDX-FileCopyrightText: 2024-2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> |
| 2 | +// Copyright (c) 2026 Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> |
3 | 3 |
|
4 | | -= My: Progressive AI-Native Language |
| 4 | += my-lang |
| 5 | +:author: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> |
| 6 | +:revdate: 2026-05-26 |
5 | 7 |
|
6 | | -image:https://img.shields.io/badge/OpenSSF-Best_Practices-green?logo=opensourcesecurity[OpenSSF Best Practices,link="https://www.bestpractices.dev/en/projects/new?repo_url=https://github.com/hyperpolymath/my-lang"] |
7 | | -image:https://img.shields.io/badge/License-PMPL--1.0-indigo.svg[License: PMPL-1.0,link="https://github.com/hyperpolymath/palimpsest-license"] |
8 | | -image:https://api.thegreenwebfoundation.org/greencheckimage/github.com[Green Web,link="https://www.thegreenwebfoundation.org/green-web-check/?url=github.com"] |
| 8 | +> This README replaces an earlier stub that incorrectly stated the |
| 9 | +> repository had been moved. *This is the canonical |
| 10 | +> `hyperpolymath/my-lang`.* |
9 | 11 |
|
| 12 | +`my-lang` is the *next-generation language* working project — a |
| 13 | +multi-dialect surface for the hyperpolymath language stack. It is one |
| 14 | +of two flagship language experiments in the estate (the other being |
| 15 | +link:https://github.com/hyperpolymath/affinescript[`affinescript`]). |
10 | 16 |
|
11 | | -:toc: macro |
12 | | -:toclevels: 2 |
13 | | -:icons: font |
14 | | -:source-highlighter: rouge |
| 17 | +== What's in here |
15 | 18 |
|
16 | | -[.lead] |
17 | | -*Let learning unfold. Let types guard. Let agents compose.* |
| 19 | +`crates/`:: |
| 20 | +Rust crates implementing the compiler / interpreter layers. |
18 | 21 |
|
19 | | -Progressive-disclosure programming language with first-class AI integration—four dialects scaling from visual blocks to agentic orchestration. |
| 22 | +`dialects/`:: |
| 23 | +Per-dialect surface-syntax definitions. The `my-lang` umbrella admits |
| 24 | +multiple surface dialects sharing a common semantic core. |
20 | 25 |
|
21 | | -''' |
| 26 | +`conformance/`:: |
| 27 | +Conformance tests — programs that any compliant `my-lang` implementation |
| 28 | +must accept (or reject) identically. |
22 | 29 |
|
23 | | -toc::[] |
| 30 | +`examples/`:: |
| 31 | +Worked examples covering each dialect, suitable as a learning |
| 32 | +reference and CI smoke-test. |
24 | 33 |
|
25 | | -== Who This Is For |
| 34 | +`docs/`:: |
| 35 | +Design notes, language-reference drafts, and ADRs (Architecture Decision |
| 36 | +Records). |
26 | 37 |
|
27 | | -[cols="1,3"] |
28 | | -|=== |
29 | | -|*Me-curious* |Educators seeking visual programming that secretly teaches affine types and reversible computation |
30 | | -|*Solo practitioners* |Developers wanting Rust-level safety with Python-level approachability—human-first, AI-assisted |
31 | | -|*Duet partners* |Teams exploring balanced human-AI pair programming with explicit collaboration protocols |
32 | | -|*Ensemble conductors* |Architects orchestrating multi-agent systems with neurosymbolic grammar extensions |
33 | | -|=== |
| 38 | +`frontier-practices/`:: |
| 39 | +Forward-looking experiments — things that may become part of the |
| 40 | +language but are not yet stable. |
34 | 41 |
|
35 | | -== The Four Dialects |
36 | | - |
37 | | -My is not four languages—it is one language with *progressive reveal*. Concepts introduced as playful metaphors in Me unmask their CS foundations as learners advance. |
38 | | - |
39 | | -[cols="1,1,2,2"] |
40 | | -|=== |
41 | | -|Dialect |Stage |Mode |Core Insight |
42 | | - |
43 | | -|*Me* |
44 | | -|Visual (ages 8-12) |
45 | | -|Blockly-like drag-and-drop |
46 | | -|Resources as colored tokens; affine types as "use once" rules |
47 | | - |
48 | | -|*Solo* |
49 | | -|Text (ages 13+) |
50 | | -|Human-first, AI-assists |
51 | | -|Explicit affine/linear types, checkpoint/rollback, cut operators |
52 | | - |
53 | | -|*Duet* |
54 | | -|Collaborative |
55 | | -|Balanced co-creation |
56 | | -|Two-party protocols, neurosymbolic extensions |
57 | | - |
58 | | -|*Ensemble* |
59 | | -|Orchestration |
60 | | -|AI-leads, human-refines |
61 | | -|Full agentic composition, Newtonian spectrum agents |
62 | | -|=== |
63 | | - |
64 | | -== Why My? |
65 | | - |
66 | | -[source,my] |
67 | | ----- |
68 | | -// Type-safe AI with effect tracking |
69 | | -fn summarize(text: String) -> AI<String> { |
70 | | - ai query { |
71 | | - prompt: "Summarize concisely" |
72 | | - context: text |
73 | | - model: claude |
74 | | - } |
75 | | -} |
76 | | -
|
77 | | -// Affine types prevent resource bugs |
78 | | -fn transfer(affine token: Token) -> Result { |
79 | | - checkpoint save_state { |
80 | | - let result = process(move token); // must move, can't copy |
81 | | - if !result.is_ok() { |
82 | | - rollback save_state; |
83 | | - } |
84 | | - return result; |
85 | | - } |
86 | | -} |
87 | | -
|
88 | | -// Cut operator for parser commitment |
89 | | -fn parse(input: String) -> Expr { |
90 | | - match input { |
91 | | - "(" => { let e = parse_nested(); !; expect(")"); e }, |
92 | | - _ => parse_simple() |
93 | | - } |
94 | | -} |
95 | | ----- |
96 | | - |
97 | | -=== Technical Differentiators |
98 | | - |
99 | | -[cols="2,3"] |
100 | | -|=== |
101 | | -|*AI as First-Class Citizen* |Native `ai!` expressions, typed `AI<T>` return values, prompt templates with effect tracking |
102 | | -|*Progressive Safety* |Optional affine/linear types—start simple, add safety constraints as complexity grows |
103 | | -|*Reversible Computation* |Checkpoint/rollback at language level, not library level |
104 | | -|*Prolog-Heritage Parsing* |Cut operator (`!`) for committed choice in recursive descent |
105 | | -|*Neurosymbolic Bridge* |Duet dialect enables explicit symbolic-neural protocol boundaries |
106 | | -|=== |
107 | | - |
108 | | -== Quick Start |
| 42 | +== Quickstart |
109 | 43 |
|
110 | 44 | [source,bash] |
111 | 45 | ---- |
112 | | -# Clone and build |
113 | | -git clone https://github.com/hyperpolymath/my-lang |
| 46 | +git clone git@github.com:hyperpolymath/my-lang.git |
114 | 47 | cd my-lang |
115 | | -cargo build --release |
116 | | -
|
117 | | -# Run the REPL |
118 | | -cargo run -- repl |
119 | | -
|
120 | | -# Run a program |
121 | | -cargo run -- run examples/hello.my |
122 | | -
|
123 | | -# Build a static site with My SSG |
124 | | -cd my-ssg && cargo run -- new my-blog |
125 | | ----- |
126 | | - |
127 | | -== Architecture |
128 | 48 |
|
| 49 | +just build # builds the workspace (Rust) |
| 50 | +just test # runs unit + conformance tests |
129 | 51 | ---- |
130 | | -my-lang/ |
131 | | -├── src/ # Core language (Rust) |
132 | | -│ ├── lexer.rs |
133 | | -│ ├── parser.rs |
134 | | -│ ├── checker.rs # Type checker with AI<T> support |
135 | | -│ └── interpreter.rs |
136 | | -├── my-ssg/ # Static site generator |
137 | | -├── docs/wiki/ # Full documentation |
138 | | -├── solo-dialect/ # OCaml reference (Solo mode) |
139 | | -└── grammar.ebnf # Formal specification |
140 | | ----- |
141 | | - |
142 | | -== Ecosystem Integration |
143 | | - |
144 | | -My participates in the *poly-mcp* constellation: |
145 | 52 |
|
146 | | -[cols="1,2"] |
147 | | -|=== |
148 | | -|https://github.com/hyperpolymath/poly-ssg-mcp[poly-ssg-mcp] |MCP hub for static site generators—My SSG exposes `my_init`, `my_build`, `my_serve` |
149 | | -|https://github.com/hyperpolymath/poly-container-mcp[poly-container-mcp] |Multi-runtime container management |
150 | | -|https://github.com/hyperpolymath/poly-iac-mcp[poly-iac-mcp] |Infrastructure-as-code MCP servers |
151 | | -|=== |
| 53 | +== Architectural authority |
152 | 54 |
|
153 | | -My SSG is one satellite in the broader poly-ssg ecosystem alongside Eclipse (Pony), Tyrano (TypeScript→ReScript migration), and others. |
| 55 | +* link:ANCHOR.scope-arrest.2026-01-01.Jewell.scm[`ANCHOR.scope-arrest.*`] |
| 56 | + — the scope-arrest anchor file enumerating what `my-lang` will and |
| 57 | + will not be. |
| 58 | +* link:AUTHORITY_STACK.mustfile-nickel.scm[`AUTHORITY_STACK.mustfile-nickel.scm`] |
| 59 | + — the cross-cutting authority stack for the design. |
154 | 60 |
|
155 | | -== Newtonian Spectrum |
156 | | - |
157 | | -In Ensemble mode, seven specialized agents—colored by Newton's spectrum—orchestrate compilation and execution: |
158 | | - |
159 | | -[cols="1,2,2"] |
160 | | -|=== |
161 | | -|Color |Role |Solo Foundation |
162 | | - |
163 | | -|Red |Performance (hot paths) |Optimized parser |
164 | | -|Orange |Concurrency (async) |Async/await runtime |
165 | | -|Yellow |Contracts (safety) |Affine type tracking |
166 | | -|Green |Config (schema) |Structured AST |
167 | | -|Blue |Audit (trace) |Checkpoint system |
168 | | -|Indigo |Comptime (meta) |Compile-time evaluation |
169 | | -|Violet |Governance (policy) |Mode declarations |
170 | | -|=== |
| 61 | +These two files are the source-of-truth for "is `X` in scope for |
| 62 | +`my-lang`?" — consult them before opening a feature request. |
171 | 63 |
|
172 | 64 | == Status |
173 | 65 |
|
174 | | -[cols="3,2"] |
175 | | -|=== |
176 | | -|Component |Status |
177 | | - |
178 | | -|Solo dialect — *language machinery* (lexer, parser, type checker, interpreter, REPL) |Complete |
179 | | -|Solo dialect — *runtime standard library* |In Progress (Phase 2) |
180 | | -|AI Runtime (mock) |Complete |
181 | | -|My SSG |Complete |
182 | | -|Duet dialect |In Development |
183 | | -|Ensemble dialect |Planned |
184 | | -|Native compiler |Planned |
185 | | -|=== |
186 | | - |
187 | | -[NOTE] |
188 | | -==== |
189 | | -"Complete" for the Solo dialect means the *language machinery* — lexer, parser, |
190 | | -type checker, tree-walking interpreter, and REPL — is feature-complete and can |
191 | | -run arbitrary Solo programs. |
192 | | -
|
193 | | -It does *not* mean the *runtime standard library* is finished. The stdlib is |
194 | | -delivered as native builtins and is being filled in under Phase 2 (file I/O, |
195 | | -`env_args`, `format`, and string-keyed maps have landed; JSON and date |
196 | | -primitives are next). Live status is tracked in the GitHub issues, not in this |
197 | | -table — see the Phase-2 stdlib tracker (`#45`) and its sub-issues. |
198 | | -==== |
| 66 | +* **Licence**: MPL-2.0. (Migrated from PMPL-1.0-or-later 2026-05-26 per |
| 67 | + the estate licence-debt audit, hyperpolymath/standards#196.) |
| 68 | +* **Maturity**: design-iteration. Working compiler exists; surface and |
| 69 | + semantics still settling. Per the maintainer's memory entry |
| 70 | + `my-lang-37-shipped-rest-parked`, item #37 has shipped and several |
| 71 | + follow-ups (`#38-#41`) are artefact-blocked. |
| 72 | +* **Audit findings**: see `docs/tech-debt-2026-05-26.md` if present |
| 73 | + (added by the 2026-05-26 estate tech-debt scan). |
199 | 74 |
|
200 | | -== License |
| 75 | +== Contributing |
201 | 76 |
|
202 | | -MPL-2.0 (Palimpsest License)—see link:LICENSE[LICENSE]. |
| 77 | +See link:CONTRIBUTING.adoc[CONTRIBUTING.adoc] (or |
| 78 | +link:CONTRIBUTING.md[CONTRIBUTING.md]). GPG-signed commits required. |
203 | 79 |
|
204 | | -''' |
| 80 | +== Companion repositories |
205 | 81 |
|
206 | | -[quote] |
207 | | -A language that grows with you—from visual tokens to agentic ensembles. |
| 82 | +* link:https://github.com/hyperpolymath/standards[`hyperpolymath/standards`] — canonical estate-wide standards. |
| 83 | +* link:https://github.com/hyperpolymath/affinescript[`hyperpolymath/affinescript`] — sibling language project; differing design intent. |
| 84 | +* link:https://github.com/hyperpolymath/typed-wasm[`hyperpolymath/typed-wasm`] — the typed-wasm backend `my-lang` shares with `affinescript`. |
0 commit comments