You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# TLDR
This PR cleans up documentation, fixes specification inconsistencies,
and improves the overall presentation of the Osprey programming
language. Key changes include a major README overhaul, specification
cleanup, HTTP security improvements, and Docker configuration fixes.
# What Was Added?
## README.md Enhancements
- **GitHub Star Call-to-Action**: Added prominent stars request with
Homebrew submission goal
- **Revolutionary Safety Section**: Highlighted world-first compile-time
effect safety
- **Comprehensive Syntax Example**: Replaced basic examples with full
algebraic effects demonstration showing handler isolation
- **Recent Major Updates Section**: Documented recent algebraic effects
system implementation
- **Improved Project Structure**: Better organization with cleaner
directory descriptions
- **Professional Language**: More polished and accessible descriptions
## Specification Improvements
- **Consistent Numbering**: Fixed algebraic effects from section 20 to
18 across all files
- **Reference Links**: Added proper academic paper references at bottom
of algebraic effects spec
- **Clean Structure**: Removed AI tool output artifacts and improved
readability
# What Was Changed / Deleted?
## README.md Changes
- **Removed**: Local development quick start section (redundant with
main development section)
- **Removed**: Overly technical AI development discussion
- **Simplified**: Development setup instructions
- **Updated**: Language description from "programming oriented" to
"programming language"
- **Streamlined**: Project links and references
## HTTP Specification Security Fix
- **Removed**: `contentLength` and `partialLength` fields from
`HttpResponse` type
- **Reasoning**: Prevents hardcoded length bugs by using runtime
`strlen()` calculation
- **Updated**: All HTTP response examples to remove these fields
- **Added**: Security note explaining the change
## Algebraic Effects Specification Cleanup
- **Removed**: Redundant "Completeness Report" section with AI tool
artifacts
- **Cleaned**: Section numbering from 20.x to 18.x format
- **Moved**: Research references to proper location
- **Streamlined**: Introduction and theoretical foundation sections
## Docker Configuration Fix
- **Reverted**: Golang version from 1.24 (non-existent) to 1.23
- **Removed**: Unnecessary build dependencies to simplify image
- **Streamlined**: Runtime dependencies for smaller image size
# How Do The Automated Tests Prove It Works?
## Algebraic Effects System Tests
- **`TestGenerateEffectDeclaration_NoMalformedLLVM`**: Proves effect
declarations don't generate malformed LLVM IR
- **`TestGenerateEffectDeclaration_EffectRegistration`**: Verifies
effect registration system works correctly
- **`TestGenerateEffectDeclaration_MultipleEffects`**: Tests multiple
effects can coexist
- **`TestGenerateEffectDeclaration_NoStubGeneration`**: Ensures no stub
functions are generated (prevents regression)
- **`TestEffectsExamples`**: Integration tests for all algebraic effects
examples in `examples/tested/effects/`
## HTTP System Tests
- **`TestHTTPExamples`**: Comprehensive HTTP server/client functionality
testing
- **`TestHTTPRuntimeLibrary`**: Verifies C runtime library contains
required HTTP symbols
- **`TestHTTPCompilationLinking`**: Tests HTTP code compilation and
linking
- **`TestSandboxModeBlocksHTTPFunctions`**: Security tests ensuring
sandbox mode blocks HTTP functions
- **WebSocket Tests**: Full WebSocket client/server functionality
testing
## Documentation Consistency Tests
- **`TestDocsDeterministic`**: Ensures documentation generation is
deterministic
- **CLI Tests**: Verify all command-line interface features work
correctly
- **Integration Tests**: Test compilation of examples from
`examples/tested/` directory
## Build System Tests
- **`TestBuildLinkArguments`**: Verifies correct linking arguments for
HTTP runtime
- **`TestManualLinking`**: Tests manual linking process with OpenSSL
- **`TestActualCompilationProcess`**: End-to-end compilation testing
- **Fiber Tests**: Comprehensive fiber concurrency feature testing
# Summarise Changes To The Spec Here
## Algebraic Effects Specification (Section 18)
- **Renumbered**: From section 20 to section 18 for consistency
- **Cleaned**: Removed AI tool artifacts and redundant content
- **Improved**: Structure and readability while maintaining technical
accuracy
- **Added**: Proper academic references at the end
- **Maintained**: All core technical content about effect declarations,
perform expressions, and compile-time safety
## HTTP Specification (Section 15)
- **Security Enhancement**: Removed `contentLength` and `partialLength`
fields from `HttpResponse` type
- **Rationale**: Prevents hardcoded length bugs by using runtime
`strlen()` calculation
- **Updated**: All code examples to reflect the simplified response
structure
- **Added**: Security note explaining the change and its benefits
## Website Specification Sync
- **Consistency**: Synchronized website specification files with
compiler specifications
- **Links**: Fixed broken reference links and cleaned up titles
- **Structure**: Improved overall organization and presentation
---------
Co-authored-by: AI Assistant <ai@cursor.com>
Built on proven tech: [Go](https://golang.org/) for the compiler, [ANTLR](https://www.antlr.org/) for parsing, and [LLVM](https://llvm.org/) for code generation.
88
+
Built on proven tech: Go for the compiler, ANTLR for parsing, and LLVM for code generation.
68
89
69
-
**The best part**: You don't need to be a compiler expert. AI agents like Claude Sonnet 4 with Cursor make implementing language features accessible to anyone willing to learn. That combo was the first that actually got me over the hump of building a compiler, though other AI setups could get you there too.
90
+
**AI-Assisted Development**: Claude Sonnet 4 with Cursor makes implementing language features accessible. Check out [CONTRIBUTING.md](CONTRIBUTING.md) for the workflow.
70
91
71
-
**Use VS Code Dev Containers** - strongly recommended. Open in VS Code and hit "Reopen in Container". Everything's pre-configured.
92
+
**Use VS Code Dev Containers** - strongly recommended. Open in VS Code and hit "Reopen in Container".
72
93
73
94
```bash
74
95
cd compiler
75
-
make install-deps # Install Go dependencies
76
96
make build # Build compiler
77
97
make test# Run tests
78
-
make regenerate-parser # Regenerate from grammar
98
+
make install # Install locally
79
99
```
80
100
81
-
Want to add a new operator or language feature? Check out [CONTRIBUTING.md](CONTRIBUTING.md) for the AI-assisted workflow that works.
82
-
83
101
## Status
84
102
85
-
🚧 **Alpha**: Core language features implemented. HTTP and fiber systems in development.
103
+
🚧 **Alpha**: Core language features implemented. Algebraic effects system working with compile-time safety, but are missing some features. HTTP and advanced features in development.
104
+
105
+
See [compiler/spec/](compiler/spec/) for implementation status.
86
106
87
-
See [compiler/spec.md](compiler/spec.md) for implementation status and roadmap.
107
+
## Recent Major Updates
108
+
109
+
-**Algebraic Effects System**: Complete implementation with compile-time safety guarantees
110
+
-**Effect Declarations**: `effect` keyword for defining effect operations
111
+
-**Perform Expressions**: `perform` keyword for effect operations
112
+
-**Handler Expressions**: `handle...in` syntax for effect handling
113
+
-**Compile-Time Verification**: Unhandled effects cause compilation errors (world-first!)
88
114
89
115
## License
90
116
91
-
MIT License - see [LICENSE](LICENSE)
117
+
MIT License - see [LICENSE](LICENSE)
118
+
119
+
---
120
+
121
+
⭐ **[Give us a star on GitHub](https://github.com/MelbourneDeveloper/osprey)** if you like what we're building! ⭐
**Based on Plotkin & Pretnar's foundational work on algebraic effects and handlers**
18
4
19
-
### 20.0 IMPLEMENTATION STATUS
5
+
Osprey has a first class effects system.
6
+
7
+
### 18.0 IMPLEMENTATION STATUS
20
8
21
9
**PARTIALLY IMPLEMENTED** - Effect declarations, perform expressions, and **COMPILE-TIME SAFETY** are fully working! Handler expressions parsing is implemented but handler execution needs completion.
22
10
23
-
### 20.1 Theoretical Foundation
11
+
### 18.1 Theoretical Foundation
24
12
25
13
Algebraic effects are computational effects that can be represented by:
26
14
1.**A set of operations** that produce the effects
@@ -34,13 +22,13 @@ The **free model** of the equational theory generates the computational monad fo
34
22
35
23
**Key insight from Plotkin & Pretnar**: Handlers are **effect deconstructors** that provide interpretations, while operations are **effect constructors** that produce effects.
36
24
37
-
### 20.2 New Keywords
25
+
### 18.2 New Keywords
38
26
39
27
```
40
28
effect perform handler with do
41
29
```
42
30
43
-
### 20.3 Effect Declarations
31
+
### 18.3 Effect Declarations
44
32
45
33
An effect declares a set of operations in the algebraic theory:
46
34
@@ -60,7 +48,7 @@ effect State {
60
48
61
49
This declares a **State** effect with operations `get` and `set`. No equations are specified (free theory).
62
50
63
-
### 20.4 Effectful Function Types
51
+
### 18.4 Effectful Function Types
64
52
65
53
Functions declare their effect dependencies with `!EffectSet`:
**CRITICAL COMPILE-TIME SAFETY**: If no handler intercepts the call, the compiler produces a **compilation error**. Unhandled effects are **NEVER** permitted at runtime.
93
81
94
-
### 20.6 Handlers - Models of the Effect Theory
82
+
### 18.6 Handlers - Models of the Effect Theory
95
83
96
84
A handler provides a **model** of the effect theory by specifying how each operation should be interpreted:
97
85
@@ -116,7 +104,7 @@ in
116
104
117
105
The `handle...in` construct applies the **unique homomorphism** from the free model (where `incrementTwice` lives) to the handler model.
118
106
119
-
### 20.7 Handler Correctness
107
+
### 18.7 Handler Correctness
120
108
121
109
From Plotkin & Pretnar: A handler is **correct** if its interpretation holds in the corresponding model of the effect theory.
122
110
@@ -125,7 +113,7 @@ In Osprey:
125
113
-**Type checking** ensures handler signatures match operation signatures
126
114
-**Effect inference** computes minimal effect sets for expressions
127
115
128
-
### 20.8 Nested Handlers and Composition
116
+
### 18.8 Nested Handlers and Composition
129
117
130
118
Handlers can be nested. The **innermost handler** wins for each effect:
131
119
@@ -139,7 +127,7 @@ in
139
127
perform Logger.log "test" // Prints "[INNER] test"
140
128
```
141
129
142
-
### 20.9 Effect Sets and Inference
130
+
### 18.9 Effect Sets and Inference
143
131
144
132
* The compiler **infers the minimal effect set** for every expression
145
133
* Functions must **declare** their effects or be **pure**
[1]: https://www.ospreylang.dev/spec/"Osprey Language Specification - Osprey Programming Language"
322
310
323
-
## Completeness Report
324
-
325
-
I'll analyze the Osprey algebraic effects implementation against the Plotkin & Pretnar paper to verify correctness. Let me examine the key theoretical concepts and their implementation.
326
-
Read file: spec.md
327
-
328
-
Read file: spec.md
329
-
330
-
Read file: spec.md
331
-
332
-
Read file: spec.md
333
-
334
-
Now let me analyze Osprey's implementation against the theoretical foundation. I'll create a comprehensive verification of the algebraic effects implementation.
0 commit comments