refu-lang / refu

Refu language
21 stars 4 forks source link
compiler hybrid language programming-language system-programming

Refulang

Travis Coveralls Join chat in gitter Read The Docs

This is the code repository for refu, a hybrid language with a strong type system based on algebraic data types.

For a language reference, tutorial and overall documentation visit here.

Dependencies

The required dependencies are:

The optional dependencies are:

Dependencies in Linux

Use your distribution's package manager

Dependencies in Macosx

brew install cmake
brew install pkg-config
brew install check
brew install llvm
brew install lcov

Installing llvm does not place it into the PATH and as such you will also need to put its path there manually. In recent versions this means adding the following to .profile.

export PATH="$PATH:/usr/local/opt/llvm/bin/"

Building

git clone --recursive https://github.com/refu-lang/refu
cd refu
mkdir build
cd build
cmake ..
make

Run the tests

In order to run the tests you have to also build them. This is done by providing an extra option to cmake.

cmake -DCMAKE_BUILD_TYPE=Debug .. -DTEST=1

There is a convenience test script that runs all of the tests for refu and its rfbase submodule.

./test.sh --rfbase

Usage

You can invoke refu --help in order to get all the possible arguments along with their description.

Example:

 --help                                                  display this help and exit
 --version                                               display version info and exit
 -v, --verbose-level=1-4                                 Set compiler verbosity level
 --backend=GCC|LLVM                                      The backend connection the refu compiler will user
 --backend-debug                                         If given then some debug information about the backend code will be printed
 --output-ast                                            If given then after analysis state the AST will be output in JSON format
 -o, --output=name                                       output file name. Defaults to input.exe if not given
 --rir                                                   Interpret the input file as a RIR file and parse it.
 -r, --print-rir                                         If given will output the intermediate representation in a file
 <file>                                                  input files

At the moment these are the important arguments.

Contributing

You are more than welcome to open a Pull Request here in Github if you would like to contribute to the development of refu.

Coding Style and Best Practises

TODO