A simple programming language, built from scratch in Rust
Check out the language specification in the Wiki!
Note first that soup is designed solely to work on Mac M1 processors.
-
First, ensure you have installed Rust
-
Clone the repository:
$ git clone https://github.com/dylanjtuttle/soup.git
$ cd soup
- Open the file
soup
, a bash script that we will call when we want to compile a soup file, in your favourite text editor.
-
On line 1, replace
#!/opt/homebrew/bin/bash
with#![location/of/shell]
, which you can find by running the following command:$ which bash
-
Create an environment variable
$SOUP_DIR
which holds the path to thesoup
directory you are currently in, and then add it to your path, by adding the following two lines near the end of your~/.bashrc
file:export SOUP_DIR="[/absolute/path/to/soup/dir]" export PATH=$PATH:$SOUP_DIR
- Note that since
~/.bashrc
is executed once every time a terminal window is opened, these two environment variables only take effect once you exit your current terminal window and open a new one.
- Note that since
- Compile the compiler with the following command:
$ cargo build --release
- Create a
.soup
file anywhere on your hard drive, and then compile and run it with the following command:
$ soup [name].soup
Congratulations!!