Lex

TypeScript syntax. Native performance. AI-first. The language for building intelligent applications.

curl -fsSL https://lex-lang.org/install.sh | sh

Why Lex?

TypeScript Syntax

Write code that feels familiar. Classes, interfaces, generics, arrow functions — all the ergonomics you love.

Native Performance

Compiles directly to LLVM IR. No garbage collector, no runtime overhead. Real integers, real threads.

AI-Native

Built-in support for AI agents, tools, and LLM integration. Create intelligent applications with zero boilerplate.

MCP Protocol

First-class support for Model Context Protocol. Build MCP servers that work with Claude, Cursor, and more.

Single Binary

Your entire application compiles to one executable. No dependencies, no containers, no deployment complexity.

Cross-Platform

Target macOS, Linux, Windows, and WebAssembly from the same codebase. Write once, run everywhere.

See it in action

Hello World
// hello.lex
fn main(): i32 {
    Terminal.log("Hello, Lex!")
    return 0
}
AI Agent
import { Agent, agent } from "std/agent"
import { Claude } from "std/ai/claude"

const assistant = agent("code-helper")
    .withModel(Claude.sonnet())
    .withTools(createFileSystemTools())
    .build()

const result = assistant.run("Review my code")
HTTP Server
---
// pages/Ola.lsx — a requisicao e nativa do formato
const nome: string = Lex.params.get("nome")
if (len(nome) == 0) { Lex.notFound() }
---
<h1>Ola, {nome}!</h1>

Ready to build?

Get started with Lex in under a minute.