or learn more

Pet Projects

May 29, 2009

this is another entry in a series on programmer enrichment

Most programmers looking to improve their craft are enthusiastic about learning new programming languages. I am a huge proponent of polyglot programming practices and as a result I attack literature, code samples, and discussions regarding interesting programming languages and dialects with a gusto unmatched by any other hobby in my life (save for MST3K). I would like to take a moment to clarify my previous sentence. That is, it’s not fair to qualify any particular programming language with the term interesting because in fact

all programming languages are interesting in some way

That being said, I have accumulated a set of pet projects that I tend to cycle through when learning new languages. Each pet project scratches a certain itch and each requires differing approaches for solving. When learning a new language I like to solve two or more of these pet projects in order to get a feel for the capabilities and shortcomings of said language. The current set of projects is as follows.

Lisp Interpreter

The idea of creating an interpreter for a subset of Lisp has only recently become a member of my pet projects. I previously shied away from creating a Lisp because it has become incredibly ubiquitous and it seemed silly to throw Y.A.L.I. (Yet Another Lisp Interpreter) into the already over-crowded landscape. However, upon further reflection on the matter I realized

the best way to learn two programming languages concurrently is to write an interpreter or compiler of one using the other. However, it’s highly probable that you will gain a deeper understanding of the implemented language rather than the implementation language.

It’s not accurate to label this particular pet project a Lisp interpreter because in all likelihood I will instead write one for a wholly different language in order to more effectively reap the 2-1 benefits in the future.

Lexer Generator

With outstanding tools like JavaCC, Lex, Antlr, and Flex it seems unlikely that one could further the current understanding of scanner generator techniques. However, it’s useful to note

your own set of pet projects should not attempt to be groundbreaking but instead work to further your own understanding of their constituent parts and how they are implemented using your chosen target language

If you manage to do something truly innovative, then kudos to you. However, I like to maintain a set of projects solving well-known problems; that way the bulk of the implementation activity is spent trying to solve the problem using the target language idioms and not in research and design.

Knuth’s Pac-Land

Pac-Land is essentially Conway’s Game of Life on steroids. It’s a great project for targeting languages facilitating highly concurrent programs.

Linear Algebra Library

I do this mainly to refresh my mathematical muscles every couple of years. This brings us to another principle one should adhere to with a set of pet projects

It’s not always exclusively about honing your programming skills. In the world of pet projects, side-effects are a good thing.

Workflow Engine

This project is mainly an attempt to finally get it right… next time.

m-ary Tree

It’s a good idea to incorporate a data structures project into your set. An m-ary tree is as good as any and oft times better given that you can do additional experimentation on the effects of: 1. Differing values for m 2. Immutability 3. Generic implementation

And to boot, it’s always fun to implement the searching and sorting functions for the tree.

Now Do This

The most useful tool that I’ve come across in the past 3 years is Jakob Lodwick’s Now Do This TODO application. It’s so simple in its perfection it almost hurts me physically that I didn’t think of it first. In any case, it’s a great little app that helps to exercise UI capabilities of a target programming language.

Project Scaffolding Generator

This is a bit more involved and to be honest I haven’t done it in a while since I last implemented it to learn Python, but it’s a good (and practical) project. And that leads us to another principle

Don’t worry about practicality when choosing your own pet projects, but with all other things being equal favor it.

Gap Buffer

Long ago I set out to create my own text editor. However, after spending many hours on the task I realized that it was unlikely that my editor would be any better than hundreds of other editors. Therefore, I decided to call it quits after finally getting to the point of having a usable (albeit lame) text editor. That is not to say that my effort was wasted as I learned a lot, which is the foremost 1 point of any pet programming project. The most intriguing part was of course the runtime text storage mechanism implemented as a gap buffer. I will occasionally feel nostalgic for my old gap buffer (I called it Gappy) and have previously reimplemented it a couple of times, although it’s been a while.

Next generation projects

Pet projects have come and gone and those listed above are no different. That being the case, I have considered adding a couple additional projects as listed below.

Twitter client

Creating a Twitter client has crossed my mind, but in all likelihood by the time I feel motivated to do one there will be millions of others available for study.

You are not required to always write code. Instead, try supplementing the creation of pet projects with the study of existing implementations of your pet projects in your target language(s).

Project Euler

I like the idea of Project Euler but I simply cannot personally find any enthusiasm for attempting the problems, which of course brings one additional principle that you absolutely must adhere to

You can forget every other principle — as long as you have fun

What are your pet projects?


  1. Even when it turns out to be not very fun. 

7 Comments, Comment or Ping

  1. Dean Weber

    There’s always PLEAC

    It looks to be a great way to explore/learn a language with a specific focus like a pet project.

  2. Hey, I got a pretty idea how to improve my learning in programming thanks to you.. However, I like networking,python and linux, and I’m looking for a good pet project idea to spend my time researching and developing my skills. If you have any idea for passing me, let know.

  3. steveo

    I like how you set out your ‘principles’ in block quotes so I can tell they were extra important

  4. Is this why I always see so many re-implementations of mini-kanren? Even I’ve caught myself doing the same. But I will disagree with Project Euler. A few simple problems there help reinforce the lexical differences between your known languages and the one you’re trying to learn.

  5. @steveo It’s amazing what people will find offensive.

  6. @wheaties

    What about Project Euler do you disagree with? I’ve not found it useful. If you have then kudos, but it’s hard to think that I could disagree with your personal experience.

  7. Manuel

    Can you give more informations about Knuth’s Pac-Land? I haven’t found anything about it :/

Reply to “Pet Projects”