Skip to content

Commit b5a67ac

Browse files
committed
feat: migrate file extension from .as to .affine for GitHub Linguist recognition
The .as extension conflicts with ActionScript in GitHub Linguist, causing all AffineScript source files to be misclassified as ActionScript/JavaScript. This migration to .affine resolves the conflict and enables proper language detection. Changes: - Rename all 153 .as source files to .affine across conformance/, examples/, stdlib/, test/, and tests/ directories - Add linguist-language=AffineScript directive to .gitattributes for .affine - Update tree-sitter grammar file-types from "as" to "affine" - Update VSCode extension to register .affine instead of .as - Update all documentation references (28+ files) to use .affine - Update test fixture references in test_e2e.ml https://claude.ai/code/session_015S2ndRbwuJPpjkv54BpVDw
1 parent bd3a977 commit b5a67ac

245 files changed

Lines changed: 390 additions & 387 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
* text=auto eol=lf
55

6+
# AffineScript source
7+
*.affine text eol=lf linguist-language=AffineScript
8+
69
# Source
710
*.rs text eol=lf diff=rust
811
*.ex text eol=lf diff=elixir

.machine_readable/6a2/STATE.a2ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ parser = "complete (1245 conflicts; block_terminator rule added for self-delimit
1919
type-checker = "99% (Never/bottom type handling fixed; block divergence propagation added)"
2020
borrow-checker = "95%"
2121
interpreter = "95%"
22-
wasm-codegen = "92% (real-world game compiles: airborne-submarine-squadron/src/main.as → 8KB WASM)"
22+
wasm-codegen = "92% (real-world game compiles: airborne-submarine-squadron/src/main.affine → 8KB WASM)"
2323
wasm-gc-codegen = "70% (WasmGC proposal target: struct.new/struct.get/array.new_fixed/array.get; --wasm-gc CLI flag)"
2424
julia-codegen = "exists"
2525
lsp-phase-a = "complete"

ALPHA-1-RELEASE-NOTES.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ dune build
9595
### Try the Examples
9696
```bash
9797
# Type check a game example
98-
dune exec affinescript -- check examples/hello.as
98+
dune exec affinescript -- check examples/hello.affine
9999

100100
# Run with interpreter
101-
dune exec affinescript -- eval examples/hello.as
101+
dune exec affinescript -- eval examples/hello.affine
102102

103103
# Compile to WebAssembly
104-
dune exec affinescript -- compile examples/hello.as -o hello.wasm
104+
dune exec affinescript -- compile examples/hello.affine -o hello.wasm
105105
```
106106

107107
---
@@ -217,7 +217,7 @@ git clone --branch v0.1.0-alpha.1 https://github.com/hyperpolymath/affinescript
217217

218218
# Build and run
219219
dune build
220-
dune exec affinescript -- eval examples/hello.as
220+
dune exec affinescript -- eval examples/hello.affine
221221

