Skip to content

Linear type system for WebAssembly memory safety#1

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/ephapax-linear-types-E00ZS
Dec 17, 2025
Merged

Linear type system for WebAssembly memory safety#1
hyperpolymath merged 1 commit into
mainfrom
claude/ephapax-linear-types-E00ZS

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

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

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
@hyperpolymath hyperpolymath merged commit 9350b2b into main Dec 17, 2025
2 of 8 checks passed
@hyperpolymath hyperpolymath deleted the claude/ephapax-linear-types-E00ZS branch December 17, 2025 00:54
hyperpolymath pushed a commit that referenced this pull request Feb 7, 2026
Documents implementation status of 5 optional enhancements:

1. ✅ Debugger Support (Phase 1 complete: source maps + mode metadata)
   - Phases 2-4 planned (DWARF, DAP, VS Code integration)

2. ⏳ Package Manager (not started)
   - Cargo-style dependency management
   - Module import syntax
   - Local registry

3. ⏳ Performance Benchmarks (not started)
   - Ephapax vs Rust vs AssemblyScript
   - Compilation speed, binary size, runtime perf
   - CI integration

4. ⏳ VS Code Extension (not started)
   - Syntax highlighting
   - LSP integration (reuse existing ephapax-lsp)
   - Mode switcher UI

5. ⏳ Closure Environment Optimization (not started)
   - Escape analysis + free variable analysis
   - Minimal capture sets
   - 10-30% binary size reduction expected

Overall completion: 20% (1/5 done)

Recommended implementation order: #2#3#4#5#1 (complete)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants