Writing a Scheme interpreter for fun

Writing a Scheme interpreter is a great way to learn Haskell. You can practice advanced Haskell techniques such as I/O, mutable state, dynamic typing, error handling, and parsing. There is a Wikibook named Write Yourself a Scheme in 48 Hours for this purpose.

I’ve just started writing a Scheme interpreter, HScheme to teach myself both Haskell and Scheme. The skeleton code is based on the Wikibook and I am working on the remaining features of R5RS Scheme standard. My first improvement to the interpreter was to support vectors.

Among the remaining features, Hygienic macro system is the most important feature I need to implement immediately because other parts of Scheme standard such as let-bindings and control flow features are defined in terms of macro. There are a whole collection of papers on macro implementation. I’ll write more on the implementation of Hygienic macros.

BTW, there is already a full-featured Scheme implementation in Haskell. Refer to Husk Scheme for details.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s