# GrEv

A compiler for a gradually typed language based on evidence

## Usage

### Basic usage

To compile a program, use the following command:

```sh
grev [-v] <input_file> [-o <output_file>] [-t <typechecking>]
```

* `input_file` is the program you want to compile

* `output_file` is where the result will be stored (default: input file without the extension)

* `typechecking` is the typechecking semantics that will be used, options are either `static`, `dynamic`, `gradual_guarded`, `gradual_mono_values`, `gradual_mono_closures` or `gradual_guarded_dfo`.

Use `-v` to print the intermediate representation at every step of the compilation.

## Installation

To install this project, first you need to install its dependencies using opam:

```sh
opam install --deps-only .
```

> Note: The project depends on LLVM 19 as a system dependency, so depending on your OS you may need to install it using your package manager.

Then, build the project using dune:

```sh
dune build
```

The runtime dependencies are the garbage collector, LLVM 19 and Clang 19.

The scripts expect llvm-link and clang to correspond to the expected versions.

The GC is The Boehm-Demers-Weiser conservative garbage collector (available at https://www.hboehm.info/gc/gc_source/gc-8.2.8.tar.gz).
