Code Monkey home page Code Monkey logo

build-your-own-lisp-c's Introduction

Build Your Own Lisp in C (my implementation)

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 😁

Building

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

Requirements

  • GNU make, gcc (or just cc—basically the same thing), etc... If you're using Debian or Ubuntu or similar you can just sudo 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*"

Language Spec

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).

build-your-own-lisp-c's People

Contributors

jo12bar avatar

Watchers

 avatar  avatar

build-your-own-lisp-c's Issues

#5 breaks Windows support.

Ok I was kinda kidding in the message of commit bba0c1b. I'm adding Windows support back again. Windows just makes everything so painful sometimes...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.