Code Monkey home page Code Monkey logo

tinyscheme's Introduction

PPCA2015 Scheme Interpreter Powered By BreakVoid(Song-Yu Ke)

A tiny Scheme interpreter written by javascript

#Environment: Node.Js v0.12 Run "node ./main.js" and put your source in "./src.scm".

The interpreter will read the code from "./src.scm" and execute them.

#Some Detial in Programming

-Use a package to support big integers

-Tail call optimization is not supported.

-the syntax `let' is interpretered by an equivalent way.

(let ((variable init) ...) expression expression ...)
-----------------------
((lambda (variable ...) expression expression ...) init ...)

-the syntax `let*' is interpretered by an equivalent way.

(let* ((variable1 init1)
   (variable2 init2)
   ...
   (variableN initN))
   expression
   expression ...)
-----------------------
(let ((variable1 init1))
	(let ((variable2 init2))
		...
			(let ((variableN initN))
			expression
			expression ...)
		...))

-the syntax `lerec' is interpretered by an equivalent way like:

(letrec ((even?
        (lambda (n)
          (if (zero? n)
              #t
              (odd? (- n 1)))))
       (odd?
        (lambda (n)
          (if (zero? n)
              #f
              (even? (- n 1))))))
(even? 88))
-----------------------
((lambda ()
	(define even?.1
		(lambda (n)
          (if (zero? n)
              #t
              (odd? (- n 1)))))
    (define odd?.1
    	(lambda (n)
          (if (zero? n)
              #f
              (even? (- n 1)))))
    (define even? even?.1)
    (define odd? odd?.1)
    (even? 88)))

tinyscheme's People

Watchers

 avatar  avatar  avatar

Forkers

runzheyang

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.