

Ask HN: Have any of you ever wanted to write a compiler or interpreter? - ncarlson

Hi everyone,<p>I'm looking for feedback on a project I would like to start. Basically, I would like to start an educational project built around compiler and interpreter design.<p>I remember wanting to learn how to write a compiler for the longest time. However, each time I'd approach the subject to learn more, I would run into some kind of hurdle and eventually get distracted by other projects. The hurdle usually came in the form of poor access to good educational information.<p>There are books available like the famous Dragon book. However, I feel that there needs to be an alternative entry vector into the field of compiler and interpreter design. The project I'm considering would consist of a simple yet fully functioning compiler (or interpreter) with a heavy amount of documentation. Beyond this trivial implementation, subjects like JIT, stack vs register, dispatching methods, and compiler frameworks could be explored.<p>I have a small interpreter half written for a compiler design class I took at university. But I also plan on building a web site to hold all the documentation and educational material.<p>Would any of you benefit from a project like this? I'm willing to go it alone for quite a while, but eventually I would need help from the open source community.<p>Thanks,
Nick
======
bdfh42
I have had a go at writing both a small interpreter and a small compiler. I
found both exercises intellectually rewarding and will probably come back to
this at some time in the future.

I used the .NET platform and the IL assembler language as my output so I
suppose I kept some distance from the "metal" but otherwise explored the
challenges.

I was reminded of the sheer pleasure of this activity When I recently re-read
Douglas Crockford's chapter in the "Beautiful Code" book. In it he describes a
short but elegant interpreter written in Javascript.

------
alanthonyc
This sounds interesting. It's been a while, but the compiler I built for a
project class I in college was the most satisfying thing I've ever built.

What language are you thinking of implementing?

------
MaysonL
Take a look at OMeta and Factor.

