Target Release Date: Q2 2027
Status: Planned
Codename: Wasm World
ProXPL v1.7.0 introduces the WebAssembly compilation target, enabling ProXPL programs to run in browsers and edge runtimes. This release also brings Closures v2 with proper escape analysis, String Templates, Operator Overloading, and the ProXPL Formatter (prox fmt).
Compile ProXPL to WebAssembly for browser and edge deployment.
# Compile to Wasm
proxpl build --target wasm app.prox
# Output: app.wasm + app.js (glue code)
# Serve locally
prm serve --wasm
# Opens browser at localhost:3000Architecture:
Source (.prox) → AST → IR → LLVM IR → Wasm Backend → .wasm + .js glue
Features:
- Full language support in Wasm (except FFI and filesystem)
- JavaScript interop bridge (call JS from ProXPL and vice-versa)
- DOM manipulation API (
std.web.dom) - Event handling (
std.web.event) - Fetch API integration (
std.web.http) - Canvas 2D drawing support (
std.web.canvas) - WASI (WebAssembly System Interface) support for server-side Wasm
Browser API Example:
use std.web.dom;
use std.web.event;
func main() {
let btn = dom.create("button");
btn.text = "Click me!";
btn.style.backgroundColor = "#4CAF50";
event.on(btn, "click", func() {
dom.alert("Hello from ProXPL!");
});
dom.body.append(btn);
}Embedded expressions in strings.
let name = "World";
let age = 25;
// Template literal syntax
let greeting = `Hello, ${name}! You are ${age} years old.`;
// Multi-line strings
let html = `
<div class="card">
<h1>${title}</h1>
<p>${description}</p>
</div>
`;
// Expression evaluation
let result = `2 + 2 = ${2 + 2}`;
print(result); // "2 + 2 = 4"Implementation Details:
- Backtick (
`) delimited strings ${expr}for embedded expressions- Multi-line support with preserved whitespace
- Nested template literals supported
- New token:
TOKEN_TEMPLATE_STRING - Compiled to string concatenation at bytecode level
Custom operators for user-defined types.
class Vector2D {
let x: float;
let y: float;
func init(x, y) {
this.x = x;
this.y = y;
}
operator +(other: Vector2D): Vector2D {
return new Vector2D(this.x + other.x, this.y + other.y);
}
operator *(scalar: float): Vector2D {
return new Vector2D(this.x * scalar, this.y * scalar);
}
operator ==(other: Vector2D): bool {
return this.x == other.x && this.y == other.y;
}
operator [](index: int): float {
if (index == 0) return this.x;
if (index == 1) return this.y;
throw "Index out of bounds";
}
}
let a = new Vector2D(1.0, 2.0);
let b = new Vector2D(3.0, 4.0);
let c = a + b; // Vector2D(4.0, 6.0)
let d = a * 2.0; // Vector2D(2.0, 4.0)
print(c[0]); // 4.0Overloadable Operators:
| Category | Operators |
|---|---|
| Arithmetic | +, -, *, /, %, @ (matrix mul) |
| Comparison | ==, !=, <, >, <=, >= |
| Subscript | [] (get), []= (set) |
| Call | () (callable objects) |
| Unary | - (negate), ! (not) |
Optimized closure representation with escape analysis.
Improvements:
- Compiler detects if a closure escapes its defining scope
- Non-escaping closures allocated on the stack (zero-cost)
- Escaping closures heap-allocated with GC tracking
- Upvalue deduplication for shared captured variables
- Result: 3-5x performance improvement for functional programming patterns
Opinionated code formatter — one style to rule them all.
# Format a single file
prox fmt app.prox
# Format entire project
prox fmt .
# Check formatting without modifying
prox fmt --check .
# Configuration (.proxfmt.pxcf)Configuration (.proxfmt.pxcf):
formatter {
indent: "spaces"
indent_size: 4
max_line_length: 100
brace_style: "k&r"
trailing_comma: true
sort_imports: true
}Developer-friendly error reporting with suggestions.
error[E0412]: Undefined variable 'naem'
--> src/main.prox:15:12
|
15 | print(naem);
| ^^^^ not found in this scope
|
= help: Did you mean 'name'?
= note: 'name' is defined at line 10
error[E0308]: Type mismatch
--> src/math.prox:22:16
|
22 | return "42";
| ^^^^
| expected 'int', found 'string'
|
= help: Use to_int("42") to convert
| ID | Description | Component |
|---|---|---|
| BUG-501 | Fix Wasm stack overflow on deep recursion | Wasm backend |
| BUG-502 | Fix template literal escaping for \${ |
Lexer |
| BUG-503 | Fix operator overload resolution with inheritance | Type Checker |
| BUG-504 | Fix closure upvalue capture of loop variables | Compiler |
| BUG-505 | Fix formatter mangling multi-line string literals | prox fmt |
- Wasm binary size: < 500KB for hello world
- Wasm execution: Within 2x of native performance
- Closure (non-escaping): Zero allocation overhead
- Formatter: Process 10,000 LOC in < 500ms
- Backtick (
`) now reserved for template literals operatorkeyword now reserved
ProXPL v1.7.0 — From server to browser, one language everywhere.