Installing Spade

So far, the code we have written has been simple enough that it can all be written in the playground. But as we move on to more advanced language features and bigger projects, it is time to install Spade and its build system called Swim, and to set up your editor.

Shown here is the recommended way to install Spade, but there are a some other options available if you have specific needs.

Linux

Mac OS

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.

Set Up Your Editor

There are a variety of third-party plugins integrating Spade with different editors. For in-editor error messages and things like go to definition, you have to install the spade language server. You can do this by running:

cargo install --git https://gitlab.com/spade-lang/spade spade-language-server 

Vim / NeoVim

If you use Neovim, you can install spade.nvim, which is maintained by Ethan at that GitHub repository. This plugin sets up syntax highlighting and the language server automatically, along with some other quality-of-life features.

Otherwise, you can use spade-vim, following the instructions at that repository for manual setup.

Vscode

Install the plugin from the Marketplace.

Helix

The Helix Editor supports Spade out of the box.

Zed

The Zed Editor supports Spade via this extension.

Emacs

There is an Emacs Mode for Spade.

Other Editors

Made a plugin for your favorite editor? Submit a merge request to add it to this list!


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