Giter VIP home page Giter VIP logo

littlelisp's Introduction

Little Lisp

A mini Lisp interpreter in JavaScript. Supports lists (obvs), function invocation, lambdas, lets, if statements, numbers, strings and the library functions first, rest and print.

Thank you to Martin Tornwall for the implementations of let and if.

Repl

$ node repl.js

Some runnable programs

1
(first (1 2 3))
((lambda (x) (rest x)) ("a" "b" "c"))

littlelisp's People

Contributors

maryrosecook avatar mtornwall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

littlelisp's Issues

String escaping doesn't work

It seems the lexer have some problems when dealing with escape sequence:

> "...\"..."
'...\\"...' 
/* should be '..."...' or "...\"..." */ 

Point to blog post

Suggestion: Point to the blog post from the GitHub repo, as it provides important documentation.

REPL Won't Start

Hello. I downloaded the .zip file of master today, and when I try to run it it won't start.

david@ubuntu:~/Documents/Lisp/littlelisp-master$ nodejs repl.js 

readline.js:121
    var lines = prompt.split(/[\r\n]/);
                       ^
TypeError: Object #<Object> has no method 'split'
    at Interface.setPrompt (readline.js:121:24)
    at new REPLServer (repl.js:128:7)
    at Object.start (repl.js:251:14)
    at Object.<anonymous> (/home/david/Documents/Lisp/littlelisp-master/repl.js:4:6)
    at Module._compile (module.js:446:26)
    at Object..js (module.js:464:10)
    at Module.load (module.js:353:32)
    at Function._load (module.js:311:12)
    at Array.0 (module.js:484:10)
    at EventEmitter._tickCallback (node.js:190:39)
david@ubuntu:~/Documents/Lisp/littlelisp-master$ 

I checked, and repl is being imported. I'm running nodejs v0.6.19.

Thanks.

Curious about building interpreter or something like that

Hi,
I'm a frontend developer which means i use javascript everyday. Recently, i have a idea to build a new fast-interpreting javascript template such as mustache. I think it has much common in the way of thinking. In your "littlelisp", the lisp code should go through "syntax analysis" and then to be interpreted with javascript in action. So my question is, to build a interpreter or a kind of thing like that, is there some knowledge i need to know, such as "Discrete Mathematics" ? I know I'm not knowledgable enough and i hope that someone may give some advices and direction to move on. Thank you!

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.