Contributing to LLVM

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
be a great project for me to contribute to, both to learn something
and help the project. Unfortunately, I don't know much about
compilers, much less anything which would allow me to make a
significant contribution. I've started reading the Dragon book and
over the summer I wrote a recursive descent parser for a project's
config files. I would appreciate it if some of you could give me
guidelines for what I should learn/do both in terms of theory and in
using practical tools. In particular I'm looking to become familiar
with both general compilers and the LLVM to be able to do a project
for next year's GSoC. I'll start by compiling the code and haunting
this list.
Thanks everyone,
Basu

Shrutarshi Basu wrote:

I'm a rising sophomore CS/Engineering student in the US and I'm
interested in programming languages/ compilers.I think the LLVM would
be a great project for me to contribute to, both to learn something
and help the project. Unfortunately, I don't know much about
compilers, much less anything which would allow me to make a
significant contribution. I've started reading the Dragon book and
over the summer I wrote a recursive descent parser for a project's
config files.

As an exercise at least, I would suggest to learn how to use LLVM at first. For instance, you might add some LLVM JIT abilities to your favorite interpreter (like Guile, Ocaml bytecode, Python, Ruby, ... - ie translating the interpreted code into LLVM), or to some toy language.

Regards

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
be a great project for me to contribute to, both to learn something
and help the project. Unfortunately, I don't know much about
compilers, much less anything which would allow me to make a
significant contribution. I've started reading the Dragon book and
over the summer I wrote a recursive descent parser for a project's
config files. I would appreciate it if some of you could give me
guidelines for what I should learn/do both in terms of theory and in
using practical tools. In particular I'm looking to become familiar
with both general compilers and the LLVM to be able to do a project
for next year's GSoC. I'll start by compiling the code and haunting
this list.

Hi Basu,

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

Good luck!
-bw

Hello all,

Hi Shrutarshi,

I’m a rising sophomore CS/Engineering student in the US and I’m
interested in programming languages/ compilers.I think the LLVM would
be a great project for me to contribute to, both to learn something
and help the project. Unfortunately, I don’t know much about
compilers, much less anything which would allow me to make a
significant contribution. I’ve started reading the Dragon book and

While I was taking the compiler class at the university, I started with the Dragon book and it works fine for me. While you are learning the concepts try to implement a small scale compiler. I can remember we were assigned to write a lexical analyser + parser + code generator for a part of Javascript language(for a subset of it, Javascript is huge) as part of the subject which helps a lot to understand the concepts. AFAIR there is a small project which suits for a one semseter course at the end of the book.
Then you can start from here.
http://llvm.org/docs/
Next you can go here.
http://llvm.org/OpenProjects.html

Yes, good luck!

-Rajika

> 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. :slight_smile:

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. :slight_smile:

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. :slight_smile:

Welcome to the party!

                                                 -Dave

Hello again,
Firstly thank you all for your recommendations and advice. I'll
certainly be reading more of the Dragon Book. One of my professors who
I've told about my interest has also lent me the Patterson & Hennessy
book and I've read the first chapter. I'll also read into that as time
progresses. So I think I'm on the right track.
That being said, the bad news is that my school shelved its compilers
course a few years ago and we have a more theoretical programming
languages course. Also since I go to an undergrad college, there
aren't any grad level courses in reach. However I think I can dig up
some material on what was taught in the compilers course and make an
indenpendent study out of it in the spring or next fall, depending on
when I have time.
I think I'll start by compiling the code and getting to use it and
reading some of the docs. Then I could start out with the
'code-cleanup' bug-reports.
Thanks again everyone,

PS
@Dave: I'll be sure to look out for the PUNPCKHQDQs.