Skip to content

Commit 6390b81

Browse files
hyperpolymathclaude
andcommitted
docs(faces): add CoffeeScript and ActionScript faces to roadmap
Captures the strategic rationale and rough surface mapping for two displaced-community faces. Architecture is in place; implementation is blocked on design decisions (inheritance, splats, event models, etc.) not code effort. Listed as roadmap items, not planned sprints. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 41480f0 commit 6390b81

1 file changed

Lines changed: 80 additions & 0 deletions

File tree

docs/specs/faces.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,86 @@ The compiler is face-agnostic throughout. The two face-aware layers are:
5858

5959
---
6060

61+
## Roadmap Faces
62+
63+
These faces are on the roadmap but have not been designed in detail. The
64+
face architecture makes implementation cheap once the surface mapping is
65+
settled; the bottleneck is design, not code.
66+
67+
### CoffeeScript-face (strategic priority)
68+
69+
**Rationale:** CoffeeScript has a loyal displaced community that never loved
70+
JavaScript and were forced away when the ecosystem moved on. Their syntax
71+
preferences (significant whitespace, `->` / `=>`, `is`/`isnt`/`unless`,
72+
`@` for self, `do`, list comprehensions) are coherent and well-documented.
73+
A CoffeeScript face would offer that community a new home: their familiar
74+
syntax, but with a sound type system, affine resource semantics, and typed
75+
WASM output.
76+
77+
**Rough surface mapping (to be designed):**
78+
79+
| CoffeeScript surface | Canonical AffineScript |
80+
|----------------------|------------------------|
81+
| `x = expr` | `let x = expr` |
82+
| `f = (x, y) -> expr` | `fn f(x, y) { expr }` |
83+
| `f = (x, y) => expr` | `fn f(x, y) { expr }` (bound form) |
84+
| `unless cond` | `if !cond` |
85+
| `is` / `isnt` | `==` / `!=` |
86+
| `and` / `or` / `not` | `&&` / `\|\|` / `!` |
87+
| `@field` | `self.field` |
88+
| `class Name` | `type Name` |
89+
| `null` / `undefined` | `()` |
90+
| `yes` / `no` | `true` / `false` |
91+
| Significant whitespace | blocks (like Python-face) |
92+
| `#` comment | `//` comment |
93+
94+
**Design questions before implementing:**
95+
- How do CoffeeScript string interpolation (`"#{x}"`) map to AffineScript?
96+
- List comprehensions — do we support them or emit a hint?
97+
- Splats (`args...`) — map to variadic or array?
98+
- Prototype chain (`::`) — not applicable; needs a hint pointing to traits.
99+
100+
**File:** `lib/coffee_face.ml`, `--face coffee` / `--face coffeescript`
101+
102+
---
103+
104+
### ActionScript-face (strategic priority)
105+
106+
**Rationale:** ActionScript 3 was a capable, statically-typed OO language
107+
with a loyal community (Flash game developers, Flex/AIR developers). It was
108+
killed by platform death (Flash end-of-life), not by language quality.
109+
AS3 developers are comfortable with explicit types, classes, and access
110+
modifiers — all of which map naturally to AffineScript concepts.
111+
112+
**Rough surface mapping (to be designed):**
113+
114+
| ActionScript surface | Canonical AffineScript |
115+
|----------------------|------------------------|
116+
| `var x: Type = expr` | `let x: Type = expr` |
117+
| `function f(x: T): R { }` | `fn f(x: T) -> R { }` |
118+
| `public/private/protected` | (access control — AffineScript is module-scoped; emit hint) |
119+
| `class Name extends Base` | `type Name` (traits for inheritance) |
120+
| `new Name(args)` | `Name { fields }` or constructor fn |
121+
| `null` | `()` |
122+
| `Boolean` / `int` / `Number` | `Bool` / `Int` / `Float` |
123+
| `String` | `String` (direct) |
124+
| `Array.<T>` | `Array[T]` |
125+
| `trace(expr)` | `IO.println(expr)` |
126+
| `import pkg.Class` | `use pkg::Class` |
127+
| `package { ... }` | module-level (stripped) |
128+
| `//` / `/* */` comments | (already valid) |
129+
130+
**Design questions before implementing:**
131+
- AS3 inheritance (`extends`) — map to trait bounds or emit a migration hint?
132+
- Interfaces (`implements`) — map to traits?
133+
- `override` / `super` — no direct equivalent; design needed.
134+
- Event model (`addEventListener`) — emit a hint pointing to effects.
135+
- `Vector.<T>` vs `Array.<T>` — both map to `Array[T]`?
136+
137+
**File:** `lib/action_face.ml`, `--face action` / `--face actionscript`
138+
139+
---
140+
61141
## Python Face Details
62142

63143
### Source Transform (`lib/python_face.ml`)

0 commit comments

Comments
 (0)