Installation
Right now, the best way to get Swirl is to build it from source.
Prerequisites
Before you start, make sure you have the following tools installed:
- Git
- C++ compiler with C++23 support (e.g.,
g++orclang++ormsvc) - CMake (version 3.20 or newer)
- LLVM Development libraries (version 17 or newer)
Linux
- Ubuntu
- Fedora
- Arch Linux
First, update your packages:
sudo apt update && sudo apt upgrade -y
Then, install the required packages:
sudo apt install git cmake clang llvm-dev liblld-dev
First, update your packages:
sudo dnf update -y
Then, install the required packages:
sudo dnf install git cmake clang llvm-devel lld-devel
First, update your packages:
sudo pacman -Syu
Then, install the required packages:
sudo pacman -S git cmake clang llvm lld
Windows
-
First download MSYS from msys2.org.
-
Open the CLANG64 shell.
-
Update packages:
pacman -Syu -
Install the required packages:
pacman -S mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-toolchain- It will install cmake, clang, llvm dev libs, git, make etc.
-
Set up the environment variables: Add the following line to your path environment variable in windows settings
C:\msys64\clang64\binHere's a guide for that.
Your system should now be set up to build Swirl.
Building
First clone the repository and navigate into it:
git clone https://github.com/swirllang/swirl.git
cd swirl
Generate the build files:
cmake -B build -S .
Build the project:
cmake --build build --config Release
The Swirl binary will be in the build directory.
Running
To run Swirl, you can use the following command:
./build/swirl
Dev setup
To get the best experience building Swirl, we recommend using Visual Studio Code with the following extensions: