feat: add schema evolution type system integration and HTTP server effect

Schema Evolution:
- Preserve version info in type resolution (Type::Versioned)
- Track versioned type declarations in typechecker
- Detect version mismatches at compile time (@v1 vs @v2 errors)
- Support @v2+ (at least) and @latest version constraints
- Store migrations for future auto-migration support
- Fix let bindings to preserve declared type annotations

HTTP Server Effect:
- Add HttpServer effect with listen, accept, respond, respondWithHeaders, stop
- Implement blocking request handling via tiny_http
- Request record includes method, path, body, headers
- Add http_server.lux example with routing via pattern matching
- Add type-checking test for HttpServer effect

Tests: 222 passing (up from 217)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-13 22:06:31 -05:00
parent 554a1e7c3e
commit 086552b7a4
9 changed files with 1153 additions and 21 deletions

View File

@@ -128,10 +128,16 @@ let content = File.read("config.txt")
File.write("output.txt", "Hello!")
let exists = File.exists("file.lux")
// HTTP effects
// HTTP client effects
let response = Http.get("https://api.example.com/data")
Http.post("https://api.example.com/submit", "{\"key\": \"value\"}")
// HTTP server effects
HttpServer.listen(8080)
let req = HttpServer.accept() // Returns { method, path, body, headers }
HttpServer.respond(200, "Hello, World!")
HttpServer.stop()
// Random effects
let n = Random.int(1, 100)
let coin = Random.bool()

View File

@@ -57,10 +57,10 @@
| Task | Priority | Effort | Status |
|------|----------|--------|--------|
| HTTP server effect | P1 | 2 weeks | ❌ Missing |
| HTTP server effect | P1 | 2 weeks | ✅ Complete |
| Routing DSL | P2 | 1 week | ❌ Missing |
| Middleware pattern | P2 | 1 week | ❌ Missing |
| Request/Response types | P1 | 3 days | ❌ Missing |
| Request/Response types | P1 | 3 days | ✅ Complete (via HttpServer effect) |
### Phase 1.4: Developer Experience