Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/renatoalencar/lisper
A very simple implementation of Lisp built in Python
https://github.com/renatoalencar/lisper
interpreter lecture lisp lisp-interpreter python
Last synced: about 1 month ago
JSON representation
A very simple implementation of Lisp built in Python
- Host: GitHub
- URL: https://github.com/renatoalencar/lisper
- Owner: renatoalencar
- License: mit
- Created: 2019-08-27T01:01:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-01T05:01:59.000Z (over 4 years ago)
- Last Synced: 2024-11-07T12:53:31.171Z (3 months ago)
- Topics: interpreter, lecture, lisp, lisp-interpreter, python
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lisper
A very simple Lisper interpreter that supports only numbers.
## Introduction
I was there, on a sunday morning watching videos on YouTube when I get to [this Lecture by
Hal Abelson](https://youtu.be/-J_xL4IGhJA) on a introduction to Lisp. Is quite simple, it's almost an introduction to
programming itself and introduces the syntax and some operators of Lisp. It also introduces
the Haron of Alexandria algorithm of solving a square root of a number. So I thought: "Why
not build a Lisp interpreter that supports the exactly same specs he introduces on this
Lecture?".And so I spent my sunday writing a very simple interpreter, and that here is.
## Running
The example in the lecture can be found in the file [sqrt.lisp](./sqrt.lisp), just pass the file name
as an argument like this:```sh
$ ./lisper.py sqrt.lisp
1.4142135623746899
```You can run `./lisper.py -h` to get some other options available like printing the AST or the
resulting value of each evaluation.## Issues
This is a simple implementations, so here are a few known issues:
* It's not optimized;
* Only support arithmetic operations;
* There is no interop with Python;
* Does not keep track of lines and columns on errors.## License
[MIT](./LICENSE)