Skip to content
Archive of posts filed under the Scheme category.

SICP 2.5

James Long is solving some SICP exercises and posting the solutions in his blog. Every software developer, me included, should do that! He posted yesterday the solution for exercise 2.5, which reads: Show that we can represent pairs of nonnegative integers using only numbers and arithmetic operations if we represent the pair a and b [...]

CPS and beta-reduction

I have finally implemented in Sly a pass to convert the code to Continuation-passing style (CPS), after reading an interesting article by Matt Might. I was not satisfied with the conversion algorithms I saw previously, but the “hybrid CPS conversion” is what I was really looking for. No extra β- or η-redexes are inserted during [...]

Apple releases its grip

From now on no more guessing is necessary. Apple has released a new developer agreement with much more relaxed rules. From the press release: “In particular, we are relaxing all restrictions on the development tools used to create iOS apps, as long as the resulting apps do not download any code. This should give developers [...]

Praising macros

Macros are an indispensable programming feature. While procedures (functions, methods, messages etc.) let developers reuse common computation patterns, macros allow the abstraction of common syntactic constructions. These constructions can be as simple as a new control operator, or can be full domain-specific languages. For instance, there is no when operator in Scheme, but a lot [...]

Apple relaxes restriction on interpreted code

Apple’s iOS SDK license agreement terms have always been source of disputes, discussions and many blog posts. Many accuse Apple of being too draconian and elitist, while being ineffective at barring bad applications from entering the store. The uproar just got fueled when Apple released the 4.0 version of the SDK with a new license [...]

Syntactic closures in Sly

Continuing my quest in mastering Scheme, I have completely revamped Sly‘s front-end and implemented syntactic closures in the source code expander. The initial motivation was to get alpha-renamed identifiers as the result of the expansion phase, to make it easier to apply subsequent transformations on the source code (like Dybvig’s Fixing Letrec). But it was [...]

Babel Syndrome

At this moment the groups that will bring us the seventh revision of the report on the algorithmic language Scheme (R7RS), which is going to be split in two, are being formed. I just hope that they keep in mind that even the gods will fear us if they succeed at producing a report (or [...]

Scheme hits the App Store

I believe I have got the first Scheme application past Apple review into the iTunes App Store. It is yet another Reversi clone, called Reverso. It is a combination of 90% Scheme and 10% Objective-C, written with Gambit-C Scheme. James Long has already shown how to compile Gambit-C for the iPhone, and I started from [...]

Sly Scheme

“You think you know when you can learn, are more sure when you can write, even more when you can teach, but certain when you can program.” – Alan Perlis Just after have read Lisp in Small Pieces I felt the urge to write a Scheme compiler. This sentiment is common in the Lisp community, [...]

Escape from Zurg

Lately I have been reading about searching in game trees. So a friend of mine sent me the “Escape from Zurg” paper, which talks about problem solving by tree searching with Haskell. In a large class of problems one is given a start state and some predicate for a desired final state. Moreover, the rules [...]