Commit 5578136
Claude/ephapax linear types e00 zs (#4)
* feat: Initial Ephapax language implementation
Ephapax is a linear type system for safe memory management
targeting WebAssembly.
This commit includes:
Core Implementation:
- ephapax-syntax: AST definitions with linear type annotations
- ephapax-typing: Linear type checker with region support
- ephapax-wasm: WASM code generator with bump allocation
- ephapax-runtime: no_std WASM runtime with region management
Formal Semantics (Coq):
- Syntax.v: Core type and expression definitions
- Typing.v: Linear typing rules with context tracking
- Semantics.v: Operational semantics and safety theorems
Documentation:
- Language specification (spec/SPEC.md)
- Comprehensive wiki documentation
- ROADMAP.md with detailed development plan
- CONTRIBUTING.adoc guide
Infrastructure:
- Cargo workspace with 4 crates
- CI/CD workflow for Rust and Coq
- EUPL-1.2 license
Key features:
- Linear types prevent use-after-free and memory leaks
- Region-based memory management for bulk deallocation
- Second-class borrows for temporary access
- Formal proofs in Coq for type safety
* feat(frontend): Add lexer and parser for Ephapax language
Implements Phase 2 (Language Frontend) of the Ephapax roadmap:
- ephapax-lexer: High-performance lexer using logos
- Tokenizes all Ephapax syntax (keywords, operators, literals)
- Support for nested block comments {- -}
- String escape sequence handling
- Comprehensive error recovery
- 20+ unit tests
- ephapax-parser: Parser combinator implementation using chumsky
- Complete expression parsing (let, fn, if, region, case, etc.)
- Type parsing (base types, String@region, functions, products, sums)
- Declaration parsing (fn, type)
- Rich error reporting with ariadne
- 19 unit tests + doc tests
All tests pass successfully.
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent d7195b4 commit 5578136
5 files changed
Lines changed: 1959 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments