Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nydragon/glados-2023

A Scheme interpreter in Haskell.
https://github.com/nydragon/glados-2023

haskell scheme scheme-interpreter

Last synced: 20 days ago
JSON representation

A Scheme interpreter in Haskell.

Awesome Lists containing this project

README

        

# GLaDOS-2023


drawing










# Features

- Basic **scheme interpreter**
- Written in **Haskell**
- **Strict** testing policy
- Continuous integration running tests on every **Pull Request**
- **Over 100** Unit tests and close to **50% coverage**
- **Close to 20** Integration tests
- **Abstract Syntax Tree** and **Concrete Parse Tree** implementation
- Standard input reading
- An [ABNF syntax description](./doc/syntax-description.md)
- An [ABNF syntax description for the "compiled" code](./doc/compiled-syntax-description)
- **Infix notations** for operators and custom functions

## Supported Scheme Features

- Atoms
- Signed Integers
- Symbol
- Boolean type
- Function execution
- Function definition
- Named Functions
- Lambda Functions
- Variable definition
- Conditional expressions

## Builtin Functions

In addition to these basic features, our interpreter also implements the following builtins :

- println
- print
- div
- mod
- \*
- \-
- \+
- <
- <=
- \>
- \>=
- eq?

## Repl mode

You can also enter into an **interactive** session by running :

```
./glados -i
```

or

```
./glados --interactive
```

## Install Dependencies

Install cabal by installing GHCUP or another method described on the [Haskell Website](https://www.haskell.org/).

```sh
cabal update;
```

Also install the following VSCode/Codium/CodeOSS extensions:
```
hoovercj.haskell-linter
justusadam.language-haskell
haskell.haskell
```

## Run project

```sh
cabal run glados -- file.scm;
```

or

```sh
make ARGS="file.scm"
```

## Running the tests

In order to see coloured output and no coverage when running the tests, please run the tests with one of the following commands:

```sh
cabal run test
```

```sh
make test
```

[Build Guide](doc/dev-install.md)

# Bonus ideas :

- Fully featured REPL
- Exception stack tracing
- Exception line tracing