Skip to content

Commit bf44778

Browse files
author
Jonathan D.A. Jewell
committed
general update
1 parent 584857a commit bf44778

4 files changed

Lines changed: 1962 additions & 687 deletions

File tree

Cargo.lock

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

STATE.scm

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
(version "1.0")
77
(schema-version "1.0")
88
(created "2026-02-04")
9-
(updated "2026-02-06")
9+
(updated "2026-02-06T2")
1010
(project "ephapax")
1111
(repo "hyperpolymath/ephapax"))
1212

@@ -17,14 +17,14 @@
1717

1818
(current-position
1919
(phase "type-checker-and-wasm")
20-
(overall-completion 55)
20+
(overall-completion 60)
2121
(components
2222
(("lexer" "Tokenization with logos (736 LOC)" 100)
2323
("parser" "Full parser with chumsky (1240 LOC)" 100)
2424
("syntax" "AST definitions (328 LOC)" 100)
2525
("interpreter" "Tree-walking interpreter (832 LOC)" 100)
2626
("typing" "Type checker - in progress (1002 LOC)" 60)
27-
("wasm-backend" "WASM code generation - in progress (1219 LOC)" 40)
27+
("wasm-backend" "WASM code generation with function compilation, linear lowering (2434 LOC)" 65)
2828
("ir" "S-expression intermediate representation (758 LOC)" 100)
2929
("runtime" "Runtime support (211 LOC)" 80)
3030
("stdlib" "Standard library skeleton (290 LOC)" 40)
@@ -86,11 +86,20 @@
8686
((milestone-id "m4")
8787
(name "WASM Backend")
8888
(status "in-progress")
89-
(completion 40)
90-
(items ("WASM code generation module (started)"
91-
"Linear type lowering to WASM"
92-
"Memory management for linear resources"
93-
"Browser and server target support")))
89+
(completion 65)
90+
(items ("WASM code generation module with wasmparser validation (done)"
91+
"Top-level function compilation to real WASM functions (done)"
92+
"Function calls between named functions (done)"
93+
"Proper local variable management with two-pass compilation (done)"
94+
"Integer/boolean operations, all BinOp/UnaryOp (done)"
95+
"Control flow: if/else, let bindings, blocks (done)"
96+
"Pair/sum type lowering to linear memory (done)"
97+
"Region-scoped memory management (done)"
98+
"String allocation/concat/length in linear memory (done)"
99+
"Linear type tracking: drop insertion, consumption marking (done)"
100+
"57 validated tests (wasmparser verification) (done)"
101+
"Lambda/closure conversion (stub - needs closure conversion)"
102+
"Browser and server target support (not started)")))
94103

95104
((milestone-id "m5")
96105
(name "Proven Data Structures")
@@ -110,7 +119,7 @@
110119
(critical
111120
("Type checker incomplete - critical path to MVP"))
112121
(high
113-
("WASM backend in early stages"
122+
("Lambda/closure conversion not yet implemented in WASM backend"
114123
"Standard library is skeletal (290 LOC)"))
115124
(medium
116125
("Idris2 two-stage compiler is experimental, not production-ready"
@@ -134,4 +143,22 @@
134143
(session-history
135144
((date "2026-02-06")
136145
(accomplishments
137-
("Updated STATE.scm with accurate project status from code audit"))))))
146+
("Updated STATE.scm with accurate project status from code audit")))
147+
((date "2026-02-06-session2")
148+
(accomplishments
149+
("Major WASM backend overhaul: 1219 LOC -> 2434 LOC"
150+
"Implemented top-level function compilation (Decl::Fn -> real WASM functions)"
151+
"Implemented function calls between named functions (App + Var -> call instruction)"
152+
"Added proper local variable management with two-pass compilation"
153+
"Fixed WASM section ordering (Type, Import, Function, Memory, Export, Code, Data)"
154+
"Fixed region_enter/region_exit stack balance bugs"
155+
"Fixed compile_copy stack balance bug"
156+
"Added wasmparser validation to all tests (dev-dependency)"
157+
"Added ty_to_valtype mapping for Ephapax types to WASM value types"
158+
"Added dynamic type registration for arbitrary function signatures"
159+
"Expanded test suite: 6 tests -> 57 tests (all wasmparser-validated)"
160+
"Tests cover: literals, arithmetic, comparison, logic, if/else, let, nested let,"
161+
" pairs, sums, case analysis, blocks, regions, strings, copy, drop,"
162+
" borrow/deref, negation, module compilation, function calling"
163+
"WASM backend completion: 40% -> 65%"
164+
"Overall project completion: 55% -> 60%"))))))

src/ephapax-wasm/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ categories.workspace = true
1717
ephapax-syntax = { workspace = true }
1818
ephapax-ir = { workspace = true }
1919
wasm-encoder = { workspace = true }
20+
21+
[dev-dependencies]
22+
wasmparser = "0.221"

0 commit comments

Comments
 (0)