6 stable releases
2.0.4 | Aug 1, 2022 |
---|---|
2.0.0 | Jul 27, 2022 |
1.2.0 | Jul 27, 2022 |
#361 in Programming languages
Used in roost-cli
1MB
3.5K
SLoC
Roost - A Basic Programming Language for Demonstration
Roost is a simple example for an interpreted programming language. Its name is a combination of the language it was written in - Rust - and the word "rooster".
I created this language in connection with an obligatory research paper about the structure of a programming language in my 11th grade on school. The resulting paper can be found here. The main focuses of the paper are the lexing and parsing steps, regular and context-free languages, and the grammatical definition of a language. After that a short note on compilers and LLVM follows and some basic implementation details for a tree-walking interpreter are given.
Most of the paper actually refers to rost, an even more stripped down language acting just as a calculator but following the same principles, because while writing I quickly noticed that even Roost is too complex to explain in such a short paper.
The logo seen here and on the paper's title page was created by my friend and classmate Mik Müller.
See also
- rost: A simple interpreted calculator following the same principles
- The german research paper
- roost.rubixdev.de: An online playground for Roost using WebAssembly
- And the corresponding GitHub repository
- rost.rubixdev.de: An online playground for rost using WebAssembly
- And the corresponding GitHub repository
- My school's website
- Rust: The language both Roost and rost were written in
Local usage
1. Clone this repository
git clone https://github.com/RubixDev/roost.git && cd roost
2. Compile the binary
make release
3. Copy the binary into your PATH
sudo cp target/release/roost-cli /usr/local/bin/roost
or for just this user:
cp target/release/roost-cli ~/.local/bin/roost
Note: This step assumes you are running Linux and have your $PATH variable setup correctly. On other operating systems you can either run the binary by specifying the whole path or use
cargo run --release
4. Run Roost code
Using the REPL/interactive shell
When executing the roost
command without any extra arguments you enter the REPL for Roost. Here you can simply type expressions and execute them one by one.
Running files
To run a file (usually ending with .ro
) pass the path to that file as the first argument to roost
. For example:
roost samples/sample.ro