Lisp interpreter written in Swift — based on Jonathan Tang's book "Write Yourself a Scheme in 48 Hours".
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Sift.xcodeproj
Sift
README.md

README.md

Sift

A Lisp implementation written in Swift, following Christian Queinnec's book Lisp in Small Pieces and Jonathan Tang's book Write Yourself a Scheme in 48 Hours.

Journal

  • 7 Jan 2018 — Near the end of Chapter 1 of the book. The book describes a meta-circular implementation using Lisp/Scheme as the host language. However, given that this a Swift implementation, a few pieces are missing and will need to be implemented. The code currently compiles. The next step is to write an expression and fill in the blanks necessary for it to be evaluated correctly. At this stage, expressions will be constructed in Swift code as we don't have a Lisp lexer and parser yet.

  • 8 Jan 2018 — Evaluated the first expression! Swift Arrays cannot capture the nuances of Lisp lists. I changed the Value data structure to align better with Lisp's way of doing things and added a few helper functions to convert to and from Swift Array. This may be worth a revisit in the future with an eye towards performance. Next, I will need to look into the mutability story to correctly implement set-cdr!.

  • 11 Jan 2018 — To bridge the gap between Swift's strong and static typing and Lisps dynamic nature, I'm starting over using Jonathan Tang's book on writing a Scheme interpreter in Haskell. Once I get an interpreter up and going, I will switch back to Queinnec's book.