ludic/selfhost/backend
Orkuncakilkaya 0d1b09e4f0
All checks were successful
bootstrap / cfree-fixpoint (push) Successful in 17s
ci / build-and-test (push) Successful in 1m14s
commit-lint / conventional-commits (push) Successful in 3s
docs / build-and-deploy (push) Successful in 19s
feat(errors): recoverable failures as values — try/else over ok/err results (#46)
A fallible function returns a `result` value, built with ok(payload) on success
or err(message) on failure. The caller recovers a value with `try EXPR else {
… }`: on ok the whole expression is the payload; on err the else block runs —
with the failure message bound to `error` — and its trailing expression supplies
the fallback. It is a plain branch on the result's tag: no exceptions, no hidden
control flow, nothing unwinds. is_ok(r) / is_err(r) classify without unwrapping.

Payloads are any i32-width scalar (int/fixed/bool/entity). The feature is
additive and only kicks in when ok/err/try are used, so untouched programs
compile byte-identically (verified) and the C-free bootstrap fixpoint holds.
Complements panic/assert from #8 (the unrecoverable half). The optional
top-level frame `recover` stays deferred (needs a frame-abort mechanism); the
full tagged-union/any generalization is tracked in #1.

Adds the `try` keyword and ok/err/is_ok/is_err builtins across the compiler,
the vocabulary header, JetBrains + TextMate/VSCode grammars, the docs inventory
and pages, examples/library/recover.ludic, and a regression case.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-31 15:04:14 +03:00
..
game feat(types): add Reflect.* — runtime reflection over the world schema (#20) 2026-08-31 13:28:51 +03:00
stdlib feat(stdlib): add Anim.* + Tween.* — deterministic 2D animation & tweening (#5) 2026-08-31 13:05:06 +03:00
emit_addr.ludic refactor(selfhost): reorganise into concern-based subdirectories 2026-08-31 00:26:02 +03:00
emit_call.ludic feat(errors): recoverable failures as values — try/else over ok/err results (#46) 2026-08-31 15:04:14 +03:00
emit_core.ludic feat(errors): recoverable failures as values — try/else over ok/err results (#46) 2026-08-31 15:04:14 +03:00
emit_decl.ludic feat(errors): recoverable failures as values — try/else over ok/err results (#46) 2026-08-31 15:04:14 +03:00
emit_expr.ludic feat(errors): recoverable failures as values — try/else over ok/err results (#46) 2026-08-31 15:04:14 +03:00
emit_head.ludic refactor(selfhost): reorganise into concern-based subdirectories 2026-08-31 00:26:02 +03:00
emit_intrin.ludic refactor(selfhost): reorganise into concern-based subdirectories 2026-08-31 00:26:02 +03:00
emit_intrin2.ludic refactor(selfhost): reorganise into concern-based subdirectories 2026-08-31 00:26:02 +03:00
emit_mem.ludic refactor(selfhost): reorganise into concern-based subdirectories 2026-08-31 00:26:02 +03:00
emit_new.ludic feat(lang): new Type { field: value } record initialisers 2026-08-31 01:20:06 +03:00
emit_stmt.ludic feat(testing): line coverage via --coverage + bin/x test --coverage (#45) 2026-08-31 14:51:14 +03:00