Skip to content

Quick Start Guide

ProLeopard edited this page Dec 4, 2020 · 2 revisions

Let's get your environment set up! This quick start guide expects that you have installed WSL (Windows Subsystem for Linux) on your machine. This tutorial is also targeted towards VSCode users, as there are some minor issues associated with VSCode and Rust. However, other IDEs and text editors (IntelliJ, Sublime, etc) can also be used.

First, open WSL and type the following code:

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

Then, follow the instructions in WSL to complete the installation of Rust. With this, Cargo, Rust's package manager, should also be installed.

When the installation is complete, restart WSL. Now, you will be able to check if everything is correctly installed by typing:

cargo --version.

Now that Rust and Cargo are installed, we can get the Lavender code from GitHub and save it in a directory of our choice.

Before we can write code in Lavender, we must create a build by typing cargo build after navigating to the directory where Lavender is saved.

Here, to see the code in VSCode, we can type code . in WSL, which will open VSCode, install the VSCode Remote Extension if it hasn't been installed already, and then open the Lavender folder in VSCode.

To run code in Lavender, simply type

cargo run '[some expression]'

There are some known issues with VSCode involving the Remote Extension. Due to the way Rust interacts with the VSCode Remote Extension, you may receive a permission error when building the program. The simple workaround is to not open VSCode before doing cargo build for the first time. If you open VSCode after that, and then rebuild, then you will still receive the error but it will not affect operation.

However, there is also a proper fix. It is detailed here: https://code.visualstudio.com/docs/remote/wsl#_i-see-eaccess-permission-denied-error-trying-to-rename-a-folder-in-the-open-workspace-in-wsl-1

Clone this wiki locally