r/dailyprogrammer • • Sep 01 '12
[9/01/2012] Challenge #94 [difficult] (Simple Lisp interpreter)
Lisp is a family of programming languages, known for its extremely simple notation (called S-expressions) in which programs are defined as lists and code can be modified as data. Your task is to write an interpreter for a simple subset of Lisp.
Peter Norvig wrote a popular article on how to write a simple Lisp interpreter in only 90 lines of Python. You can choose to port his code to a language of your choice, or write one on your own, from scratch. Bonus points for solving today's easy challenge (or maybe even this challenge) in your own Lisp dialect!
4
u/Ledrug 0 2 Sep 01 '12
Heh, can I do this challenge in, um, Lisp?
4
u/tikhonjelvis Sep 01 '12
For anybody wanting to learn Haskell: there's a tutorial doing exactly this called Write You a Scheme in 48 Hours. I found it a good way to get used to Haskell and just a fun project to do in general.
1
u/BobTreehugger Sep 24 '12
Here's my entry, written in Go:
https://github.com/maxpolun/daily94
The only real thing it lacks relative to Norvig's is that this one is currently an integer lisp.
A couple notes about Go for this:
1
u/Metaluim 0 0 Sep 03 '12
For the record, here is the spec for Common Lisp.
1
u/mynamewastakenagain Sep 26 '12
I'm going to try to do this in bash, we'll see how it goes...