https://github.com/agrafix/micro-lisp
Haskell: a small lisp interpreter
https://github.com/agrafix/micro-lisp
Last synced: 11 months ago
JSON representation
Haskell: a small lisp interpreter
- Host: GitHub
- URL: https://github.com/agrafix/micro-lisp
- Owner: agrafix
- License: mit
- Created: 2017-11-27T07:04:28.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-27T07:08:30.000Z (over 8 years ago)
- Last Synced: 2025-06-24T11:07:46.933Z (12 months ago)
- Language: Haskell
- Size: 14.6 KB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# micro-lisp
A small lisp interpreter written in Haskell with minimal dependencies. A few notes:
* The implementation currently includes a small parser combinator library derived of [my blog post](https://www.athiemann.net/2016/05/27/parser-combinators.html). This could easily be replaced, but I wanted to keep the dependencies minimal for now. A result is that currently the parser error messages are not very friendly and comments are not supported.
* The behavior of the implementation is loosely based on [carld/micro-lisp](https://github.com/carld/micro-lisp), but somewhat stricter in a sense that more sanity checks are performed during runtime resulting in error messages instead of crashes.
* A test suite capturing most of the current semantics.
Pull requests are welcome - if you find a bug or plan to add a feature please include unit tests.
A blog post might follow... :-)
## Setup
* Download and install [Haskell Stack](http://haskellstack.org/).
* Clone the repo, run `stack setup && stack build`
* To install system wide run `stack install`.
## Usage
```bash
# from file
micro-lisp -f [source-file]
# inline
micro-lisp "(+ 1 1)"
# from standard in
echo "(+ 1 1)" | micro-lisp
```