Development environment setup
Install Swirl
The first thing you'll need to do is to install Swirl. If you haven't done it already follow the installation guide.
Install a C++ compiler
Swirl compiles your code to C++. So you'll need a C++ compiler to convert it to binary. You can follow the install C++ compiler guide to install a C++ compiler on your system.
Code Editor
To write Swirl code, you'll need an IDE (Integrated Development Environment) or text editor. There are many options available, including Visual Studio Code (VSCode), Sublime Text, Atom, and IntelliJ IDEA.
We officially support Swirl in VSCode with our Swirl extension, which provides syntax highlighting and auto-completion. We highly recommend using VSCode with the Swirl extension for the best development experience.
Set up VSCode
Here are the steps to set up Visual Studio Code:
- Install the Swirl extension for Visual Studio Code.
- Restart Visual Studio Code.
- Open a new file and save it with the .sw or .swirl extension.
- Write your Swirl code in the file.
- Compile and run the file using the Integrated terminal
Start writing in Swirl
Congratulations! You've set up your development environment and you're ready to start writing Swirl code. Open your IDE or text editor and create a new Swirl file. Write your code, save it, and run it using the steps provided