Skip to content

Commit 1e34ecb

Browse files
Testclaude
andcommitted
feat: enable Idris2/Zig tooling and add proven integration docs
Changes: - Enable idris2 0.7.0 in .tool-versions (for ABI with formal proofs) - Enable zig 0.13.0 in .tool-versions (for FFI implementation) - Add PROVEN.md documenting integration with proven library - Sets up formal verification infrastructure proven provides mathematically proven safe operations via Idris2. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent a30b659 commit 1e34ecb

2 files changed

Lines changed: 91 additions & 4 deletions

File tree

.tool-versions

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ rust 1.84.0
77
# Deno (NO Node.js/npm per language policy)
88
deno 2.1.4
99

10-
# Optional: Idris2 for ABI work
11-
# idris2 0.7.0
10+
# Idris2 for ABI with formal proofs
11+
idris2 0.7.0
1212

13-
# Optional: Zig for FFI work
14-
# zig 0.13.0
13+
# Zig for FFI implementation
14+
zig 0.13.0

PROVEN.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Proven Integration
2+
3+
WokeLang uses [proven](https://github.com/hyperpolymath/proven) for formally verified operations where safety is critical.
4+
5+
## What is proven?
6+
7+
proven is an Idris2 library providing mathematically proven safe operations:
8+
- **Cannot crash** - Dependent types prove correctness
9+
- **Totality checking** - All code paths guaranteed to terminate
10+
- **90+ modules** - Comprehensive formally verified functionality
11+
- **89 language bindings** - FFI via Zig C ABI
12+
13+
## Architecture
14+
15+
```
16+
WokeLang (Rust)
17+
18+
Rust Bindings
19+
20+
Zig FFI Bridge
21+
22+
Idris2 proven Library ← MATHEMATICAL PROOFS
23+
```
24+
25+
## Integration Points
26+
27+
### Current
28+
29+
WokeLang currently uses proven for:
30+
- (To be determined based on safety-critical needs)
31+
32+
### Planned
33+
34+
Potential proven integration for:
35+
- **File I/O** - Proven-safe file operations with capability checks
36+
- **String operations** - Bounds-checked string manipulation
37+
- **Collection operations** - Verified data structure operations
38+
- **Parser combinators** - Provably correct parsing
39+
40+
## Using proven in WokeLang
41+
42+
### Setup
43+
44+
1. Ensure Idris2 is installed (see `.tool-versions`)
45+
2. Clone proven:
46+
```bash
47+
git clone https://github.com/hyperpolymath/proven
48+
cd proven
49+
make install
50+
```
51+
52+
3. Link WokeLang to proven bindings:
53+
```bash
54+
cd wokelang
55+
# Add proven-rust bindings to Cargo.toml
56+
```
57+
58+
### Example
59+
60+
```rust
61+
// Use proven-safe string operations
62+
use proven_rust::string::SafeString;
63+
64+
let s = SafeString::new("Hello").unwrap();
65+
let sub = s.substring(0, 5); // Mathematically proven not to panic
66+
```
67+
68+
## Badge
69+
70+
When WokeLang uses proven modules, add the "Idris Inside" badge to README:
71+
72+
```adoc
73+
image:https://img.shields.io/badge/Idris-Inside-blueviolet?style=flat[Idris Inside]
74+
```
75+
76+
## Performance Note
77+
78+
proven adds FFI overhead for maximum safety. Use for:
79+
- ✓ Safety-critical operations (file I/O, parsing user input)
80+
- ✓ Security boundaries (capability checks, permission validation)
81+
- ✗ Hot loops or performance-critical paths
82+
83+
## References
84+
85+
- proven repo: https://github.com/hyperpolymath/proven
86+
- Idris2 docs: https://idris2.readthedocs.io
87+
- Zig FFI: /var/mnt/eclipse/repos/proven/ffi/zig/

0 commit comments

Comments
 (0)