Skip to content

Commit bda0576

Browse files
committed
docs: add version roadmap specs v1.3.0–v2.0.0 and update project.pxcf documentation
1 parent bc635e0 commit bda0576

12 files changed

Lines changed: 1875 additions & 4 deletions

File tree

.codacyrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
exclude_paths:
3+
- "preprocessed_vm.c"
4+
- "logs/**"
5+
- "tests/bin/**"
6+
- "tests/temp_src/**"
7+
- "build/**"

.gitignore

-43 Bytes
Binary file not shown.

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,15 @@ See [BENCHMARKS.md](BENCHMARKS.md) for detailed performance comparisons.
617617
-**Exception Handling**: `try`/`catch` blocks.
618618
-**Verification**: Verified via `tests/oop_v1.0.0.prox`.
619619

620-
### Future Roadmap (2026+)
621-
- 📋 **v1.2.0**: FFI Stability & ProX Studio Alpha.
622-
- 📋 **v1.3.0**: Pattern Matching, Enums, Generics.
623-
- 📋 **v2.0.0**: Async/Await, WebAssembly, JIT.
620+
### Future Roadmap (2026–2028)
621+
- 📋 **[v1.3.0](docs/releases/v1.3.0.md)** — Pattern Matching, Enums, Generics, FFI Stability.
622+
- 📋 **[v1.4.0](docs/releases/v1.4.0.md)** — Async/Await Runtime, Generators, Networking (`std.net`), JSON.
623+
- 📋 **[v1.5.0](docs/releases/v1.5.0.md)** — Traits, Result/Option Types, Generational GC, Debugger (DAP).
624+
- 📋 **[v1.6.0](docs/releases/v1.6.0.md)** — ProX Studio Alpha, PRM Registry, Testing Framework, Macros.
625+
- 📋 **[v1.7.0](docs/releases/v1.7.0.md)** — WebAssembly Target, String Templates, Operator Overloading, Formatter.
626+
- 📋 **[v1.8.0](docs/releases/v1.8.0.md)** — Channels, Actors, Database Connectivity, LSP v2, Compile-Time Eval.
627+
- 📋 **[v1.9.0](docs/releases/v1.9.0.md)** — Cross-Compilation, Embedded API, Security Hardening, API Freeze.
628+
- 🚀 **[v2.0.0](docs/releases/v2.0.0.md)** — Self-Hosting Compiler, JIT Compiler, Effect System, Production Stable.
624629

625630
## 🛠️ Contributing
626631

