Vous êtes sur la page 1sur 7

CS143 Handout 01

Autumn 2007 September 24, 2007


CS143 Course Information

Instructor: Jerry Cain


Email: jerry@cs.stanford.edu
Office phone: 650-725-8597
Cell phone: 415-205-2242
Office: Gates 192
Office hours: Mondays, Fridays 3:00 – 5:00 p.m.

You needn’t take the above hours all


that seriously. I’m planning to be in the
office a good chunk of the week, and as
the quarter progresses and I settle into a
comfortable schedule, I’ll advertise
when I’m usually in and when I’m not.
You’re always welcome to telephone to
see if I’m around, and if my door is
open you’re encouraged to enter and ask questions. The only
consistently awful times are those mornings before lecture, when I’m
often panicky. Lecturers work up until the last minute, too.

Lectures: MW 12:50 – 2:05 p.m.


Gates B03 (Broadcast Live on SCPD Channel E4)

TAs: Cristian Cadar (cristic@stanford.edu)


Tim Lipus (tlipus@stanford.edu)
Robert "Bear" Travis (proteus@stanford.edu)

The Class: CS143 is a first course in compilers, designed to introduce the student to
the principles and practices of programming language implementation.
We cover lexical analysis, parsing theory (LL, LR, and LALR parsing),
semantic analysis, runtime environments, code generation, and
optimization. The coursework will consist of regular programming
projects, a few pencil-and-paper problem sets, a midterm and a final
exam. The four programming projects comprise a series of milestones
that will ultimately lead to an operational compiler for a miniature
object-oriented programming language.

Having traced through and implemented the various phases of


compilation, you’ll gain a clear understanding of how a compiler works.
You’ll grow to appreciate the difficulties and trade-offs involved in
2

implementing a compiler or an interpreter for any programming


language. You’ll gain experience with commonly used tools in compiler
development and learn standard techniques that can be applied to a
variety of parsing problems. Exposure to programming language
implementation will strengthen your development and debugging skills
and generally aid your understanding of language and programming
issues. CS143 is one-third theory, two-thirds implementation, and the
algorithms we discuss in lecture map almost exactly to the way the actual
tools work.

The Student: The prerequisites are CS103B/X and CS107. You should be familiar with
the CS103B content: regular expressions, graphs, sets, context free
grammars, and formal languages. If you’ve never heard of these things
before, well... you can still take the course, but you’ll need to work on
your own and learn the material. You should have well-developed
programming and debugging skills, understand simple code generation
and function calling conventions, and have some exposure to different
language paradigms. The projects will require you to manage unfamiliar
tools, complex algorithms, and advanced programming techniques. It all
goes much more smoothly if you already know how to code as well as a
CS107 graduate.

Sections: Starting next week, we’ll lead one discussion section every Friday at 1:15
p.m. in Skilling 191 (broadcast live on SCPD Channel E3). I suspect this
time isn’t all that good for some of you, but luckily the sections are
videotaped and available online via scpd.stanford.edu. Section
attendance isn’t required any more than lecture attendance is, but you
can only benefit by participating. All section materials will be posted as
handouts on the course web site.

Units: CS143 is offered for 3 or 4 units. Undergraduates must take the course
for 4 units of credit. Graduate students may enroll for 3 units if their
registration constrains it to be the case. The course requirements are the
same for everyone, regardless of registration status.

Handouts: Course handouts will be distributed at the beginning of lectures and


leftover paper copies will be put in the bins in the entryway to the Gates
B wing. Look for the "CS143 Handouts Autumn 2007" label. If you miss
class and don’t find any extras, then someone stole your copy  and you
should print your own. SCPD students should always download their
copies from the web site. I promise to post all material to the website at
least 30 minutes prior to lecture, so those in TV land can get into the habit
of printing things out just before we go live.
3

Textbook: The course handouts cover all the material you need. As an optional text,
you might purchase Compilers: Principles, Techniques, and Tools by
Aho, Sethi, and Ullman (a.k.a. the "red dragon" book). This book is the
classic compiler text that provides a very thorough and solid treatment of
the material in spite of the fact that it’s way more material than anyone
could ever cover in a ten-week quarter. This text is not at all required,
but some students find it helpful as a reference or supplemental source.
The easiest way to secure your own copy is to just order it online from
Amazon.

Web: Everything you always wanted to know about CS143, but were afraid to
ask: http://cs143.stanford.edu. This site is the place to grab handouts,
read late-breaking announcements, scan the syllabus, and get general
course information. We will also maintain a FAQ page with common
questions and answers, clarifications, etc. about the current assignment.
You should also check the web page periodically for course
announcements.

Software: The programming projects are designed to run on Stanford’s Unix/Linux


machines (e.g., the elaines, the myths, the sagas, the brambles, the hedges,
and the new pods) and that is where we expect students to do their work.
However, the tools are open source, and you may be able to work on
other platforms if you are willing to manage the porting effort and press
through any porting drama. All assignments will be submitted on the
myth machines, so no matter where you do your work, you are
responsible for ensuring your final program compiles and runs under
Ubuntu Linux.

Mailing Lists: We’ll use a CS143 mailing list for important, late-breaking
announcements. All students enrolled in CS143 are automatically
subscribed to the cs143-aut0708-students@lists.stanford.edu mailing
list. The list server is in touch with Axess and automatically forwards all
messages to all those enrolled in the course. Please make it a point to
register for CS143 sometime before the weekend. You should inspect
your stanfordyou.stanford.edu privacy settings to ensure that some
email address is marked as public. If not, you’re excluded from the
mailing list, and you’ll miss out on all the gossip.
4

