roost-lang

Crates.ioroost-lang
lib.rsroost-lang
version2.0.4
sourcesrc
created_at2022-07-27 18:29:09.866119
updated_at2022-08-01 18:58:13.975754
descriptionInterpreter library for the roost language
homepage
repositoryhttps://github.com/RubixDev/Roost
max_upload_size
id634023
size1,183,010
Silas Groh (RubixDev)

documentation

README

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.

Logo of Roost

The logo seen here and on the paper's title page was created by my friend and classmate Mik Müller.

See also

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
Commit count: 163

cargo fmt