Welcome to the Glados Language project! This project includes a custom programming language called Glados with two main components:
- Glados Compiler (
glados): Compiles Glados source code. - Glados Virtual Machine (VM) (
vm): Executes compiled Glados code.
This project is structured as a Haskell Stack project, with all dependencies managed by Stack.
compiler/: Contains the source code for the Glados compiler.executer/: Contains the source code for the Glados VM.compiler/test/: Contains test scripts for running functional tests.Makefile: Provides various commands to build, clean, test, and manage the project.
To get started, make sure you have:
- Haskell Stack installed
Makeutility
To build both the compiler and the VM, run:
make allThis will:
- Build the Glados compiler executable (
glados) and place it in the project root. - Build the Glados VM executable (
vm) and place it in the project root.
Alternatively, you can build them separately:
make compiler # Builds only the Glados compiler
make executer # Builds only the Glados VMTo remove build artifacts and binaries, use:
make clean # Removes Stack build artifacts
make fclean # Removes build artifacts and compiled executablesTo clean and rebuild everything from scratch, use:
make reThis project includes both unit and functional tests.
- Unit Tests: Run with
make unit, which uses Stack's test framework. - Functional Tests: Run with
make functional, which executes scripts located incompiler/test/.
To run all tests, use:
make testsTo generate a test coverage report, use:
make coverageThis command will generate a coverage report and attempt to open it in your default web browser. If no report is found, it will display an error message.
To lint the code, use:
make lintThis command uses hlint to check for style issues in both the compiler/lib and executer/lib directories.
| Command | Description |
|---|---|
make all |
Builds both the compiler and VM. |
make compiler |
Builds only the Glados compiler. |
make executer |
Builds only the Glados VM. |
make clean |
Removes build artifacts. |
make fclean |
Removes build artifacts and executables. |
make re |
Cleans and rebuilds everything. |
make unit |
Runs unit tests. |
make functional |
Runs functional tests. |
make tests |
Runs both unit and functional tests. |
make coverage |
Generates a code coverage report. |
make lint |
Lints the codebase using hlint. |
EPITECH Project, 2024