Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ccntrq/loxomotive
loxomotive - A Lox Interpreter implemented in Haskell
https://github.com/ccntrq/loxomotive
crafting-interpreters haskell interpreter lox
Last synced: 3 months ago
JSON representation
loxomotive - A Lox Interpreter implemented in Haskell
- Host: GitHub
- URL: https://github.com/ccntrq/loxomotive
- Owner: ccntrq
- License: mit
- Created: 2018-01-15T18:13:24.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-08T14:39:40.000Z (about 3 years ago)
- Last Synced: 2023-05-09T12:09:10.689Z (over 1 year ago)
- Topics: crafting-interpreters, haskell, interpreter, lox
- Language: Haskell
- Size: 66.4 KB
- Stars: 11
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# loxomotive - A Lox Interpreter implemented in Haskell
## Book
I read the book [Crafting Interpreters](http://www.craftinginterpreters.com/) by
Bob Nystrom and this is an interpreter implementation for the language `Lox`
that he created for the book. The first part of the book where you write the
interpreter is now finished and is really worth a look. It helped me learn a lot
about programming languages in general and also helped me to teach me some
haskell.You can find the code to the book on github. The repository is linked as a
submodule.Thank you Bob for writing this.
## Description
This implementation of a Lox interpreter is closely modelled after the
originial java implementation from the
[craftinginterpreters](http://www.craftinginterpreters.com/) book.
Both interpreters should be mostly compatible but don't take my word for that.I got sidetracked with my [first](https://github.com/ccntrq/plox) two attemtpts
at implementing this interpreter while waiting for the book to finish.
Since this is my third time I didn't want to re-read the book again. This time
I decided to just look at the Java sources and translate them to haskell as
close as possible. I might refactor some of this later.## Usage
### Dependencies
To build and run the interpreter you will need a version of [stack](haskellstack.org).
### Build
```
stack build
```### Run
```
stack run -- [filename]
```You can invoke `loxomotive` either with zero args to start the repl or with a
file to interpret that file```
loxomotive v1.0.0
Usage: loxomotive [filename]
```