{"size": 4165, "ext": "scrbl", "max_stars_repo_path": "www/project.scrbl", "max_stars_repo_name": "plum-umd/cmsc838e", "max_stars_repo_stars_event_min_datetime": "2021-01-27T00:45:41.000Z", "max_stars_repo_stars_event_max_datetime": "2021-01-27T00:45:41.000Z", "max_issues_repo_path": "www/project.scrbl", "max_issues_repo_name": "plum-umd/cmsc838e", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "www/project.scrbl", "max_forks_repo_name": "plum-umd/cmsc838e", "max_forks_repo_forks_event_min_datetime": "2021-04-16T11:44:17.000Z", "max_forks_repo_forks_event_max_datetime": "2021-04-16T11:44:17.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 34.7083333333, "max_line_length": 72, "alphanum_fraction": 0.775270108}
#lang scribble/manual
@(require "defns.rkt")
@title[#:style '(unnumbered)]{Project}

There will be a final course project to be completed over the last
several weeks of the course.  The project will involve extending the
design and implementation of the programming language and its compiler
that we will develop throughout the semester.

Details will be announced later in the semester.

@;{

@itemlist[
  @item{Final Project Assessment: @bold{@final-date}}
]

@(define repo "https://classroom.github.com/a/t5KO9b5-")

The goal of this project is to put together everything you've
learned over the semester to complete a full-featured compiler.

Project repository:
@centered{@link[repo repo]}

@link["code/project.pdf"]{Slides} from lecture on the project.

You are given a working compiler for an extension of the language we
have been developing all semester.

Your overall object is to improve the @emph{run-time} performance of
code generated by your compiler while maintaining correctness.

There will be two releases of benchmark programs:

@itemlist[
@item{Tuesday 12/3}
@item{Tuesday 12/10}
]

The final due date for your project is 10:30 AM on Saturday 12/14.

You will have an allowance of 10 minutes to @emph{compile} all benchmark
programs.  Exceeding the allowance result in a penalty, but there is
no reward for improving @emph{compile-time} performance so long as you
come in under the 10 minute mark.

You will have an allowance of 10 minutes to @emph{run} all benchmark
programs.  For full-credit, you must improve the overall run-time
performance by 20\%.  Run-time will compute as the average of three
runs, done on the GRACE cluster.

Full credit solutions will be entered in a compiler tournament to
determine the most performant (and correct) compiler.  Tournament
results do not count toward your grade and will involve compiling
programs not included in the benchmark suite.

Benchmark programs will be batch I/O programs: read some input,
compute something, produce a result and/or write some output.

I/O primitives include @racket[read-char], @racket[write-char]
(limited to the standard input and output ports).

The compiler supports a standard library, with source level
definitions provided to you.  See the @racket[stdlib] function 
in the compiler.

There will be a garbage collector provided by the second round of
benchmarks which you will need to incorporate in to your compiler.

@section[#:tag-prefix "fp-" #:style 'unnumbered]{Measuring run-times}

Let's look at an example of how to measure the run-time performance of
the code your compiler generates.

First, let's start with fairly computationally intensive program.
Here is a @link["code/fp/sieve.rkt"]{program} that computes the
@emph{n}th prime number using the ancient
@link["https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes"]{Sieve of
Eratosthenes} method.

Save it to the directory where your compiler lives and run @tt{make
sieve.run}.  This will run the compiler to generate the @tt{sieve.run}
executable.  This program expects to read a number from the standard
input port.

Run:

@centered{@tt{echo -n 100 | ./sieve.run}}

to compute the 100th prime number.

To measure the time it takes, add the time command:

@centered{@tt{echo -n 100 | time ./sieve.run}}

This will run the program and show the result @emph{and} timing
information.  We will be concerned with improving the real time it
takes to run the program.


@section[#:tag-prefix "fp-" #:style 'unnumbered]{Testing}

@bold{There is separate a repository for tests.} When you push your
code, Travis will automatically run your code against the tests.  If
you would like to run the tests locally, clone the following
repository into the directory that contains your compiler and run
@tt{raco test .} to test everything:

@centered{@tt{https://github.com/cmsc430/fp-test.git}}

This repository will evolve as the week goes on, but any time there's
a significant update it will be announced on Piazza.

@section[#:tag-prefix "fp-" #:style 'unnumbered]{Submitting}

Pushing your local repository to github ``submits'' your work.  We
will grade the latest submission that occurs before the deadline.

}