Skip to content

Commit 8a60f91

Browse files
Claude/ephapax linear types e00 zs (#5)
* 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. * feat(backend): Add interpreter, REPL, CLI, and standard library - Complete ephapax-typing with full expression type checking (pair, sum types, case, let, string operations) - Add ephapax-interp tree-walking interpreter for debugging - Create ephapax-repl with interactive REPL and commands (:help, :type, :load, :tokens, :reset, :verbose) - Build ephapax-cli with subcommands (run, check, compile, repl) - Add ephapax-stdlib with prelude, I/O, string, math modules - Add compile_module function to ephapax-wasm * chore: Add library folder structure for common and specific libraries Set up directory structure for Ephapax libraries: - library/common/ for shared language implementations - library/specific/ for Ephapax-specific code --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5578136 commit 8a60f91

12 files changed

Lines changed: 1887 additions & 1 deletion

File tree

Cargo.lock

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

library/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Ephapax Library
2+
3+
This directory contains the Ephapax standard library files.
4+
5+
## Structure
6+
7+
- `common/` - Common library code shared across language implementations
8+
- `specific/` - Ephapax-specific library code
9+
10+
## Usage
11+
12+
Library files use the `.ephapax` extension and are automatically loaded by the compiler and REPL.

library/common/.gitkeep

Whitespace-only changes.

library/specific/.gitkeep

Whitespace-only changes.

src/ephapax-cli/Cargo.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# SPDX-License-Identifier: EUPL-1.2
2+
# SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell
3+
4+
[package]
5+
name = "ephapax-cli"
6+
description = "Command-line interface for Ephapax"
7+
version.workspace = true
8+
edition.workspace = true
9+
license.workspace = true
10+
authors.workspace = true
11+
repository.workspace = true
12+
13+
[[bin]]
14+
name = "ephapax"
15+
path = "src/main.rs"
16+
17+
[dependencies]
18+
ephapax-syntax.workspace = true
19+
ephapax-lexer.workspace = true
20+
ephapax-parser.workspace = true
21+
ephapax-typing.workspace = true
22+
ephapax-wasm.workspace = true
23+
ephapax-interp.workspace = true
24+
ephapax-repl.workspace = true
25+
smol_str.workspace = true
26+
clap.workspace = true
27+
colored.workspace = true
28+
ariadne.workspace = true

0 commit comments

Comments
 (0)