Home |
Lectures |
Written Assignments |
Programming Assignments |
Exams |
Cool
CS 4610 — Programming Languages — Programming Assignments
Instructions
Start the programming assignments early! Completing the course
project is a large, complex, and rewarding task, which is made much easier
by giving adequate forethought to design. The course schedule allows ample
time to complete the assignments -- take advantage of it.
Documentation and structuring should be incorporated into programs from the
beginning. Neither instructors nor teaching assistants will help with
incomprehensible programs.
I highly recommend that you find an account on a Unix (or Mac OSX) machine
or that you install Cygwin on your
Windows machine.
The instructional lab machines should have OCaml, Ruby and Python
pre-installed.
Language Guides
Ocaml. Start with Jason Hickey's Introduction to Objective CAML
and move on to
the
official OCaml tutorial.
Ruby. You might consider
the
official Ruby in Twenty Minutes.
Python. Try the
official Beginner's Guide or Guido's Tutorial.
Cool. See the course webpage on Cool.
C. Google for "C tutorial" or somesuch. For example, try this tutorial from Drexel University.
- When in doubt, support gcc version 4.1.2 20080704 (Red Hat 4.1.2-51), x86_64-redhat-linux.
- (The x86_64 assembly output for PA6 and PA7 is also known to work
on gcc version 4.5.1 20100924 (Red Hat 4.5.1-4)
x86_64-redhat-linux).
Automatic Grading
-
Submit your assignment ZIP files via this course website.
- Note that your final grade for an assignment is based not only on
your performance on the automated test cases, but also on your coding,
README and software engineering (see below).
PA1: The Rosetta Stone
- Project Handout (also covers PA1c)
- Project Files
- pa1-hint.zip - Shows the same
simple program written in five languages.
- pa1-testcases.zip - Gives five
"starter" testcases to help you evaluate your work.
- Grading (out of 50)
- 40 points - for autograder tests (max 8 points per language)
- Each missed test removes points, to a minimum of 0/40, even if
there are more tests than total points.
- 5 points - for a correct PA1c submission
- 4 points - for a clear description in your README
- 4 - thorough discussion of design decisions (including language
comparisons) and choice of test cases; a few paragraphs
of coherent English sentences should be fine
- 2 - vague or hard to understand; omits important details
- 0 - little to no effort, or submitted an RTF/DOC/PDF file
instead of plain TXT
- 1 point - for a valid testcase.list file
- 5 points extra credit - for a valid survey completion code in your
README
PA2: The Lexer
- Project Handout
- Grading (out of 50)
- 37 points - for autograder tests (1 point per correct test,
maximum score of 37)
- Each missed test removes points, to a minimum of 0/37, even if
there are more tests than total points.
- 1 point - for a correct team.txt file
- 1 - file contains a single word: the uva email address of your
partner (e.g., wrw6y)
- 1 - file is not present at all, and you are working alone
- 0 - file is present but contains something other than the single
word of your partner's email address
- 4 points - for a clear description in your README
- 4 - thorough discussion of design decisions (including handling
of strings and comments) and choice of test cases; a few paragraphs
of coherent English sentences should be fine
- 2 - vague or hard to understand; omits important details
- 0 - little to no effort
- 4 point - for valid good.cl and bad.cl files
- 4 - wide range of test cases added, stressing most Cool features
and an error condition
- 2 - added some tests, but the scope not sufficiently broad
- 0 - little to no effort, or submitted an RTF/DOC/PDF file
instead of plain TXT
- 4 point - for code cleanliness
- 4 - code is mostly clean and well-commented
- 2 - code is sloppy and/or poorly commented in places
- 0 - little to no effort to organize and document code
PA3: The Parser
- Project Handout
- Grading (out of 50)
- 37 points - for autograder tests (1 point per correct test,
maximum score of 37)
- Each missed test removes points, to a minimum of 0/37, even if
there are more tests than total points.
- 1 point - for a correct team.txt file
- 1 - file contains a single word: the uva email address of your
partner (e.g., wrw6y)
- 1 - file is not present at all, and you are working alone
- 0 - file is present but contains something other than the single
word of your partner's email address
- 4 points - for a clear description in your README
- 4 - thorough discussion of design decisions (e.g., the handling
of let) and choice of test cases; a few paragraphs
of coherent English sentences should be fine
- 2 - vague or hard to understand; omits important details
- 0 - little to no effort, or submitted an RTF/DOC/PDF file
instead of plain TXT
- 4 point - for valid good.cl and bad.cl files
- 4 - wide range of test cases added, stressing most Cool features
and an error condition
- 2 - added some tests, but the scope not sufficiently broad
- 0 - little to no effort
- 4 point - for code cleanliness
- 4 - code is mostly clean and well-commented
- 2 - code is sloppy and/or poorly commented in places
- 0 - little to no effort to organize and document code
- -5 points - if you neglected to include the grammar definition
- 0 - included grammar definition in submission (e.g.,
.mly file, PLY file defining grammar, .y file for
racc, etc.)
- -5 - only submitted machine-generated parser; failed to submit
grammar from which parser was generated
PA4: The Semantic Analyzer
- Project Handout
- Grading (out of 100)
- 70 points - for autograder tests
- Each missed test removes points, to a minimum of 0/70, even if
there are more tests than total points.
- 5 points - for a correct PA4c submission
- 1 point - for a correct team.txt file
- 1 - file contains a single word: the uva email address of your
partner (e.g., wrw6y)
- 1 - file is not present at all, and you are working alone
- 0 - file is present but contains something other than the single
word of your partner's email address
- 8 points - for a clear description in your README
- 8 - thorough discussion of design decisions (e.g., handling
of the class hierarchy, case and new and dispatch)
and choice of test cases; a few paragraphs of coherent English
sentences should be fine
- 4 - vague or hard to understand; omits important details
- 0 - little to no effort, or submitted an RTF/DOC/PDF file
instead of plain TXT
- 8 point - for valid good.cl, bad1.cl,
bad2.cl and bad3.cl files
- 8 - wide range of test cases added, stressing most Cool features
and three error conditions
- 4 - added some tests, but the scope not sufficiently broad
- 0 - little to no effort
- 8 point - for code cleanliness
- 8 - code is mostly clean and well-commented
- 4 - code is sloppy and/or poorly commented in places
- 0 - little to no effort to organize and document code
- (The "PA4 Semantics Checkpoint" counts as a Written Assignment
and is graded separately.)
PA5: The Interpreter
- Project Handout
- Grading (out of 100)
- 70 points - for autograder tests
- Each missed test removes points, to a minimum of 0/70, even if
there are more tests than total points.
- 5 points - for a correct PA5c submission
- 1 point - for a correct team.txt file
- 1 - file contains a single word: the uva email address of your
partner (e.g., wrw6y)
- 1 - file is not present at all, and you are working alone
- 0 - file is present but contains something other than the single
word of your partner's email address
- 8 points - for a clear description in your README
- 8 - thorough discussion of design decisions (e.g., the handling
of let and new and dispatch)
and choice of test cases; a few paragraphs of coherent English
sentences should be fine
- 4 - vague or hard to understand; omits important details
- 0 - little to no effort, or submitted an RTF/DOC/PDF file
instead of plain TXT
- 8 point - for valid test1.cl, test2.cl,
test3.cl and test4.cl files
- 8 - wide range of test cases added, stressing most Cool features
and some error conditions
- 4 - added some tests, but the scope not sufficiently broad
- 0 - little to no effort
- 8 point - for code cleanliness
- 8 - code is mostly clean and well-commented
- 4 - code is sloppy and/or poorly commented in places
- 0 - little to no effort to organize and document code
CS 4501 — Compilers Practicum — Programming Assignments
Language Guides
x86-64. A number of on-line resources are available. I used these
when making the Reference Compiler.
Cool Assembly Language. The definitive source for the assembly
language definition as well as the machine model is the Cool Reference Manual.
PA6: The Compiler
- Project Handout
- Grading (out of 100)
- 70 points - for autograder tests
- 5 points - for a valid PA6c submission
- 1 point - for a correct team.txt file
- 1 - file contains a single word: the uva email address of your
partner (e.g., wrw6y)
- 1 - file is not present at all, and you are working alone
- 0 - file is present but contains something other than the single
word of your partner's email address
- 8 points - for a clear description in your README
- 8 - thorough discussion of design decisions (e.g., the handling
of let and new and dispatch)
and choice of test cases; a few paragraphs of coherent English
sentences should be fine
- 4 - vague or hard to understand; omits important details
- 0 - little to no effort, or submitted an RTF/DOC/PDF file
instead of plain TXT
- 8 point - for valid test1.cl, test2.cl,
test3.cl and test4.cl files
- 8 - wide range of test cases added, stressing most Cool features
and some error conditions
- 4 - added some tests, but the scope not sufficiently broad
- 0 - little to no effort
- 8 point - for code cleanliness
- 8 - code is mostly clean and well-commented
- 4 - code is sloppy and/or poorly commented in places
- 0 - little to no effort to organize and document code
PA7: The Optimizer
- Project Handout
- Grading (out of 100)
- 67 points - for optimizer performance tests
- -0 - performance better than "reference --opt"
- -17 - performance better than "reference" but worse than
"reference --opt'
- -33 - performance worse than "reference"
- -67 - performance worse than "0.9 * reference"
- 1 point - for a correct team.txt file
- 1 - file contains a single word: the uva email address of your
partner (e.g., wrw6y)
- 1 - file is not present at all, and you are working alone
- 0 - file is present but contains something other than the single
word of your partner's email address
- -20 points - total failure to implement control-flow graphs,
liveness and dead code elimination
- -10 points - partial failure to implement control-flow graphs,
liveness and dead code elimination
- 16 points - for a clear description in your README
- 16 - thorough discussion of design decisions (e.g., the handling
of the control flow graph, live variable analysis, dead code
elimination, how code generation and intermediate representations relate,
other optimizations performed)
and choice of benchmarks; multiple paragraphs of coherent English
sentences are required
- 8 - vague or hard to understand; omits important details
- 0 - little to no effort, or submitted an RTF/DOC/PDF file
instead of plain TXT
- 8 point - for valid benchmark1.cl and benchmark2.cl
- 8 - both examples take 50,000 instructions or fewer to execute
via the reference compiler with --asm --profile
- 4 - one benchmark is not valid
- 0 - no valid benchmarks included
- 8 point - for code cleanliness
- 8 - code is mostly clean and well-commented
- 4 - code is sloppy and/or poorly commented in places
- 0 - little to no effort to organize and document code