TypeScript superset · Compiles to JavaScript

VexaScript

A modern language built on TypeScript. Concise for humans, efficient for AI — less syntactic noise, same expressive power, full compatibility with the JS/TS ecosystem.

Operator overloading, await-less async, primary-constructor classes, delegated variables, new-less instantiation, and more — without leaving the tools you already use.

hello.vx
class Point(val x: number, val y: number) {
  operator-() => Point(-x, -y)
  operator+(other: Point) => Point(x + other.x, y + other.y)
  operator*(scale: number) => Point(x * scale, y * scale)
  length => Math.hypot(x, y)
}

sync fun loadUser(id: string): User {
  val data = fetch(`/api/users/${id}`).json()
  return User(data.id, data.name)
}

Language features

Familiar syntax, modern ergonomics

VexaScript is a non-strict TypeScript superset. Every valid TypeScript file is a valid VexaScript file. The additions are opt-in and stack on top of each other naturally.

Primary-constructor classes

Declare class members directly in the constructor signature. val for read-only, var for mutable. No boilerplate.

class User(val id: string, var name: string, val score: int = 0)

val u = User("u1", "Alice")
u.name = "Bob"

Operator overloading

Define arithmetic, comparison, and index operators directly on your types. Shorthand arrow syntax keeps definitions terse.

class Vec2(val x: number, val y: number) {
  operator+(b: Vec2) => Vec2(x + b.x, y + b.y)
  operator*(s: number) => Vec2(x * s, y * s)
  length => Math.hypot(x, y)
}

val v = Vec2(1, 0) + Vec2(0, 1) * 3

Await-less async

sync fun automatically awaits any Promise produced inside the body. Write async logic that reads like sync code — no await keywords needed.

sync fun loadBytes(url: string): Uint8Array {
  val res = fetch(url)
  return Uint8Array(res.arrayBuffer())
}

Delegated variables

Kotlin-style by delegates let you attach custom read/write behaviour to any variable. Works with React-style state tuples out of the box.

fun useState(init: number) {
  return [() => init, (v: number) => { init = v }]
}

var count by useState(0)
count++
console.log(count) // 1

Null-aware access

Optional chaining and nullish coalescing are fully supported. Non-null assertions let you opt out of null checks when you know better.

val city = user.address?.city ?? "Unknown"
val label = maybeUser!.name.toUpperCase()

New-less instantiation

Call constructors without new. Classes and built-ins like Map, Set, and Uint8Array work the same way.

val users = Map<string, User>()
val buf = Uint8Array(1024)
val pt = Point(3, 4)

Get started

Install and write your first file in under two minutes

One npm install, one command. The VS Code extension adds a full language-server experience on top.

1

Install the CLI

npm install -g vexascript
2

Run or compile

vexa run hello.vx
vexa build hello.vx -o dist/hello.js

Syntax reference

Everything the language supports, in one place

The full syntax guide covers every construct — variables, functions, classes, types, generics, async patterns, destructuring, and more — rendered directly from the canonical language documentation.

CLI

Compile, run, test, and inspect from the terminal

The vexa CLI bundles the compiler, formatter, test runner, and language server in a single binary. The CLI guide has every command with copy-ready examples.

Embedding API

Live editors inside your own pages

Drop a Monaco-powered VexaScript editor into any documentation page or product demo. The embedding guide has copy-ready setup snippets for both single-editor and full-workbench modes.

Blog

Release notes and project updates

Follow new language features, milestone releases, and ecosystem news from the VexaScript team.