Nex

A multi-paradigm, specification-first language for designing software in the age of AI.

Get started Take the tour Version 0.7.2 ยท runs on the JVM

Why Nex?

Focused

A small set of keywords, and code blocks that read like sentences. Classes, generics and first-class functions fit together in one compact design. Despite being rich and expressive, the whole language is small enough to fit in your head.

The whole syntax โ†’

Design by Contract

The specification is part of the code, and the runtime checks it on every call. Design and code can't quietly drift apart, as they often do in fast-evolving production software, and a failure names the exact contract that broke.

Why contracts โ†’

Made for AI

AI tools now write code faster than anyone can read it, so you need a boundary you can check. In Nex, that boundary is the contract: it tells a model what to build, and the runtime checks that what it built keeps its promises.

When code is cheap, design the promises โ†’

Runs on the JVM

Nex compiles to JVM bytecode. Ship your program as a single jar that runs on any machine with Java, with no Nex install needed there. Any Java library is one import away.

Java interop โ†’

Learn Nex

Get started

bash <(curl -fsSL https://raw.githubusercontent.com/vijaymathew/nex/main/bootstrap-install.sh) jvm --install-deps

Installs Nex system-wide, and Java too if it's missing, so it asks for your administrator password.

Then run nex to open the REPL. Other options and troubleshooting are in the install guide.

Editor support: VS Code, Emacs, and any editor with LSP through nex lsp.