Skip to content
Jose Luis Vivero edited this page Dec 12, 2016 · 10 revisions

How to build

Ubuntu

First off, clone our compiler into your local repository by running the following command:

git clone https://github.com/rattlesnake-pit/compiler.git

if you prefer to download and unzip the compiler just download it using this link: https://github.com/rattlesnake-pit/compiler/archive/master.zip

Make sure you have gcc installed in your computer, if not then run the following command:

sudo apt-get install build-essential

This will install gcc and other useful tools necessary to compile programs.

Once you finished, just run make on the terminal and it will compile the rattlesnake compiler.

How to compile a rattlesnake file

Now that you have your compiler built you can go ahead and make a program using our language. Once you're done with that you should run the compiler to do so run the following command in the terminal:

./compiler bin < filename.rs > output.chop

filename.rs being any program written in rattlesnake, and output.chop the name of the binary file you want, the name of the output file can be anything you want.

For convention's sake, please have the termination be .chop

Alternatively you can compile your program to assembly code and then use our assembler to get the .chop file. By giving the parameter asm to to the compiler as shown:

./compiler asm < filename.rs > output.rice

Again for convention's sake, we recommend using the file extension .rice for all assembly files

Now that you know how to build and run the compiler, go take a look at the basics and learn how to write using the rattlesnake language

Clone this wiki locally