[racket] Tutorial: writing a language (brainf*ck) in Racket

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Mon Jun 13 18:03:53 EDT 2011

On Mon, Jun 13, 2011 at 5:34 PM, Johnny Morrice <spoon at killersmurf.com> wrote:
>> The dilemma was to choose a language that was simple, and looked
>> nothing like Racket.  The choice was clear: it had to be brainf*ck.
>> Here's the tutorial:
>>     http://planet.racket-lang.org/package-source/dyoo/bf.plt/1/2/planet-docs/manual/index.html
>> Comments and suggestions would be greatly appreciated.
> Nice!
> For the tape: thought about using a zipper data structure, rather than
> a vector?

Given the heretical nature of the document, I wanted to keep the
tutorial as anti-functional as I could.

(Uh, just to make sure: that was a joke.  In fact, I'd written a
zipper tutorial for myself in
https://hkn.eecs.berkeley.edu/~dyoo/plt/zippers.txt a few years ago.)

I want to keep the number of concepts down as much as possible.  There
are two dangers I'm trying to avoid:

    1.  Losing velocity.  The tutorial is meant to be read in one
sitting.  Anything that slows down the velocity of the reader means
people's interest will drop.  It's the reason why the PLaneT
development-link section is so close to the front of the tutorial:
that's basically the only time where velocity is just slowly starting
up, and people will tolerate setting the link up then.

    2.  Narrowing the target audience down.  I want to make it at
least available to professional programmers with some familiarity (if
not expertise) with a programming language like Scheme.

Basically, I was trying to imagine someone like Randall Schwartz
hovering over my shoulder as I was writing the tutorial.  I hope I
succeeded at that target audience in mind.

Posted on the users mailing list.