On 11/22/2011 02:10 PM, Timothy Baldridge wrote:
So I got thinking about clojure pypy tonight, and got thinking how
easy it would be to adapt my old code to run as a interpreter. So I
pulled in a few files, implemented a few methods, and I have prototype
running (+ 1 2)  as interpreted lisp code.

I slapped it up on github...it's ugly, but it's a start:
https://github.com/halgari/clj-pypy

Timothy, you may want to have a look at my "Scheme in Python" interpreter. There might be some overlaps. The difference is of course that Scheme requires the interpreter to by fully tail recursive so you'll see trampolining and continuations all over the code.

One design decision I made was structuring the whole interpreter as a set of stream processing routines. That is the reader takes a stream of characters and produces a stream of tokens, which goes to the parser (1) producing a stream of s-expressions, which goes to evaluator...

(1) here should come the macro expander but I haven't finished it yet.

The code is on github:
https://github.com/andrzej-r/PScheme

Cheers,

Andrzej

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to