Skip to content

Get started

What, and why is Keel ?

Warning

Keel is experimental and under active development (this documentation too). Little is set in stone.

Keel is a fast, statically-typed interpreted language that aims to combine Rust-like syntax with Python's ease-of-use.

Its goal is to provide a (much) faster alternative to Python that sits closer to low-level languages while remaining accessible to a wide audience. In other words, you should like Keel whether you're a seasoned Rust developer or you've barely touched Python and are completely new to programming.

Keel's main selling points are:

  • ~10x faster than Python, competitive with LuaJIT (-joff)
  • Statically typed, with full type inference and optional annotations
  • FFI support, and the ability to call C/dynamic libraries directly from Keel with a native/easy syntax. FFI call overhead is ~3.5x lower than LuaJIT (-joff).
  • Embeddable in other programs through a C ABI.

The goal of this documentation / tutorial is to show Keel's syntax and how it works by example more than by theory.

Installation

You can install Keel manually by downloading the desired version from the releases page, or use one of the following installation commands.

On macOS / Linux

Keel provides a macOS / Linux installer, which you can use to download and install Keel by running the following command in your terminal:
curl -fsSL https://raw.githubusercontent.com/horacehoff/keel/main/install.sh | sh

This will install the latest Keel version in Library/Keel on macOS, and in /usr/local/lib/keel/ on Linux.

On Windows

Run the following command in a PowerShell terminal. Administrator privileges are not required to run this command or the installation script.

irm https://raw.githubusercontent.com/horacehoff/keel/main/install.ps1 | iex

This will install the latest Keel version for the current user in AppData\Local.

Usage

Once installed, you can use the keel command like any other:

  • To run the REPL, run: keel
  • To run a .kl file 1, run: keel file.kl
  • To display Keel's current version, run: keel -v or keel --version
  • To display the available commands, run: keel -h or keel --help

Keel also has a VS Code extension that provides syntax highlighting.

Benchmarks

Keel benchmarks


  1. Keel files have the .kl file extension. ↩