Skip to content
jre0215Public

About

Chipmunk is a Lisp interpreter with partial support for compiling to JavaScript

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

219 Commits

Folders and files

Repository files navigation

Chipmunk

Chipmunk is a Lisp interpreter with partial support for compiling to JavaScript. It's implemented in TypeScript and runs on Node.js. The goal is to someday achieve self-hosting.

Example Program

Print the factorials of the numbers 1 to 10:

(do
  (def factorial (lambda (x)
    (if (= x 0)
      1
      (* x (factorial (- x 1))))))
  (print-line (map factorial (range 10))))

; prints "[1 1 2 6 24 120 720 5040 40320 362880]"

See the documentation for a list of functions

Command Line Interface

First, install dependencies:

npm install

To start a Chipmunk REPL:

npm run chipmunk

To run a Chipmunk program (any extra arguments are available to the program as argv):

npm run chipmunk -- examples/game-of-life.chip
npm run chipmunk -- examples/factorial.chip 10

To compile a Chipmunk program to JavaScript and run it:

npm run compile -- examples/game-of-life.chip
node examples/game-of-life.js

To run tests:

npm test

About

Chipmunk is a Lisp interpreter with partial support for compiling to JavaScript

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages