Skip to content
Playground(another site)

v0.163.0

Released on 14 July 2026 as v0.163.0, with the increments from v0.155.0 to v0.163.0. See Upgrading for what to change when you move to it.

Docs (under v0.163, no version change): the enum-spelling convention is now stated — a payloadless sum is canonically written enum { A, B } (the pipe form | A | B is for sums that carry a payload); enum { … } is exactly sugar for the payloadless pipe form, so the two are the same type. This closes the keyword-hygiene batch (#548): no language change (both spellings remain valid), a docs convention only.

VersionHighlights
v0.163.0Three where predicate tiers, taught explicitly; the actor … where grammar matches the compiler (grammar + docs; ADR 0189, addresses the keyword-hygiene batch #548). “One where” actually hosts three predicate sub-grammars, and ADR 0144’s “one predicate surface” describes only one of them. The reference now names all three: (1) type refinement type T = Base where <catalogue> — a closed grammar, the built-in predicate names joined by &&; (2) actor claim actor A = Base where <predicate> — a full expression a static-semantics rule restricts to the closed hasClaim/claimEquals catalogue composed with &&/`
v0.162.0Lexical tightening — a -- comment must be whitespace-preceded; a --- marker always opens a doc-block (lexer + spec; ADR 0188, addresses the keyword-hygiene batch #548). Two underspecified rules, pinned. Comments: -- opens a line comment only at the start of input or when the preceding character is whitespace. Adjacent to a token it is no longer a comment — a--b lexes as a - -b (a subtraction of a negation) and x-- as x followed by two - operators, not a comment that silently swallows the rest of the line. This resolves the a--b “comment or subtraction?” ambiguity toward subtraction; write -- (leading space) for a trailing comment. Breaking (pre-1.0) but empty in practice — no .bynk in the repo wrote a token--comment adjacency. The tree-sitter line_comment stays a context-free approximation (one byte of look-behind can’t live in a token), so an editor may over-highlight the -- in the rare a--b; the compiler lexer is normative and the spec (§3.3.1) says so. Doc-blocks: a --- … --- marker is three or more hyphens alone on a line; there is no standalone --- divider — a lone marker with no close is bynk.lex.unclosed_doc_block, not a horizontal rule (unchanged behaviour, now spec’d in §3.3.2). No grammar, checker, or emitter change.
v0.161.0Protocol source casing — from websocket (was from WebSocket) (grammar + parser + formatter + tooling + docs; ADR 0187, addresses the keyword-hygiene batch #548). The service-header protocol sources were mixed-case: from http / from cron / from queue("…") were lowercase, but the real-time one was PascalCase — from WebSocket(in: I, out: O). It is now lowercase too: from websocket(in: I, out: O). Like the others it is a contextual word (not a reserved keyword — websocket stays a usable identifier elsewhere); in/out and the on open/on message/on close lifecycle words are unchanged. Only the source-header token moved — the emitted TypeScript (the JS WebSocket/WebSocketPair globals) and the Connection[F] surface are untouched, and “WebSocket” stays the proper-noun for the technology in prose. Breaking (pre-1.0): from WebSocket(…) no longer parses — write from websocket(…). Fixtures, examples, the book, the formatter, and the from-completion candidate all migrate. Hover/completion/semantic-tokens track the lowercase spelling (ADR 0156).
v0.160.0One conjunction spelling — refinements join with &&; the and keyword is retired (grammar + parser + formatter + docs; ADR 0186, addresses the keyword-hygiene batch #548). The predicate surface had two conjunction spellings: a refinement used the keyword and (Int where MinLength(3) and MaxLength(20)), while every other predicate — a function requires/ensures, an agent invariant/transition, a test expect, an actor-claim — used the && operator. and in a refinement was never a boolean operator (no `
v0.159.0The test stub gets its own keyword — stub Cap.op(…) (was a third pun on provides) (grammar + AST + parser + emitter + tooling + docs; ADR 0185, addresses the keyword-hygiene batch #548). provides meant three things — a provider declaration (provides Cap = Impl), an external provider (the bodiless form), and a test double (provides Cap.op(_) returns v), the last distinguished only by an interior .op( shape. The test double now has its own keyword: stub Cap.op(<pattern>) returns <value> | fails. provides heads only a provider declaration / external provider; stub is a reserved keyword legal as a suite/case item. Semantics, precedence (case > suite > tier default), argument patterns, and the sequenced returns each […] form are unchanged — only the keyword moved. The four diagnostics are renamed bynk.provides.* → bynk.stub.* (not_a_seam, unknown_op, rhs_type, bad_sequence). Breaking (pre-1.0): a test double written provides Cap.op(…) no longer parses — rename it stub. Fixtures, examples, the testing guide/reference/tutorial, glossary, and grammar are migrated; a stub snippet joins the VS Code extension; hover/completion/semantic-tokens gain the keyword (signature help unchanged — a stub is not a call site).
v0.158.0Map queries expose keys — map.entries/map.keys/map.values (checker + emitter + docs; ADR 0184, closes #547). A Query over a store Map[K, V] used to yield values only, so every keyed collection duplicated its key inside the value record (the todo example’s TodoItem.id was both the map key and a stored field). A store map now roots three key-aware queries: map.keys : Query[K], map.values : Query[V], and map.entries : Query[MapEntry[K, V]]. .entries lifts each entry into a MapEntry[K, V] — a compiler-known nominal record { key: K, value: V }, read with .key/.value. bynk has no tuple/pair (ADR 0120), so an entry is a named record, not (K, V); the whole single-argument query vocabulary (filter/map/sortBy/collect/…) applies to .entries unchanged. MapEntry is a generic-record instantiation and so non-boundary (ADR 0183): a read handler projects each entry into a named type (items.entries.map((e) => Row { id: e.key, … })) before its terminal, which is what lets the stored value drop the denormalised key. A persisted key is a string object-key, so an Int-typed key is decoded back with Number(…) on read. The todo example drops TodoItem.id from its stored shape and rejoins it through .entries. Unknown accessors are bynk.store.unknown_map_accessor; an unknown MapEntry field is bynk.types.unknown_field.
v0.156.0A refined type has no .unsafe — the unchecked escape hatch is opaque-only, in source and in emitted TypeScript (emitter + docs; ADR 0182, closes #545). The review called refined .unsafe “the largest credibility hole in the refinement guarantee”. It turned out Bynk source already rejected Age.unsafe(x) (.unsafe was gated to opaque bodies since v0.62), but the emitted TypeScript exported a public unsafe(value){ return value as T } on every refined and alias type — so hand-written host or adapter code could import the module and brand a value past the predicate, guarded only by the ADR 0014 convention. That emitted constructor was the real reachable hole. It is now removed: a refined or alias type emits only .of; compile-time literal admission lowers to an inline brand cast (literal as T) instead of a constructor call, and generated property-test scaffolding brands a refined draw to any (the type the old call already produced there) — no callable unchecked constructor is exported. Opaque types keep .unsafe (their representation is hidden, so the defining commons needs an in-commons constructor). A refined type’s representation is its base, always built through the validating .of, so an unchecked hatch would only subtract a check. Now no code — Bynk or host TypeScript — can mint a refined value without its predicate running, at run time (.of) or compile time (admission). Breaking at the host boundary (pre-1.0): TypeScript calling RefinedType.unsafe(x) on emitted output no longer compiles — exactly the bypass ADR 0014 forbade. Spec (§6.1.2/§6.4/§5.3/§7.3) and the reference/glossary/operators/guides are corrected; tsc --strict and the property runner pin that emitted output has no refined .unsafe yet still type-checks and runs.
v0.157.0Generic record types — type Paginated[T] = { … } (grammar + checker + emitter + docs; ADR 0183, closes #546). Capabilities abstract effects, but nothing abstracted data shape — the API envelope (Paginated[T], Page[T]) had no expression. A type may now carry [A, B] type parameters when its body is a record; a parameter is an unconstrained, bound-free name resolved as a rigid variable inside the field types. A reference applies concrete arguments (Paginated[User]); field access substitutes them (page.items : List[User]) and construction infers them argument-directed (Paginated { items: users, cursor: None }), grounded by the binding’s expected type when a field can’t (an empty list). Emission is erased TS generics — interface Paginated<T>, references Paginated<User> — exactly as generic functions erase. Only a record body may be generic (bynk.generics.generic_non_record); a wrong argument count is bynk.generics.type_arg_count. In this version a generic record is a non-boundary value: usable for internal values (construction, field access, helper params/returns, locals), but rejected in a serialised position — a record field, sum payload, handler signature, agent store, or Json.encode/decode (bynk.generics.generic_record_at_boundary); a boundary story (monomorphised codecs) and generic sums/methods are deferred. New applied_type_ref grammar rule; hover renders the type parameters.
v0.155.0Service-level by/given defaults; by relocated after the return type (grammar + normalization + emitter + tooling; closes #544). Two edits to the over-dense HTTP handler head. (1) The by clause moves from before the parameter list to after the return type, alongside given: on GET("/x") (page: Page) -> View by v: Visitor — not by v: Visitor (page: Page), which read as a call Visitor(page: Page), the one place the surface fought its own Name(args) rule. A breaking but mechanical relocation (pre-1.0); all in-repo handlers, fixtures, examples, and docs migrate. (2) A service may declare by/given defaults on its header, after the protocol — service api from http by Visitor given Clock { … } — the ambient contract every handler inherits unless it declares its own. “Public / bearer-authed” is usually a service fact, and HTTP has no safe default actor (so by was mandatory on every route); the default states it once. A handler’s own by (or given) overrides the default outright (no merge). Implemented as a post-parse normalization pass that injects each default into the handlers that omit it, so the checker, project validation, and the emitter see canonical handlers and need no default-awareness — the emitted TypeScript is byte-identical to spelling every by/given out. A malformed default is caught whether it is inherited (checked through the injected copies) or fully shadowed (validated directly at the header — the zero-inheritor case), so an unknown default actor/capability never passes silently. The protocol-implied return sugar (-> Int meaning Effect[HttpResult[Int]]) from the same review finding is deferred to a later increment. by/given remain keywords; hover/completion/semantic-tokens/signature-help unchanged (ADR 0156). New positive fixtures cover inheritance + override; negatives cover the rejected old order and a malformed default.