Jump to content
  • Advertisement
Sign in to follow this  
Lucidquiet

Minimal Lisp implementation?

This topic is 4809 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm thinking of implementing my own lisp interpreter for scripting purposes and such. I'm trying to determine the minimal built in function required. And then when that is implemented implementing the others with those base functions. The list so far is: listp (or list?) numberp (or number?) null (nil?) list append car cdr <,>,<=,>=,/=,= +,-,\,* defun cond (or simply if) if (or just cond) I don't know if this would be sufficient or not. Any ideas are help full, thanks, L- Edit: Forgot defun

Share this post


Link to post
Share on other sites
Advertisement
First of all: numbers are for weaklings, real man use church numerals ;)

If your lisp should be anything like Scheme or Common Lisp you need (set stuff value), (lambda ...), (eval ...) and (apply ...).

You don't need defun, list and append. You most likely need (cons ...). For anything useable you need a GC.

A nice book on this topic is Lisp in small pieces.

Share this post


Link to post
Share on other sites
Read John McCarthy's original paper on lisp here. It covers pretty much everything needed for a minimal implementation of lisp.

If you mean Common Lisp, the book ANSI Common Lisp actually has a (somewhat complete - it's missing lots of error checking and that kind of thing) lisp implementation in the back based on something like 30 primitives listed at the start of that section.

Share this post


Link to post
Share on other sites
Thank you -- both of you. Those are some excellent resources for the task. I haven't yet got a chance to read McCarthy's paper. Also, the Lisp In Small Parts, looks like a good book, I orderred it, and will find out.

Thanks,
L-

Share this post


Link to post
Share on other sites

Not many people realize that today's javascript is like Scheme in disguise. Heck, you might even know the syntax already! Also, there are implementations already done that integrate directly with Java anc C.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!