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
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Core Development Principles

- **NEVER DUPLICATE CODE** - Edit in place, never create new versions. Actively remove duplicate code and always aim for conciseness. Always do a search before adding new code.
- **NEVER DUPLICATE CODE** - Edit in place, never create new versions. Actively remove duplicate code, even test code and always aim for conciseness. Always do a search before adding new code.
- **NO PLACEHOLDERS** - Fix existing placeholders or fail with error

⛔️ This is completely illegal
Expand All @@ -28,6 +28,7 @@ t.Fatalf("⚠️ NOTE: Circular dependency detection not yet implemented. Implem
- **KEEP ALL FILES UNDER 500 LOC** - Break large files into focused modules
- **FP STYLE CODE** - pure functions over OOP style
- **USE CONSTANTS** - Name values meaningfully instead of using literals
- ACTIVELY FIX RULE VIOLATIONS AS A HIGH PRIORITY

## Commands

Expand Down
1 change: 1 addition & 0 deletions compiler/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
- **DO NOT COMMIT/PUSH CODE** unless explicitly requested
- **NEVER DUPLICATE CODE** - Edit in place, **SEARCH** for code **BEFORE** creating new functions/constants
- **NO PLACEHOLDERS** - Fix existing placeholders or fail with error
- **AVOID SPECIFYING TYPES EXPLICITLY IN OSPREY** - Use Hindley Milner type inference!
- **NEVER IGNORE TESTS** - Don't reduce assertions to make tests pass, fail loudly
- **KEEP ALL FILES UNDER 500 LOC** - Break large files into focused modules
- **FOLLOW STATIC ANALYSIS** - Pay attention to linters and fix issues
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
line 6:4 mismatched input 'yield' expecting {'}', ID}
line 6:9 extraneous input ':' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 7:10 extraneous input ':' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 7:23 extraneous input '->' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 8:0 extraneous input '}' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 6:9 extraneous input ':' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 7:10 extraneous input ':' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 7:23 extraneous input '->' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 8:0 extraneous input '}' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 19:30 no viable alternative at input '{performFiberCoordination.notify("Task "+toString(taskId)+" starting")performFiberCoordination.yield'
line 19:30 no viable alternative at input 'performFiberCoordination.yield'
line 21:30 no viable alternative at input 'performFiberCoordination.yield'
line 23:0 extraneous input '}' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 23:0 extraneous input '}' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
line 45:7 no viable alternative at input 'handleLoggerlog('
line 45:7 no viable alternative at input '('
line 45:13 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 45:13 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 45:21 no viable alternative at input '('
line 46:0 extraneous input 'in' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 48:14 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 46:0 extraneous input 'in' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 48:14 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 49:11 no viable alternative at input '('
line 49:19 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 49:19 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 49:27 no viable alternative at input '('
line 50:4 extraneous input 'in' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 50:4 extraneous input 'in' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
line 15:7 no viable alternative at input 'handleLoggerlog('
line 15:7 no viable alternative at input '('
line 15:13 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 15:13 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 16:9 no viable alternative at input '('
line 16:15 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 16:15 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 18:9 no viable alternative at input '('
line 18:15 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 18:15 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 18:23 no viable alternative at input '('
line 19:0 extraneous input 'in' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 19:0 extraneous input 'in' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
line 41:7 no viable alternative at input '('
line 41:13 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 41:13 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 42:9 no viable alternative at input '('
line 42:15 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 42:15 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 45:14 no viable alternative at input '{withhandlerStateget()=>'
line 45:14 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 45:14 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 46:11 no viable alternative at input '('
line 46:19 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 46:19 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 49:24 no viable alternative at input '{withhandlerCounterincrement()=>'
line 49:24 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 50:23 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 58:4 extraneous input '}' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 49:24 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 50:23 extraneous input '=>' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
line 58:4 extraneous input '}' expecting {<EOF>, 'match', 'select', 'fn', 'extern', 'import', 'type', 'module', 'let', 'mut', 'effect', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID, DOC_COMMENT}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
line 7:16 extraneous input '*' expecting {'select', 'fn', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', INT, INTERPOLATED_STRING, STRING, ID}
line 7:16 extraneous input '*' expecting {'select', 'fn', 'perform', 'handle', 'spawn', 'yield', 'await', 'send', 'recv', 'true', 'false', '!', '|', '(', '{', '[', '+', '-', FLOAT, INT, INTERPOLATED_STRING, STRING, ID}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ fn compute() = {
Error { message } => 10
}
let multiplier = 3
base * multiplier
let result = base * multiplier
match result {
Success { value } => value
Error { message } => 0
}
}
print("Test 1 - Function block with list: ${compute()}")

Expand All @@ -26,9 +30,17 @@ let result2 = {
Success { value } => value
Error { message } => 25
}
outer * 2
let mult = outer * 2
match mult {
Success { value } => value
Error { message } => 0
}
}
let sum = outer + inner
match sum {
Success { value } => value
Error { message } => 0
}
outer + inner
}
print("Test 2 - Nested with shadowing, maps & lists: ${result2}")

Expand All @@ -38,50 +50,77 @@ let result3 = {
let scoreMap = { "test1": 84, "test2": 90 }
let doubled = value * 2
match doubled {
84 => match scoreMap["test1"] {
Success { value } => value + 10
Error { message } => 0
Success { dValue } => match dValue {
84 => match scoreMap["test1"] {
Success { sValue } => {
let added = sValue + 10
match added {
Success { value } => value
Error { message } => 0
}
}
Error { message } => 0
}
_ => 0
}
_ => 0
Error { message } => 0
}
}
print("Test 3 - Block with match and map: ${result3}")

// Test 4: Function returning block with list operations
fn processData(input) = {
fn processData(input: int) = {
let steps = [2, 10, 2]
let step1 = input * (match steps[0] {
let step0 = match steps[0] {
Success { value } => value
Error { message } => 1
})
let step2 = step1 + (match steps[1] {
}
let mult = input * step0
let step1Value = match mult {
Success { value } => value
Error { message } => 0
})
let step3 = step2 / (match steps[2] {
}
let step1Idx = match steps[1] {
Success { value } => value
Error { message } => 0
}
let add = step1Value + step1Idx
let step2Value = match add {
Success { value } => value
Error { message } => 0
}
let step2Idx = match steps[2] {
Success { value } => value
Error { message } => 1
})
step3
}
step2Value / step2Idx
}
print("Test 4 - Complex function with lists: ${processData(5)}")

// Test 5: Block with mixed collections operations
let mixedTest = {
let data = [1, 2, 3, 4, 5]
let lookup = { "key1": 10, "key2": 20 }
let sum = (match data[0] {
let addResult = (match data[0] {
Success { value } => value
Error { message } => 0
}) + (match data[1] {
Success { value } => value
Error { message } => 0
})
let sum = match addResult {
Success { value } => value
Error { message } => 0
}
let multiplier = match lookup["key1"] {
Success { value } => value
Error { message } => 1
}
sum * multiplier
let multResult = sum * multiplier
match multResult {
Success { value } => value
Error { message } => 0
}
}
print("Test 5 - Mixed collections block: ${mixedTest}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Test 2 - Nested with shadowing, maps & lists: 90
Test 3 - Block with match and map: 94
Test 4 - Complex function with lists: 10
Test 5 - Mixed collections block: 30
=== Advanced Block Statements Complete ===
=== Advanced Block Statements Complete ===
Loading
Loading