Staff email: You’re always welcome to email me directly, but there are times
when I’m away from a computer for more than a few hours. Unless
you need to address me specifically, you should probably send email
to all four of us, and you can more easily do that by emailing
compilers@cs.stanford.edu. The TAs have been instructed to
answer CS143 email as aggressively as possible, so you benefit by
mailing all of them at the same time. The TA who answers the most
email wins a brand new Wii.

Coursework: The assigned coursework consists of a sequence of programming projects


with 1 or 2 written problem sets mixed in. Over the course of the quarter,
you’ll build a working compiler for a simple object-oriented language.
History shows that students find the first two programming projects to
be relatively easy, and the last two programming projects to be quite
difficult and time consuming. Your programs will be graded almost
entirely on the output they produce. If your submission crashes or fails
to compile, then you’ll, in turn, crash or fail to compile once you get your
grade back. Be sure to thoroughly test your work before you submit.

Partners: You can choose to do the programming projects individually or work in


pairs. If you work with a partner, you hand in one copy, not two. Both
parties receive the same grade in all circumstances. If your partner fails
to implement his or her part, then you both end up losing.

Choose a partner you can trust. You can work individually on some
projects and with a partner on others, and you can switch partners any
time you want to. Feel free to use the newsgroup (su.class.cs143) to
find a partner if you want one.

Grading: This class is offered with both the graded and CR/NC options. The course
grading is divided between the programming assignments and problem
sets, a single midterm, and a final exam. The grade breakdown is:

Assignments 50 %
Midterm 20 %
Final 30 %

If you are taking the course CR/NC, you need to pull a C- or better in order
to pass. All students must take the final, including those taking the
course CR/NC who set the midterm curve and get perfect scores on every
single assignment.
5

Exams: The (closed-book, open-lecture-notes) midterm will be given on Monday,


November 5th from 7:00 p.m. – 10:00 p.m. in a location to be announced.
My midterms aren’t intentionally written to take three hours, but in the
interest of removing time pressure I give what I hope is more than an
adequate amount of time. If this time doesn’t work for you, then you’ll
need to take the exam during some three-hour window the next day.
Because the exam is held outside of normal class time, I am more than
happy to accommodate any reasonable requests. (SCPD students who
wish to come to campus are more than welcome to. Those who can’t can
download the exam once it’s posted to the Web and take it either
Monday night or first thing Tuesday morning.)

The three-hour, closed-book, open-lecture-notes final exam will be


offered twice during finals week.

Monday, December 10th at 8:30 a.m. and


Monday, December 10th at 12:15 p.m.

The first is the normally scheduled time, and the second is during the
time slot immediately after the first. Just pick the time that’s more
convenient for you, and show up. If you can’t make either one of these
times, then you need to have an exquisite reason, and I need to know
about this reason now. The final exam will emphasize material not tested
on the midterm.

Late Policy: The class material builds on itself and getting behind is taboo, since it
tends to impede progress on the following assignments via a domino
effect.

That being said, we all have our little meltdowns. I have my own little
meltdowns from time to time, so I expect some of you will too. No need
to email me with extension request, because you get to grant a few of
your own. You get five free "late days" (24-hour periods) that you may
use to extend the due dates of any assignment without penalty. You can
use up to two late days on any particular programming project or
handwritten assignment. Problem sets are always due at 5:00 p.m., and
programming projects are always due at midnight (with a small grace
period allowed for those fumbling with the submission script).

If you submit your work two minutes late, then, yes, I’ll give you the late
day back. If you submit your work 30 minutes late, no, I will not. If you
email me arguing that yes, while your submission was technically more
than two minutes late, it was considerably less than 30 minutes late, you
6

consume a late day for being obnoxious.  If you run out of freebies,
you can still turn in your work late, but it’ll cost you: I deduct 5% from
your homework average for each additional late day. This means you
don’t want to go beyond the five free ones.

Our late policy is pretty generous as far as late policies go. Requests for
additional late days are always denied unless the five free ones were
used for the very best of reasons.

Incompletes: You may take an incomplete in the class if and only if you've completed
everything except the last programming project and the final exam.
Unless you need the incomplete because of a personal emergency (death
of a close friend or family member, severe illness requiring you to remain
in bed or in the hospital), your grade will be capped at a B+.

Honor Code: Although you are encouraged to discuss ideas with others, your team’s
work is to be completed independently and should be original. Whenever
you obtain significant help (from other students, the TAs, students in other
classes) you should acknowledge their help in a README file or
somewhere on a written problem set submission, e.g. "The idea to use a
stack to help implement nested scopes came from a discussion with my
RCC, Scott 'Scooter' James." Any assistance that is not given proper
citation will be considered a violation of the Stanford Honor Code.

To be even more specific, you are not allowed to collaborate on the coding
of your programs, nor are you allowed to copy programs or even parts of
programs from other students. The following three activities are among
what I consider to be Honor Code violations in this course:

1. Looking at another student’s code (although looking at your


programming partner’s code is fine.)
2. Showing another student (other than a programming partner)
your code.
3. Discussing assignments in such detail that you duplicate a
portion of another team’s solution in your own.

Unfortunately, the Computer Science Department sees much, much more


than its share of plagiarism. Because it’s important that all cases of
academic dishonesty are identified for the sake of those playing by the
rules, we reserve our right to use software tools to compare your
submissions against those of all other current and past CS143 students. It
isn’t my intent to create some Big-Brother-Is-Watching environment with
moles and surveillance cameras. I’m just being clear about how far I’ll go
7

to make sure the consistently honest feel their honesty is valued and
rewarded. If the thought of copying code has never crossed your mind,
then you needn’t worry, because I’ve never seen a false accusation go any
further than a single email. But if you’re ever tempted to share code—
whether it’s because you don’t understand the material or you do
understand but you’re short on time—then you need to remember this
paragraph is here.

Vous aimerez peut-être aussi