Giter Site home page Giter Site logo

interpreter's Introduction

Interpreter

Documentation

###Overview
A mini-interpreter written in scheme which is able to interpret itself, and therefore could be extended in the future using boot-strap iteration.

###Files
interpreter.scm: main file, provides supporting syntaxes including: define, if, cond, let, let*, letrec, quote, apply, and, or.
library.scm: library, contains implementations of non-primitive functions including: caar, cadr, cdar, cddr, caadr, caddr, cdadr, cadddr, not, equal?, newline, map, assoc, append.
test.scm: sample input, containing some test functions including: test-define-func, test-let, test-let*, test-letrec, test-cond.
test-library.scm: sample input for library functions, containing a test function: test-library

###Enhance
Fixed a bug in user defined function bind, which may cause unexpected output when the number of formal parameters and actual parameters do not match.

###How to Run
Go to the directory of interpreter and type the following commands in scheme:

(load "interpreter.scm")
(repl)
(load "library.scm")

To use test.scm to test the interpreter:

(load "test.scm")
(test-define-func)
(test-let)
(test-let*)
(test-letrec)
(test-cond)

To use test-library.scm to test the library functions:

(load "test-library.scm")
(test-library)

To have the interpreter interpret itself:

(load "interpreter.scm")
(repl)

To exit the interpreter:

(exit)

interpreter's People

Contributors

codeosiris avatar

Stargazers

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