Native async/await, First-Class Closures, RFC 6455 WebSockets, Real Breakpoint Debugger & HADID Learn
HADID v0.13.0 advances the language into full native concurrency, constrained generic free functions, pure ISO C17 real-time WebSockets, XSS-safe HTML templates, a built-in Debug Adapter Protocol server (hadid dap), 10 official packages, and the interactive HADID Learn academy.
- Bilingual async/await, Task<T>/Gorev<T>, sleep_ms, and await_all backed by a bounded OS worker pool and isolated per-task arenas.
- First-class closures (fn(A): R) with arena-safe read-only value capture: store, pass, and return functions cleanly with zero GC.
- Generic free functions (fn id<T>), where/nerede interface constraints, and fixed-point nested generic monomorphization (Box<Pair<K, V>>, Box<List<T>>).
- Built-in RFC 6455 WebSockets (@ws, ws_send, ws_recv, ws_broadcast, ws_close), auto-XSS HTML templates (html_render), traversal-safe web_static, and pure-C17 crypto (SHA-256, HMAC-SHA256, Base64URL, constant-time compare).
- Real step-through breakpoint debugger (hadid dap) with VS Code F5 integration plus LSP rename, signatureHelp, and semantic tokens.
- Official package ecosystem doubled from 5 to 10 packages: hadid-jwt, hadid-cache, hadid-rate-limit, hadid-webhook, and hadid-logger.
- Interactive HADID Learn academy launched with 3 guided Learning Paths, 12 video + live code lab + quiz lessons.
Architecture & Performance Note
To preserve 100% behavioral equivalence between the interpreter and strict ISO C17 native binaries, every v0.13 capability shares libhadid_rt.a with zero external DLL dependencies. The DAP debugger hooks into statement execution with a zero-overhead null check during normal runs and isolates debuggee stdout from JSON-RPC framing.
interface IMetric { fn label(): string; }
class NodeStat : IMetric {
public readonly id: string;
public NodeStat(id: string) { this.id = id; }
public fn label(): string { return $"node:{this.id}"; }
}
fn tag<T>(item: T): string where T : IMetric { return $"[{item.label()}]"; }
async fn measure(base_ms: i32, scale: fn(i32): i32): i32 {
sleep_ms(5);
return scale(base_ms);
}
let factor = 3;
let mul: fn(i32): i32 = (n: i32): i32 => n * factor;
let t1 = measure(4, mul);
let t2 = measure(6, mul);
let n = new NodeStat("eu-1");
print($"{tag<NodeStat>(n)} total={(await t1) + (await t2)}");