Skip to content

amitayh/lispjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lispjs Build Status codecov

Simple Lisp implementation in JavaScript. Web REPL demo

Note: this is an experimental library for educational purposes only

Installation

$ git clone https://github.com/amitayh/lispjs
$ cd lispjs
$ npm install

Running tests

$ npm test

Example programs

var lisp = require('./lisp');

// Fibonacci
var fib = [
  // Define fib function
  ['define', 'fib',
    ['lambda', ['n'],
      ['if', ['<', 'n', 2],
        1,
        ['+',
          ['fib', ['-', 'n', 1]],
          ['fib', ['-', 'n', 2]]]]]],

  // Call function
  ['fib', 5]
];

console.log(lisp.run(fib)); // Prints 8

(more examples in here and here)

About

Simple Lisp implementation in JavaScript

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published