Install Kex

Three commands with Homebrew and you're running the latest release. Prefer Docker or building from source? Those work too.

latest stable: v0.3.3

Homebrew

Recommended

Sets up Tey, which installs and manages Kex versions. macOS and Linux.

shell
brew tap kexhq/tey
brew install kexhq/tey/tey
tey kex install

Docker

Container

No install. Runs Kex in a container you throw away after.

docker
docker run --rm ghcr.io/kexhq/kex:latest kex --version

Need a different version?

The brew install above includes Tey, which swaps Kex versions for you:

shell
tey kex list                 # every version you can get
tey kex install 0.3.0-beta   # get a specific one
tey kex use 0.3.0-beta       # switch to it

tey kex install alone gets you the newest stable release; tey kex install --pre gets pre-releases.

Build from source

For contributors, packagers, or anyone who prefers a self-built binary. Most users should use Homebrew or Docker above.

1

Clone the repo

shell
git clone https://github.com/kexhq/kex.git
cd kex
2

Install dependencies

    brew install cmake gmp pcre2 boost readline
  
3

Build

shell
make build          # produces ./build/kex
4

Run it

shell
make run F=examples/fizzbuzz.kex
make repl                       # drop into the REPL
build/kex examples/vectors_advanced.kex
5

Install the binary (optional)

Copies the built binary and standard library to a path on your PATH. It intentionally does not build as root.

shell
sudo make install              # /usr/local/bin/kex
make install PREFIX=$HOME/.local   # install elsewhere

Make targets

  • make build build the compiler
  • make run F= run a .kex file
  • make repl start the REPL
  • make test C++ unit tests
  • make spec language specs
  • make check F= semantic analysis only
  • make parse parse all examples
  • make clean remove build artifacts