Skip to content

Why VibeLang?

VibeLang is a language for building reliable TypeScript in the AI era, built on Effect. It gives Effect a simple, readable syntax. The compiler turns it into ordinary Effect code that your team can read and ship, and .ts files, npm packages and the rest of the TypeScript ecosystem stay one import away.

This page makes the case in four steps: what Effect adds to TypeScript, what writing it as a library costs, what Effect's own docs say against a language, and what VibeLang costs you.

What Effect adds to TypeScript

A TypeScript function signature tells you what comes back when things go right. It is silent about what can fail and what dependencies the function secretly reads.

Effect puts all three into one compiler-checked type — Effect<Success, Error, Requirements> — and ships one integrated library around it: typed errors, dependency injection, retries, timeouts, structured concurrency, resource cleanup, schemas, and tracing. Effect makes that full case in Why Effect?.

What writing it as a library costs

Because Effect is a library, it builds every construct out of existing TypeScript syntax: generators and yield* to sequence work, pipe to wire combinators, and boilerplate class declarations for errors and services.

Here is a function that looks up a user's name, falls back to "guest", and depends on a Users service — first in Effect TypeScript, then in VibeLang:

error NotFound { id: string }
 
service Users {
  static readonly key = "app/Users"
  name(id: string): string!NotFound
}
 
effect function greet(id: string): string!!Users {
  const users = try Users
  const name = users.name(id) catch () => "guest"
  return `Hello, ${name}`
}

Every VibeLang form is exact sugar for the Effect code beside it:

VibeLangCompiles to
error NotFound { id: string }class NotFound extends Data.TaggedError("NotFound")<{ readonly id: string }> {}
service Users { ... }class Users extends Context.Service<Users, { ... }>()(...) {}
effect function greet(id)Effect.gen(function* () { ... })
try expryield* expr
expr catch () => "guest"yield* expr.pipe(Effect.orElseSucceed(() => "guest"))
string!!UsersEffect.Effect<string, never, Users>

Leave off the return annotation and the compiler infers all three channels from the body. Supply the service with a layer and a provide block:

const UsersLive = Layer.succeed(Users, {
  effect name(id: string) {
    if (id !== "42") throw new NotFound({ id })
    return "Ada"
  }
})
 
effect function main() {
  provide UsersLive {
    try Console.log(try greet("42"))
    try Console.log(try greet("7"))
  }
}
// Run in an effect function: try main()
// Output: Hello, Ada
// Output: Hello, guest

See the cheat sheet for every form side by side, and A real provider, before and after for a real production module in both languages.

Effect's answer: it should not be a language

Effect's documentation lists "Effect should be a language or use a different language" among its myths about Effect:

Neither solve the issue of writing production grade software in TypeScript. TypeScript is an amazing language to write full stack code with deep roots in the JS ecosystem and wide compatibility of tools, it is an industrial language adopted by many large scale companies.

The argument is sound: leaving TypeScript means forfeiting its compiler, type system, packages, editors, build tools, and talent pool. History backs it up too — Effect's own TypeScript fork, TS+, was abandoned because changing .ts semantics split the ecosystem and broke build tools on every upgrade.

VibeLang accepts that premise and builds inside it.

VibeLang compiles .vibe and .ts files in one program without leaving TypeScript or EffectVibeLang compiles .vibe and .ts files in one program without leaving TypeScript or Effect
VibeLang compiles .vibe and .ts files in one program without leaving TypeScript or Effect
  • It does not leave TypeScript. The compiler forks the TypeScript 7 compiler. It typechecks .vibe and .ts files in one program and emits JavaScript plus a .d.vibe.ts declaration beside each .vibe file. Unmarked .ts files keep TypeScript's semantics; the experimental directive below is an explicit opt-in.
  • It does not leave Effect. Output runs directly on effect and vibelang-runtime. try compiles to the yield* the myths page praises. To any TypeScript caller, a VibeLang function is an ordinary Effect function.
  • It does not leave the ecosystem. A .ts file sits beside any .vibe file and the two import each other. npm packages install normally. Vite and Vitest compile .vibe via vibelang-vite; webpack, Rspack, Rollup, Rolldown, esbuild, and Bun use vibelang-unplugin; editors run the compiler as a language server.
  • Only the surface changes. VibeLang replaces the Effect boilerplate — generators, yield*, pipe, and verbose class headers — with statements, while keeping the types, runtime, library, and ecosystem intact.

Effect's own Using Generators guide contrasts two styles for writing Effect programs: pipelines and generators. VibeLang is a third: plain statements.

What VibeLang costs

Be clear-eyed about the tradeoffs before adopting an alpha language:

  • A syntax to learn. Your team reads and reviews .vibe files. The cheat sheet covers the entire surface on one page.
  • A compiler in the toolchain. vibelang checks .vibe files. Stock tsc reads only the .d.vibe.ts declarations the compiler emits. Bundlers, test runners, and editors need the plugin or language server (Set up VibeLang).
  • Alpha status. VibeLang is v0. Breaking changes happen frequently; track them in the release notes.
  • Effect 4.1+ compatibility. Compiled output targets stable effect@^4.1.0 (tested on 4.1.6) through public Effect 4 APIs and rejects 3.x, 4.0.x, 5.x, and prereleases (EK3201).
  • Platform rehearsal. Native binaries ship for macOS, Linux, and Windows on arm64 and x64, with full release rehearsal running on Linux x64 (Installation).

If your team cannot take an alpha compiler yet, write Effect TypeScript. Because the two interoperate seamlessly, you can try VibeLang in a single file of an existing Effect project and remove it just as easily (Existing project).

After the CLI, plugins, and editor support, the experimental TypeScript shim is a last resort for projects that cannot rename .ts files. Its directive does not make stock TypeScript readers safe, because a file can compile under different prelude bindings.

Next

Welcome walks through a complete program. Continue the Learning Path with The Effect Type and Creating Effects.


The matching Effect page: effect.website/docs/v4/getting-started/why-effect