Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Installation

Before installing locally, there is a “playground” available at ▶️ https://play.spade-lang.org which you can use to play around with the language. The first few chapters of the book use that, so if you want to follow along with the tutorial, you can skip this chapter until prompted to install Spade locally.

Recommended flow

Linux

  • First, if you don’t have Rust installed already, install it via the rustup installer by simply running:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

    and accepting the default options when prompted.

  • Restart your terminal to get access to the new binaries this installed.

  • If you are on a fresh Linux or WSL install, you have to install a few packages for the next step:

    sudo apt install build-essential libssl-dev pkg-config git

    (Or equivalent packages on the distribution of your choice.)

  • Install the Spade build tool called swim with:

    cargo install --git https://gitlab.com/spade-lang/swim
  • Install some additional tools1 that Swim needs with:

    swim install-tools

Mac OS

  • First, if you don’t have Rust installed already, install it via the rustup installer by simply running:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

    and accepting the default options when prompted.

  • Restart your terminal to get access to the new binaries this installed.

  • Install the Spade build tool called swim with:

    cargo install --git https://gitlab.com/spade-lang/swim
  • Install some additional tools1 that Swim needs with:

    swim install-tools

Windows

The Swim build tool currently does not natively support Windows, so you have to do the rest of the tutorial inside the Windows Subsystem for Linux (WSL). If you have not installed it yet, do so by following the instructions.

Once done, open a WSL shell by just typing wsl in cmd, and then follow the Linux instructions above.

Next steps

Now, move on to [setting up your editor](./editor-setup.md) to work with Spade.

Other ways to install

With a package manager

If you are on Arch Linux, you can install the swim-git package from the aur https://aur.archlinux.org/packages/swim-git

Using Docker

The Spade Docker image, has all the necessary tooling and environment preconfigured.

For example, here’s how you would start an interactive shell where commands like swim are available:

docker run -it --rm ghcr.io/ethanuppal/spade-docker:latest

Make sure you have the Docker (or podman) daemon running in the background. Do note that the image only supports x86_64 and arm64.

You should now be able to create a swim project using swim init hello_world!

  1. 1The OSS CAD Suite which needs about 2.5 GB of disk space.