[LLVMdev] Contributing to LLVM

David Greene dag at cray.com
Tue Aug 5 09:15:58 PDT 2008


On Tuesday 05 August 2008 03:27, Bill Wendling wrote:
> On Aug 4, 2008, at 10:29 PM, Shrutarshi Basu wrote:
> > Hello all,
> > I'm a rising sophomore CS/Engineering student in the US and I'm
> > interested in programming languages/ compilers.I think the LLVM would

Yay!  We need more compiler people in this industry.  :)

This is actually a very good time to be getting into the field.  As clock 
speeds plateau, compilers are being relied upon much more to make
up the difference.  There are lots of interesting things going on with
dynamic compilation and programming tools.

> Read the books you have access to -- Advanced Compiler Design and
> Implementation by Steven Muchnick is a good one. Because you're a

I second the Muchnick recommendation, though maybe not as a teach-yourself
kind of book.  It's a great reference and the bibliography is very 
comprehensive.

_The Design and Evolution of C++_, though a little dated now, is a good book 
to read about practical language tradeoffs and "why things are the way they 
are."

It's also very, very, very important to understand computer architecture.  
Even if your degree program doesn't require it, take a computer architecture 
course.  Then you'll understand why we fuss over things like partial register
writes and cache efficiency.  Ok, partial register writes might be a 
graduate-level computer architecture course topic.

Patterson & Hennessy (or Hennessy & Patterson for graduate level) is the 
standard university computer architecture book.  The editions I have have an 
unfortunate bias toward pure RISC processor design but perhaps that's been 
improved in later editions.

Finally, read _The Soul of a New Machine_ by Kidder.  It's a great story about
hacker culture, system design, debugging and not taking yourself too 
seriously.  Don't get sucked in completely by work and computing.  Have fun!

> sophomore, you should take a compiler class at your university.
> Compilers are a specialized field of computer science. It comes with a
> nomenclature and set of skills all its own and which you will need to
> know before you can make any progress at it. Classes and studying
> should get you there.

Absolutely.

Your typical undergrad-level compiler course will focus almost exclusively on
parsing.  That's good theory to know because the general concepts apply
to other phases of the compiler as well (pattern matching, data structures,
tree traversal, etc.).  An undergrad-level compiler course that actually has 
you build a compiler from scratch is a GREAT way to grok data structures
and algorithmic complexity.  It's also very useful to fully understand what's
going on under the hood (runtime stack, function linkage, ABIs, etc.).

If possible, try to do some learning about program transformation during
your undergrad degree.  Most universities have a graduate-level compiler
course that dives into things like dataflow analysis, transformation, etc.
Try to take that class if possible, because this is where all the work is
currently being done in the industry.  Parsing is considered "solved."  The 
undergrad course might touch on this stuff toward the end.  The more you're
exposed to, the better.

Don't take a graduate level compiler course and a graduate level computer 
architecture course in the same semester.  It's an interesting way to learn 
about connections between the two but you'll have no social life.  I speak 
from experience.  :)

The best way to learn is to work on real projects.  Perhaps there's a 
professor that would take you on as an undergrad researcher.  Or just
try to do something cool in LLVM as others have suggested.  One can
learn theory all day but learning really happens when theory gets put
into practice and you start tearing your hair out over a misued 
PUNPCKHQDQ.  :)

Welcome to the party!

                                                 -Dave



More information about the llvm-dev mailing list