Skip to content

Hello! 👋 My name is Nathan Weir. This is a fun personal project for using AI to build a bespoke, domain-specific programming language. It is not a serious, professional project. This site and the language itself are largely generated via Claude Code. If you find yourself programming with Weir, have fun - but use at your own risk!

Installation

Weir uses Nix with flakes to manage all dependencies. This ensures a reproducible build environment regardless of your system.

Install Nix with flakes enabled. If you don’t have Nix yet:

Terminal window
# Install Nix (multi-user recommended)
sh <(curl -L https://nixos.org/nix/install) --daemon
# Enable flakes (add to ~/.config/nix/nix.conf)
experimental-features = nix-command flakes
Terminal window
git clone <repo-url>
cd weirlang

Activate the development environment:

Terminal window
nix develop

This provides all build tools: Rust toolchain, Cranelift, libffi, pkg-config, and everything else needed to build the compiler.

Build the compiler and run all tests:

Terminal window
just test

You should see all tests pass (currently 647). You can also build the compiler directly:

Terminal window
just build

Run just to see all available recipes:

CommandDescription
just buildBuild all crates
just testRun all tests
just checkRun clippy, check formatting, and run tests
just fmtFormat all code
just run <file>Run a .weir file
just tetrisBuild and run the OpenGL Tetris demo
just docs-devStart docs dev server
just docs-buildBuild docs site

A Zed extension is available at (TODO: Not published yet!) providing:

  • Syntax highlighting via tree-sitter
  • LSP integration (diagnostics, hover, completion, go-to-definition)

The Weir LSP server can be started with:

Terminal window
weir lsp

Any editor with LSP support can connect to it for diagnostics, completion, hover information, and navigation.