My implementation of a Lisp as described in this book.
The master
branch should always work, be deployable, even if it isn't
actually working as a "programming language". All in-development work should be
done on their own respective branches, be merged in via a pull request, and
promptly removed. I know that I'm the only one working on this, so it's not
really necessary, but I'm treating it as an exercise in programming
cleanliness. I might add things, remove things... Let's see what I can do 😁
This project uses git submodules. Make sure to run the following commands after cloning:
$ git submodule init
$ git submodule update
Or, just use the --recurse-submodules
option when cloning this repo, i.e:
$ git clone --recurse-submodules https://github.com/jo12bar/build-your-own-lisp-c.git
- GNU
make
,gcc
(or justcc
—basically the same thing), etc... If you're using Debian or Ubuntu or similar you can justsudo apt install build-essential
to get all of these tools. - The
editline
development library- Mac: Should be installed with the Command Line Tools.
- Debian, Ubuntu, etc:
sudo apt install libedit-dev
- Fedora, etc:
su -c "yum install libedit-dev*"
Currently just an implementation of polish notation, but this should make it trivial to implement the rest of Lispy as all Lisps use polish-notation-like grammar.
A program is an operator followed by one or more expressions, where an expression is either a number, or, in parentheses, an operator followed by one or more expressions.
More formally:
Symbol | Definition |
---|---|
<program> |
The start of input, an <operator> , one or more <expression> s, and the end of input. |
<expression> |
Either a <number> or a ( , an <operator> , one or more <expression> s, and a ) . |
<operator> |
+ /add , - /sub , * /mul , / /div , or % /mod . |
<number> |
An optional - , and one or more characters between 0 and 9 (inclusive). |