222222
# Start building your bug-free game!
223223
```

COMPILER-CAPABILITIES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ WebAssembly.instantiate(wasmBuffer).then(wasmModule => {
206206
### Native Deployment (Future)
207207
```bash
208208
# Future: Compile to native binary
209-
affinescript compile --target native --arch arm64 program.as
209+
affinescript compile --target native --arch arm64 program.affine
210210
./program
211211
```
212212

FIXES_2026-01-23.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ and check_block (ctx : context) (blk : block) (expected : ty) : eff result =
189189

190190
### Created Tests
191191

192-
**tests/borrow/use_after_move.as** - Should fail:
192+
**tests/borrow/use_after_move.affine** - Should fail:
193193
```affinescript
194194
fn consume(own x: Int) -> Int { return x; }
195195
fn test_use_after_move() -> Int {
@@ -200,7 +200,7 @@ fn test_use_after_move() -> Int {
200200
}
201201
```
202202

203-
**tests/borrow/valid_move.as** - Should pass:
203+
**tests/borrow/valid_move.affine** - Should pass:
204204
```affinescript
205205
fn consume(own x: Int) -> Int { return x; }
206206
fn test_valid_move() -> Int {
@@ -257,8 +257,8 @@ fn test_valid_move() -> Int {
257257
- `STATE.scm` - Updated completion %, blockers, accomplishments
258258

259259
### Tests Created
260-
- `tests/borrow/use_after_move.as` - Negative test
261-
- `tests/borrow/valid_move.as` - Positive test
260+
- `tests/borrow/use_after_move.affine` - Negative test
261+
- `tests/borrow/valid_move.affine` - Positive test
262262

263263
## Next Steps
264264

MODULE-SYSTEM-PROGRESS.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
- bin/main.ml (integrated module loader)
3030

3131
**Tests Passing:**
32-
- ✅ test_simple_import.as - Single function import
33-
- ✅ test_import.as - Multiple imports (Core + Math)
34-
- ✅ test_math_functions.as - Complex math operations
32+
- ✅ test_simple_import.affine - Single function import
33+
- ✅ test_import.affine - Multiple imports (Core + Math)
34+
- ✅ test_math_functions.affine - Complex math operations
3535

3636
**Commit:** `a1b2c3d` "fix: Transfer type information during module imports"
3737

@@ -53,9 +53,9 @@
5353
- lib/codegen.ml (~30 lines added)
5454

5555
**Tests Passing:**
56-
- ✅ test_function_call.as - Simple helper function (returns 42)
57-
- ✅ test_recursive_call.as - Factorial recursion (returns 120)
58-
- ✅ test_multiple_calls.as - Multiple functions + composition (returns 135)
56+
- ✅ test_function_call.affine - Simple helper function (returns 42)
57+
- ✅ test_recursive_call.affine - Factorial recursion (returns 120)
58+
- ✅ test_multiple_calls.affine - Multiple functions + composition (returns 135)
5959
- All tests verified with Node.js WASM execution
6060

6161
**Commit:** `31a60c5` "feat: Implement function calls in WASM codegen (Phase 2 complete)"
@@ -110,7 +110,7 @@
110110
**File:** `lib/module_loader.ml` (272 lines)
111111

112112
**Features:**
113-
- Module path to file path resolution (`Math.Geometry``stdlib/Math/Geometry.as`)
113+
- Module path to file path resolution (`Math.Geometry``stdlib/Math/Geometry.affine`)
114114
- Configurable search paths (stdlib, current dir, additional paths)
115115
- Module file parsing and caching
116116
- Circular dependency detection
@@ -139,13 +139,13 @@
139139

140140
### 3. Standard Library Fixed ✅
141141

142-
**Core.as:**
142+
**Core.affine:**
143143
- Removed underscore-prefixed parameters
144144
- Removed lambdas (parser limitation)
145145
- Added explicit `return` statements
146146
- Status: ✅ Working
147147

148-
**Math.as:**
148+
**Math.affine:**
149149
- Converted `const` to functions
150150
- Removed float operations (type checker limitation)
151151
- Added explicit `return` statements
@@ -194,9 +194,9 @@ type context = {
194194

195195
| Test | Feature | Expected | Result |
196196
|------|---------|----------|--------|
197-
| test_function_call.as | Simple call | 42 | ✅ PASS |
198-
| test_recursive_call.as | Recursion | 120 | ✅ PASS |
199-
| test_multiple_calls.as | Composition | 135 | ✅ PASS |
197+
| test_function_call.affine | Simple call | 42 | ✅ PASS |
198+
| test_recursive_call.affine | Recursion | 120 | ✅ PASS |
199+
| test_multiple_calls.affine | Composition | 135 | ✅ PASS |
200200

201201
## Module System Features Status
202202

@@ -308,7 +308,7 @@ type context = {
308308
3. Integrate effects with borrow checker
309309

310310
### Short-term
311-
1. Fix Option.as and Result.as (explicit returns)
311+
1. Fix Option.affine and Result.affine (explicit returns)
312312
2. Add more stdlib modules
313313
3. Improve error messages
314314

PHASE3-ASSESSMENT.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ Phase 3 infrastructure is **surprisingly complete**! The type system (lib/types.
6060

6161
**Test Cases Passing:**
6262
```bash
63-
✓ tests/types/test_row_simple.as # Basic row polymorphism
64-
✓ tests/types/test_parse_row_type.as # Parser validation
65-
✓ tests/types/test_row_polymorphism.as # Complex multi-call test
63+
✓ tests/types/test_row_simple.affine # Basic row polymorphism
64+
✓ tests/types/test_parse_row_type.affine # Parser validation
65+
✓ tests/types/test_row_polymorphism.affine # Complex multi-call test
6666
```
6767

6868
**Example Working Code:**
@@ -246,7 +246,7 @@ fn apply[F: Type -> Type, G: Type -> Type, A](f: F[A], g: G[A]) -> F[A] {
246246
}
247247
```
248248

249-
**Test File:** tests/types/test_hkt_parsing.as ✅ PASSES
249+
**Test File:** tests/types/test_hkt_parsing.affine ✅ PASSES
250250

251251
**What's Needed:**
252252
1. ❌ Integrate kind checking into type definitions
@@ -368,9 +368,9 @@ fn apply[F: Type -> Type, G: Type -> Type, A](f: F[A], g: G[A]) -> F[A] {
368368

369369
**Test Cases Passing:**
370370
```bash
371-
✓ tests/types/test_effect_inference.as # Pure function composition
372-
✓ tests/types/test_row_polymorphism.as # Still works with effect changes
373-
✓ tests/types/test_row_simple.as # Still works
371+
✓ tests/types/test_effect_inference.affine # Pure function composition
372+
✓ tests/types/test_row_polymorphism.affine # Still works with effect changes
373+
✓ tests/types/test_row_simple.affine # Still works
374374
```
375375

376376
**Known Limitation:**
@@ -438,31 +438,31 @@ fn take_positive(x: Int where (x > 0)) -> Int { return x; }
438438
fn dep_with_eff(f: (x: Int) -{IO}-> Int) -> Int { return 0; }
439439
```
440440

441-
**Test File:** tests/types/test_dependent_parsing.as ✅ PASSES
441+
**Test File:** tests/types/test_dependent_parsing.affine ✅ PASSES
442442

443443
## Testing Strategy
444444

445445
### ✅ Row Polymorphism Tests (COMPLETE)
446-
- ✅ tests/types/test_row_simple.as - Basic usage
447-
- ✅ tests/types/test_parse_row_type.as - Parser validation
448-
- ✅ tests/types/test_row_polymorphism.as - Complex scenarios
446+
- ✅ tests/types/test_row_simple.affine - Basic usage
447+
- ✅ tests/types/test_parse_row_type.affine - Parser validation
448+
- ✅ tests/types/test_row_polymorphism.affine - Complex scenarios
449449

450450
### ✅ Effect System Tests (COMPLETE)
451-
- ✅ tests/types/test_effect_inference.as - Pure function composition
451+
- ✅ tests/types/test_effect_inference.affine - Pure function composition
452452

453453
### ✅ Dependent Types Tests (PARSING COMPLETE)
454-
- ✅ tests/types/test_dependent_parsing.as - Parser validation for dependent arrows and refinements
454+
- ✅ tests/types/test_dependent_parsing.affine - Parser validation for dependent arrows and refinements
455455

456456
### ✅ Higher-Kinded Types Tests (COMPLETE)
457-
- ✅ tests/types/test_hkt_parsing.as - Parser validation for kind annotations and type applications
458-
- ✅ tests/types/test_kind_checking.as - Kind checking integration
457+
- ✅ tests/types/test_hkt_parsing.affine - Parser validation for kind annotations and type applications
458+
- ✅ tests/types/test_kind_checking.affine - Kind checking integration
459459

460460
### ✅ Generic Programming Tests (COMPLETE)
461-
- ✅ tests/types/test_traits.as - Trait definitions with higher-kinded types
462-
- ✅ tests/types/test_generic_programming.as - Functor, Applicative, Monad traits
461+
- ✅ tests/types/test_traits.affine - Trait definitions with higher-kinded types
462+
- ✅ tests/types/test_generic_programming.affine - Functor, Applicative, Monad traits
463463

464464
### ✅ End-to-End Tests (COMPLETE)
465-
- ✅ tests/types/test_dependent_e2e.as - Dependent types with refinements in practice
465+
- ✅ tests/types/test_dependent_e2e.affine - Dependent types with refinements in practice
466466

467467
## Conclusion
468468

PHASE3-COMPLETE.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Implemented save-restore pattern for variable bindings:
3232
- Modified ExprLambda handling in `synth` function (lib/typecheck.ml:626-646)
3333
- Modified ExprLambda handling in `check` function (lib/typecheck.ml:982-997)
3434

35-
**Test:** tests/types/test_lambda_scope_simple.as ✓ Passes
35+
**Test:** tests/types/test_lambda_scope_simple.affine ✓ Passes
3636

3737
### 1. Row Polymorphism (100%)
3838
**Implementation:** Extensible record types with row variables
@@ -208,19 +208,19 @@ fn fmap_twice[F: Type -> Type, A, B, C](
208208
| Generic Programming | 2 ||
209209

210210
**Test Files:**
211-
1. ✅ test_lambda_scope_simple.as (Lambda scope fix)
212-
2. ✅ test_row_simple.as
213-
3. ✅ test_parse_row_type.as
214-
4. ✅ test_row_polymorphism.as
215-
5. ✅ test_effect_inference.as
216-
6. ✅ test_effect_lambda.as
217-
7. ✅ test_effect_polymorphism.as
218-
8. ✅ test_dependent_parsing.as
219-
9. ✅ test_dependent_e2e.as
220-
10. ✅ test_hkt_parsing.as
221-
11. ✅ test_kind_checking.as
222-
12. ✅ test_traits.as
223-
13. ✅ test_generic_programming.as
211+
1. ✅ test_lambda_scope_simple.affine (Lambda scope fix)
212+
2. ✅ test_row_simple.affine
213+
3. ✅ test_parse_row_type.affine
214+
4. ✅ test_row_polymorphism.affine
215+
5. ✅ test_effect_inference.affine
216+
6. ✅ test_effect_lambda.affine
217+
7. ✅ test_effect_polymorphism.affine
218+
8. ✅ test_dependent_parsing.affine
219+
9. ✅ test_dependent_e2e.affine
220+
10. ✅ test_hkt_parsing.affine
221+
11. ✅ test_kind_checking.affine
222+
12. ✅ test_traits.affine
223+
13. ✅ test_generic_programming.affine
224224

225225
## 📈 Progress Timeline
226226

PHASE3-SESSION-SUMMARY.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
**Time:** 3.5 hours
2222

2323
**Tests:**
24-
- ✓ tests/types/test_row_simple.as
25-
- ✓ tests/types/test_parse_row_type.as
26-
- ✓ tests/types/test_row_polymorphism.as
24+
- ✓ tests/types/test_row_simple.affine
25+
- ✓ tests/types/test_parse_row_type.affine
26+
- ✓ tests/types/test_row_polymorphism.affine
2727

2828
### 2. ✅ Effect Inference (85% Complete)
2929

@@ -40,9 +40,9 @@
4040
**Time:** 2 hours
4141

4242
**Tests:**
43-
- ✓ tests/types/test_effect_inference.as
44-
- ✓ tests/types/test_effect_lambda.as
45-
- ✓ tests/types/test_effect_polymorphism.as
43+
- ✓ tests/types/test_effect_inference.affine
44+
- ✓ tests/types/test_effect_lambda.affine
45+
- ✓ tests/types/test_effect_polymorphism.affine
4646

4747
**Known Limitation:** Lambda parameter scope bug (pre-existing, separate issue)
4848

@@ -81,7 +81,7 @@ Works with both pure and effectful functions!
8181
- Type checker integration ✓
8282

8383
**Tests:**
84-
- ✓ tests/types/test_dependent_parsing.as
84+
- ✓ tests/types/test_dependent_parsing.affine
8585

8686
**Example:**
8787
```affinescript
@@ -114,7 +114,7 @@ fn take_positive(x: Int where (x > 0)) -> Int { return x; }
114114
**Time:** 0.5 hours
115115

116116
**Tests:**
117-
- ✓ tests/types/test_hkt_parsing.as
117+
- ✓ tests/types/test_hkt_parsing.affine
118118

119119
**Example:**
120120
```affinescript
@@ -155,14 +155,14 @@ Much of Phase 3 infrastructure was **already implemented** but not integrated:
155155
**All 8 Phase 3 tests passing:**
156156

157157
```
158-
✓ tests/types/test_row_simple.as
159-
✓ tests/types/test_parse_row_type.as
160-
✓ tests/types/test_row_polymorphism.as
161-
✓ tests/types/test_effect_inference.as
162-
✓ tests/types/test_effect_lambda.as
163-
✓ tests/types/test_effect_polymorphism.as
164-
✓ tests/types/test_dependent_parsing.as
165-
✓ tests/types/test_hkt_parsing.as
158+
✓ tests/types/test_row_simple.affine
159+
✓ tests/types/test_parse_row_type.affine
160+
✓ tests/types/test_row_polymorphism.affine
161+
✓ tests/types/test_effect_inference.affine
162+
✓ tests/types/test_effect_lambda.affine
163+
✓ tests/types/test_effect_polymorphism.affine
164+
✓ tests/types/test_dependent_parsing.affine
165+
✓ tests/types/test_hkt_parsing.affine
166166
```
167167

168168
## Phase 3 Status Breakdown
@@ -250,14 +250,14 @@ Row types created 20 shift/reduce conflicts. Solution was to write explicit recu
250250
- `lib/unify.ml` - Already complete (no changes needed)
251251

252252
### Tests Created:
253-
- `tests/types/test_row_simple.as`
254-
- `tests/types/test_parse_row_type.as`
255-
- `tests/types/test_row_polymorphism.as`
256-
- `tests/types/test_effect_inference.as`
257-
- `tests/types/test_effect_lambda.as`
258-
- `tests/types/test_effect_polymorphism.as`
259-
- `tests/types/test_dependent_parsing.as`
260-
- `tests/types/test_hkt_parsing.as`
253+
- `tests/types/test_row_simple.affine`
254+
- `tests/types/test_parse_row_type.affine`
255+
- `tests/types/test_row_polymorphism.affine`
256+
- `tests/types/test_effect_inference.affine`
257+
- `tests/types/test_effect_lambda.affine`
258+
- `tests/types/test_effect_polymorphism.affine`
259+
- `tests/types/test_dependent_parsing.affine`
260+
- `tests/types/test_hkt_parsing.affine`
261261

262262
### Documentation:
263263
- `PHASE3-ASSESSMENT.md` - Comprehensive progress tracking

README.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,22 +299,22 @@ total fn append[n: Nat, m: Nat, T](
299299
dune build
300300
301301
# Type check a file
302-
dune exec affinescript -- check examples/hello.as
302+
dune exec affinescript -- check examples/hello.affine
303303
304304
# Run with interpreter
305-
dune exec affinescript -- eval examples/factorial.as
305+
dune exec affinescript -- eval examples/factorial.affine
306306
307307
# Compile to WebAssembly
308-
dune exec affinescript -- compile examples/hello.as -o hello.wasm
308+
dune exec affinescript -- compile examples/hello.affine -o hello.wasm
309309
310310
# Format code
311-
dune exec affinescript -- fmt examples/hello.as
311+
dune exec affinescript -- fmt examples/hello.affine
312312
313313
# Lint for code quality
314-
dune exec affinescript -- lint examples/hello.as
314+
dune exec affinescript -- lint examples/hello.affine
315315
316316
# JSON diagnostics (for editors/CI)
317-
dune exec affinescript -- check --json examples/hello.as
317+
dune exec affinescript -- check --json examples/hello.affine
318318
----
319319

320320
== Project Status

0 commit comments

Comments
 (0)