Giter Site home page Giter Site logo

lisp-rs's Introduction

lisp-rs

A simple Lisp interpreter/library in Rust. The interpreter/library was initially developed as a teaching aid to explain how Lisp interpreters work and how can they be implemented using the Rust programming language. However the interpreter seems to be taking life of it's own and has been ported to the web using WASM. The interpreter is available as a crate and can be used to embed a Lisp interpreter in your Rust projects. The WASM implementation uses the lisp-rs as a library to implement the online interpreter.

Dialect

The interpreter is based on a modified subset of Scheme. Following are the features supported by the interpreter

  • Variables and Constants
  • Functions (lambdas)
  • Functional constructs such as map, filter and reduce
  • Closures
  • Tail Call Optimization

More information about the dialect can be found at

Implementation

The interpreter has been implemented in three phases

  • Phase I: Complete interpreter and REPL implementation with support for basic data types (integers and boolean), variables, lambdas, and lambda calls (branch 0.0.1)
  • Phase II: Support for advanced data types (string, float, and lists) and functional constructs (branch 0.0.2)
  • Phase III: Support for tail call optimization (branch 0.0.3) and closures (branch 0.0.4)

For a detailed code-walkthrough about Phase-I implementation refer to the docs. For code-walkthrough of all the phases, get the e-book.

asciicast

REPL

cargo run --features="build-binary"

Test

cargo test

WASM

The interpreter has also been compiled to WASM so that it can run in a browser and is hosted here.

lisp-rs's People

Contributors

nicholassterling avatar tanish-eagle avatar vishpat avatar

Watchers

 avatar

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.