How to Use the Compiler / "Dear Windows User"


Dear Windows User,

I strongly suggest you install WSL (Windows Subsystem for Linux) on your machine to use Friendly Persuasion. You can do this by running Command Prompt as an administrator and typing the following command:

wsl --install

After which, restart your computer. Enter command prompt and type:

wsl

Then, you can follow the same install instructions as a GNU/Linux user. Here is a video of me starting up and running WSL to use Friendly Persuasion.

How to Use the Compiler

Video

Now that you've downloaded the compiler on your device, alongside the Shell script, you can get to executing your Friendly Persuasion programs. Unzip the downloaded zip file. This text assumes you unzipped the file in your downloads folder. Open Terminal and enter the following commands:

cd Downloads/friendlypersuasion

gcc fpc.c -o fpc

gcc fpt.c -o fpt

Now, the compiler is all ready to be used. Let's say you want to execute a file named test.fp. Here's what you would enter into the terminal:

./compile.sh test

That's all. The compile.sh file automatically tokenizes, transpiles, compiles, and runs the script. Entering test.fp would cause an error, unless of course your file name is test.fp.fp.

You only have to use GCC on fpc.c and fpt.c the first time you set up Friendly Persuasion. Every time afterward, you can run ./compile.sh immediately without any prior command.

Your new file will also be saved as an executable. As per the above examples, you could run ./test to execute without having to compile again.

If you use MacOS

Don't worry. MacOS also has a UNIX shell. Simply follow the same directions as GNU/Linux from your terminal. You may have to install GCC, but as soon as you try to run it you'll get an install popup regardless. Just install GCC from there, and you'll be golden!