The VibeLang specification
This specification defines VibeLang as the accepted VibeLang Improvement Proposals (VIPs) and their public amendments define it, and nothing more. Each VIP lives in docs/design/vips/, with the reasons for the decision and its history. Where this text and an accepted VIP or its public amendment disagree, the VIP wins and this text is the bug. Authorized clarifications are recorded in public amendments to the relevant VIP and its affected chapter, with the applicable pinned references and explicit reconciliation notes. Where a VIP is silent, its TypeScript or pinned TC39 counterpart applies.
Declaration serialization has one explicit exception for cyclic inferred types; ordinary TypeScript recursion checking still applies.
The previous specification and its decision log are in docs/design/history/. They are historical and not normative: nothing in them is part of the language unless a VIP adds it. The archived decision numbers and diagnostic registry describe the pre-VIP design. Decision notes record reversals within that archive. For current behavior, use the accepted or denied VIP and Appendix B, where some diagnostic numbers have different meanings. Every pre-VIP form no VIP adds is retired: the compiler rejects it with a clear error, and the release notes list it. Data-type methods such as x.map on Option and Stream are among them. The migration sections of Tooling, whose titles name a migration or a legacy form, and Appendix B's transitional diagnostics describe manual source changes and specify the interim diagnostics the toolchain reports during the upgrade.
Principles
VibeLang is TypeScript with a small set of constructs for writing Effect programs. Four principles decide every rule.
- Syntax decides. A keyword on a function, a block or an expression decides what it means. A function literal never becomes an Effect because a parameter expects one, and a type never decides whether a loop consumes a Stream (VIP-1, VIP-2, VIP-20). Class patterns follow their separate dispatch rules, including static call and construct signatures (VIP-7, amended).
- Exact sugar for Effect. Every construct means one specific piece of Effect TypeScript, shown beside it in this specification. Compiled code gives the same
Exitas that Effect TypeScript, with finalizers in the same order (VIP-31). Failures, defects, interruption andCausecombination follow Effect. VIP-7 adds exhaustiveness checking and generated error matchers to TC39 matching, and retains compiler fixed checks for Effect'sOption,Exit,Resultand tagged errors until Effect ships custom matchers; none patches Effect at runtime. The retained tagged-error checks use resolved constructor bindings (aliases included, shadowing excluded) and each module's own guard (including subpath errors:HttpClientError.HttpClientErrorusesHttpClientError.isHttpClientError; VIP-7, amended), notinstanceofor a bare_tagtest, as listed in Retained fixed patterns. - No ambiguity. Every new keyword has exactly one reading. The new keywords are contextual, except
forkandjoin, which are reserved words in effect code exactly asawaitis in anasyncfunction (the grammar's Effect parameter; VIP-17, amended). The expression forms oftryandcatchreuse words already reserved by JavaScript. "A little bit of ambiguity is unacceptable" (VIP-8). A proposal that can't meet that bar is denied (VIP-8, VIP-10, VIP-11, VIP-24). - TypeScript's meaning outside Effect code. Plain functions,
asyncfunctions,await,throw,using, classes,doexpressions and the pipe operator keep their TypeScript or pinned TC39 meaning. The contextual-keyword rules apply throughout.vibe, including plain code; a TypeScript statement beginning with one of those identifiers can therefore parse differently.throwis the exception: in aneffectbody it means typed failure throughEffect.fail, and in other synchronous VibeLang code it is a compile error, because plain functions never throw (Failures). Thrown types exist only for callables imported from TypeScript, JavaScript or amodulebody. Legacy JavaScript restrictions also apply throughout.vibe, including plain functions (VIP-1, VIP-4, amended). Platform restrictions apply throughout.vibe, including plain functions and wrapper arrows (VIP-33).
The language at a glance
| Construct | Means exactly | VIP | Chapter |
|---|---|---|---|
effect function f() { }, effect function (x) { } (an expression), effect () => …, effect m() { } (a method) | a function returning Effect.gen(function* () { … }) | 1 | Functions |
A!E!R | Effect.Effect<A, E, R> | 3 | Functions |
try e (unary, with the precedence of await) | yield* e | 5 | Running Effects |
e catch (err) => y, e catch effect (err) => … | yield* Effect.catch(e, …) | 5 | Running Effects |
effect { … } | Effect.gen(function* () { … }) | 2 | Running Effects |
fork e, fork.in(s) e, fork.scoped e, fork.detached e, join f | Effect.forkChild, forkIn, forkScoped, forkDetach, Fiber.join | 17 | Running Effects |
try.all [ … ], try.race, try.any, try.allSettled | Effect.all(…, { concurrency: "unbounded" }), raceAllFirst, raceAll, … | 18 | Running Effects |
for concurrent (const x of xs) { } | Effect.forEach(xs, …, { concurrency, discard: true }) | 19 | Running Effects |
for try (const x of stream) { } | Stream.runForEachWhile | 20 | Running Effects |
effect function* p() { yield x } | Stream.callback | 21 | Running Effects |
uninterruptible { restore { } }, interruptible { } | Effect.uninterruptibleMask, Effect.interruptible | 22 | Running Effects |
throw e in an effect function | return yield* Effect.fail(e) | 4 | Failures |
error E { fields } | class E extends Data.TaggedError("E")<…> {} | 13 | Failures |
schema error E { fields } | class E extends Schema.TaggedError<E>()("E", { … }) {} | 29 | Failures |
match (x) { when P: …; } | TC39 pattern matching, plus an exhaustiveness check, generated error matchers and fixed Effect pattern checks | 7 | Pattern matching |
service S { members } | class S extends Context.Service<S, { … }>()("key") {} | 9 | Services |
provide L, K = v { … } | yield* Effect.provide(Effect.gen(…), [L, Layer.succeed(K, v)]) | 12 | Services |
retry, sleep, Schema, Layer, … | Effect's exports and modules, in scope without an import | 6, 14, 33 | Services |
task T { effect call(…) … }, workflow W { effect call(…) … } | durable step and derived workflow plan, with the experimental opt-in | 55, 58 | Services |
schema S { fields } | const S = Schema.Struct({ … }); type S = typeof S.Type | 15 | Data |
data D { V; W { f: T } } | Data.TaggedEnum and Data.taggedEnum | 16, 28 | Data |
x.vibex | a .vibe file read with .tsx's JSX language variant | 39 | Configuration and tooling |
module name { … }, import { a } from name | a sibling .ts file and import { a } from "./name.ts" | 40 | Modules and the top level |
The table abbreviates the full translations: preserve source function bindings, dispatch outward jumps after provide and interruption blocks, and add the custom matcher to error classes. All Effect TypeScript meanings use the pinned effect 4.1.1.
Classes without an own Symbol.customMatcher use instanceof, built-ins use Array.isArray or instanceof, and primitives test typeof too, because compiled JavaScript can't read the pinned draft's engine slots. Class patterns gives the full rule.
What VibeLang leaves out is just as deliberate. The appendix lists the denied VIPs: no Effect meaning for using, no Users.find(id) shorthand, no trailing blocks, no wire. The VIP index records the current status of denied and open proposals, including the denial of handlers and the declaration manifest.
How to read this specification
Each form has its syntax, the exact Effect TypeScript it means, and its diagnostics. Anything TypeScript or the pinned TC39 proposal already defines (evaluation order, binding, types, modules, resolution, declaration emit) is as in TypeScript and is not restated. Constructs generally have four parts; the type shorthand keeps its static rule under Meaning:
- Syntax, as links to the productions of Appendix A, with prose and examples. Accepted forms still awaiting compiler support use their linked VIP as the grammar reference.
- Static rules, with the diagnostic each rule reports and its code in Appendix B. VIP-34 requires every diagnostic to have a code; each imported Effect language-service rule prints a stable
EK38xxcode (VIP-38, amended). - Meaning, as the exact Effect TypeScript the construct equals, beside the VibeLang.
- Examples.
A detail that no accepted VIP, public amendment, or TypeScript or pinned TC39 counterpart decides is marked Undecided (pending VIP). Such details are not part of the language until decided.
Examples are pending
The compiler is being changed to match the VIPs. Until it does, a VibeLang example it does not yet pass starts with a // compiler-gap: pending VIP-N line, which the snippet checker (docs/tools/check-snippets.ts) reports as a known gap rather than a failure. An Effect TypeScript comparison that needs undeclared helpers is marked // fragment, for example when it calls fetchUser without declaring it. Complete comparisons omit that marker and can be checked as self-contained programs. Appendix D says how to flip an example once its VIP is implemented.
Chapters
- Functions and Effect types: VIP-1, VIP-3, VIP-4 (legacy JavaScript), VIP-26, VIP-27, VIP-40.
- Running Effects: VIP-5, VIP-2, VIP-17 to VIP-23.
- Failures: VIP-4, VIP-13, VIP-29, VIP-41.
- Pattern matching: VIP-7.
- Services and the environment: VIP-9, VIP-12, VIP-6, VIP-14, VIP-33, VIP-55 to VIP-58.
- Data: VIP-15, VIP-16, VIP-28, VIP-44 (schema mapping).
- Configuration and tooling: VIP-30, VIP-32, VIP-34, VIP-38, VIP-39, VIP-59.
- Runtime guarantees: VIP-31.
- Appendices: the grammar, the diagnostics, the denied and open VIPs, flipping pending examples, and theorems and proofs.
Acceptance and release support
A VIP joins the specification when the maintainer accepts it under the acceptance rules. The supported core of alpha 0.0.13 covers the 33 accepted VIPs numbered 1 to 41. Of VIP-44, the alpha supports its schema mappings as an amendment to VIP-15. VIP-43's theorems and proofs and VIP-44's broader durable-value rules sit outside the supported core.
VIPs 55 through 73 were accepted on 2026-11-23. Chapter 5 describes the experimental task and workflow syntax (VIP-55), its capability metadata (VIP-58), and the status of durable waits and worker imports (VIPs 56 and 57). Chapter 7 records the accepted eval tooling (VIP-59). Implemented compiler features in this set can require the experimental opt-in during alpha rollout. The individual VIPs give the accepted rules and implementation status.
VIPs 60 through 73 add standard-library APIs and conventions. They leave the language and compiler unchanged. See the library inventory for the modules and current status.
Retired continuation forms
The first-release retirement diagnostics are EK3501 for control and handle syntax or resolved continuation-runtime Control, resume, resumeWith, abandon and handle, and EK4607 for a retired select block. VIP-35 is denied. Ordinary TypeScript bindings, callback parameters and members with these names keep their native meaning. Parser recovery only diagnoses and migrates old source.
As for every relic, migrate consumers before enforcing rejection.