docs/releases/v1.3.0.md

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
# ProXPL v1.3.0: The "Pattern Power" Release
2+
3+
**Target Release Date:** Q2 2026
4+
**Status:** Planned
5+
**Codename:** Pattern Power
6+
7+
---
8+
9+
## 🌟 Overview
10+
11+
ProXPL v1.3.0 focuses on delivering three long-awaited language features — **Pattern Matching**, **Enums**, and **Generics** — alongside stabilizing the Foreign Function Interface (FFI) and fixing critical bugs identified in v1.2.0.
12+
13+
---
14+
15+
## ✨ New Features
16+
17+
### 1. Pattern Matching (`match` / `case`)
18+
First-class pattern matching with exhaustiveness checking.
19+
20+
```javascript
21+
func describe(value) {
22+
match (value) {
23+
case 0 => print("Zero");
24+
case 1..10 => print("Small number");
25+
case n if n > 100 => print("Large: " + to_string(n));
26+
case "hello" => print("Greeting!");
27+
case [first, ...rest] => print("List starting with " + to_string(first));
28+
case {name, age} => print(name + " is " + to_string(age));
29+
case _ => print("Unknown");
30+
}
31+
}
32+
```
33+
34+
**Implementation Details:**
35+
- New keywords: `match`, `case`, `_` (wildcard)
36+
- Range patterns: `1..10`, `'a'..'z'`
37+
- Guard clauses: `case n if n > 0`
38+
- Destructuring patterns for lists and dictionaries
39+
- Exhaustiveness checking at compile time
40+
- New AST nodes: `EXPR_MATCH`, `PATTERN_LITERAL`, `PATTERN_RANGE`, `PATTERN_WILDCARD`, `PATTERN_DESTRUCTURE`
41+
- New opcodes: `OP_MATCH`, `OP_MATCH_RANGE`, `OP_DESTRUCTURE`
42+
43+
---
44+
45+
### 2. Enums (Algebraic Data Types)
46+
Type-safe enumerated types with associated values.
47+
48+
```javascript
49+
enum Color {
50+
Red,
51+
Green,
52+
Blue,
53+
Custom(r, g, b)
54+
}
55+
56+
enum Result {
57+
Ok(value),
58+
Err(message)
59+
}
60+
61+
func process() {
62+
let status = Result.Ok(42);
63+
64+
match (status) {
65+
case Result.Ok(val) => print("Success: " + to_string(val));
66+
case Result.Err(msg) => print("Error: " + msg);
67+
}
68+
}
69+
```
70+
71+
**Implementation Details:**
72+
- New keyword: `enum`
73+
- Variant constructors with associated values
74+
- Integration with pattern matching for exhaustive checks
75+
- Type checker enforcement: all variants must be handled
76+
- New AST nodes: `DECL_ENUM`, `EXPR_ENUM_VARIANT`
77+
- New opcodes: `OP_ENUM`, `OP_ENUM_VARIANT`, `OP_IS_VARIANT`
78+
79+
---
80+
81+
### 3. Generics (Parameterized Types)
82+
Type-safe generic programming without code duplication.
83+
84+
```javascript
85+
func identity<T>(value: T): T {
86+
return value;
87+
}
88+
89+
class Stack<T> {
90+
let items: List<T> = [];
91+
92+
func push(item: T) {
93+
push(this.items, item);
94+
}
95+
96+
func pop(): T {
97+
return pop(this.items);
98+
}
99+
100+
func peek(): T {
101+
return this.items[length(this.items) - 1];
102+
}
103+
}
104+
105+
let intStack = new Stack<int>();
106+
intStack.push(42);
107+
```
108+
109+
**Implementation Details:**
110+
- Angle bracket syntax: `<T>`, `<K, V>`
111+
- Constraint bounds (future): `<T: Comparable>`
112+
- Monomorphization at compile-time for AOT path
113+
- Type erasure for VM/bytecode path
114+
- Type checker extensions for generic unification
115+
- New AST nodes: `TYPE_GENERIC`, `DECL_GENERIC_FUNC`, `DECL_GENERIC_CLASS`
116+
117+
---
118+
119+
### 4. FFI Stability
120+
Stabilize the Foreign Function Interface introduced in v0.7.0.
121+
122+
- **Type marshaling**: Full support for `int`, `float`, `string`, `bool`, `void*` parameter types
123+
- **Callback support**: Pass ProXPL functions as C callbacks
124+
- **Struct interop**: Read/write C struct fields from ProXPL
125+
- **Multi-library loading**: Load multiple `.dll`/`.so` files simultaneously
126+
- **Error handling**: Graceful handling of missing symbols and library load failures
127+
- **Documentation**: Complete FFI guide with platform-specific examples
128+
129+
---
130+
131+
## 🐛 Bug Fixes
132+
133+
### Critical
134+
| ID | Description | Component | Severity |
135+
|----|-------------|-----------|----------|
136+
| BUG-101 | **Token buffer overflow**: `main.c` uses fixed `Token tokens[4096]` arrays — large programs crash silently | Lexer/main.c | 🔴 Critical |
137+
| BUG-102 | **REPL version string outdated**: Shows `v1.0` instead of current version | main.c:34 | 🟡 Low |
138+
| BUG-103 | **PRM `run` parser mismatch**: `dispatchPRM` parses `project.pxcf` using TOML-style `key = "value"` but `manifest.c` uses `key: "value"` | PRM/main.c | 🔴 Critical |
139+
| BUG-104 | **`prm test` is a no-op**: Always prints "Tests passed! (0 failures)" without actually running tests | PRM/main.c:374 | 🟠 High |
140+
| BUG-105 | **`prm watch` not implemented**: Prints stub message and exits | PRM/main.c:377 | 🟠 High |
141+
| BUG-106 | **`.gitignore` file corruption**: Lines 137-141 contain NUL bytes (UTF-16 encoding corruption) | .gitignore | 🟡 Medium |
142+
| BUG-107 | **GC mark-and-sweep incomplete**: Listed as complete in PHASE_PLAN.md but noted as "not yet implemented" in CHANGELOG.md | GC/gc.c | 🟠 High |
143+
| BUG-108 | **Integer precision**: Runtime uses NaN-boxed doubles limiting integer precision to 53 bits | value.h/vm.c | 🟡 Medium |
144+
145+
### Improvements
146+
- Enhanced error messages with contextual suggestions ("Did you mean...?")
147+
- REPL history and tab-completion support
148+
- Dynamic token buffer allocation (replace fixed `Token[4096]` arrays)
149+
- Standardized `project.pxcf` parser across all code paths
150+
151+
---
152+
153+
## 📊 Compiler Changes
154+
155+
| Component | Change |
156+
|-----------|--------|
157+
| **Lexer** | New tokens: `TOKEN_MATCH`, `TOKEN_ENUM`, `TOKEN_CASE`, `TOKEN_WILDCARD` |
158+
| **Parser** | New AST nodes for pattern matching, enums, and generics |
159+
| **Type Checker** | Generic type unification, exhaustiveness checking, enum variant validation |
160+
| **Bytecode Gen** | New opcodes for match dispatch, enum construction, destructuring |
161+
| **VM** | Runtime support for enum values, pattern matching, generic type tags |
162+
163+
---
164+
165+
## 📈 Performance Goals
166+
167+
- Startup time: < 3ms (cold start)
168+
- Pattern match dispatch: O(1) via computed jump tables
169+
- Enum variant check: single-instruction comparison
170+
- No regression in existing benchmark suite
171+
172+
---
173+
174+
## 🔧 Breaking Changes
175+
176+
- None planned. Full backward compatibility with v1.2.0 code.
177+
178+
---
179+
180+
## 📦 Migration Guide
181+
182+
No migration required from v1.2.0. All new features are additive.
183+
184+
---
185+
186+
*ProXPL v1.3.0 — Making types work for you, not against you.*

0 commit comments

Comments
 (0)