@@ -10,18 +10,26 @@ completed project.
1010Final deliverables are due by the end of the time schedule for the
1111class 's final exam as set by the registrar.
1212
13- Submissions should be made on Gradescope .
13+ There are several projects to choose from, described below .
1414
15- Descriptions of potential projects will be released later in the semester
16- and announced in class.
15+ Compared to assignments, the project is more open-ended. You will
16+ need to select from a project description below and then select which
17+ language you'd like to target with your project. As starter code, you
18+ can use the source code of any of the course languages. How you
19+ implement your project is up to you. It may involve changes to all
20+ aspects of the language implementation: the parser, the compiler, and
21+ the run-time system (however, we do not require an interpreter
22+ implementation). No tests are provided, so we recommend you write your
23+ own and suggest focusing on tests @emph{before} trying to implement
24+ these features.
1725
18- @;{
19- There are several projects to choose from, described below.
26+ In addition to the source code for your project, you must write a
27+ 2-page document in PDF format, which gives a summary of your work and
28+ describes how your project is implemented.
2029
21- In addition the source code for your project, you must write a 2-page
22- document which gives a summary of your work and describes how your
23- project is implemented.
30+ @table-of-contents[]
2431
32+ @;{
2533@section{a86 optimizer}
2634
2735Our compiler is designed to be simple and easy to maintain. That
@@ -185,6 +193,7 @@ know statically which function is being called.
185193There are many other optimziations you might consider. Think about
186194the kinds of expressions you might write and how they can be
187195simplified, then figure out how to do it programmatically.
196+ }
188197
189198@section{Multiple return values}
190199
@@ -270,7 +279,7 @@ to use @racket['rax] for the common case of a single result.) The
270279solution for this problem with function parameters was to use the
271280stack and a similar approach can work for results too.
272281
273- @section{Exceptions and Exception Handling }
282+ @section{Exceptions and exception handling }
274283
275284Exceptions and exception handling mechanisms are widely used in modern
276285programming languages. Implement Racket's @racket[raise] and
@@ -440,119 +449,58 @@ semester:
440449 its scope is appropriate for a final project.}
441450]
442451
452+ }
443453
444454@;{
455+ @section{Pattern matching}
445456
457+ Racket, OCaml, Rust, Scala, and many other programming languages
458+ support pattern matching. Extend
459+ }
446460
447- @(define repo "https://classroom.github.com/a/t5KO9b5- " )
448-
449- The goal of this project is to put together everything you've
450- learned over the semester to complete a full-featured compiler.
451-
452- Project repository:
453- @centered{@link[repo repo]}
454-
455- @link["code/project.pdf " ]{Slides} from lecture on the project.
461+ @section{Garbage collection}
456462
457- You are given a working compiler for an extension of the language we
458- have been developing all semester.
463+ Racket, OCaml, Java, JavaScript, Ruby, and many, many other languages
464+ use garbage collection as the means of deallocating memory. Implement
465+ a garbage collector.
459466
460- Your overall object is to improve the @emph{run-time} performance of
461- code generated by your compiler while maintaining correctness .
467+ You may choose to implement this feature for any language that is
468+ @seclink[ " Loot " ]{Loot} or later .
462469
463- There will be two releases of benchmark programs :
470+ Here are the key features that need to be added :
464471
465472@itemlist[
466- @item{Tuesday 12/3 }
467- @item{Tuesday 12/10 }
468- ]
469-
470- The final due date for your project is 10:30 AM on Saturday 12/14.
471-
472- You will have an allowance of 10 minutes to @emph{compile} all benchmark
473- programs. Exceeding the allowance result in a penalty, but there is
474- no reward for improving @emph{compile-time} performance so long as you
475- come in under the 10 minute mark.
476-
477- You will have an allowance of 10 minutes to @emph{run} all benchmark
478- programs. For full-credit, you must improve the overall run-time
479- performance by 20\%. Run-time will compute as the average of three
480- runs, done on the GRACE cluster.
481-
482- Full credit solutions will be entered in a compiler tournament to
483- determine the most performant (and correct) compiler. Tournament
484- results do not count toward your grade and will involve compiling
485- programs not included in the benchmark suite.
486-
487- Benchmark programs will be batch I/O programs: read some input,
488- compute something, produce a result and/or write some output.
489-
490- I/O primitives include @racket[read-char], @racket[write-char]
491- (limited to the standard input and output ports).
492473
493- The compiler supports a standard library, with source level
494- definitions provided to you. See the @racket[stdlib] function
495- in the compiler.
474+ @item{all language constructs that allocate memory should check that
475+ the current state of the heap can accomodate an allocation before
476+ performing it, and if not, doing a garbage collection and trying
477+ again. If there is still not possible to accomodate the allocation,
478+ an error should be signalled.}
496479
497- There will be a garbage collector provided by the second round of
498- benchmarks which you will need to incorporate in to your compiler.
480+ @item{@racket[(collect-garbage)] will run a garbage collection and
481+ return void.}
499482
500- @section[#:tag-prefix "fp- " #:style 'unnumbered ]{Measuring run-times}
483+ @item{@racket[(current-memory-use)] will return the number of bytes
484+ current allocated in the heap. This operation should not run a
485+ garbage collection and should not trace reachable objects in the heap.
486+ Instead it should simply return the total size, in bytes, that are
487+ currently allocated in the heap.}
501488
502- Let's look at an example of how to measure the run-time performance of
503- the code your compiler generates.
504-
505- First, let 's start with fairly computationally intensive program.
506- Here is a @link["code/fp/sieve.rkt " ]{program} that computes the
507- @emph{n}th prime number using the ancient
508- @link["https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes " ]{Sieve of
509- Eratosthenes} method.
510-
511- Save it to the directory where your compiler lives and run @tt{make
512- sieve.run}. This will run the compiler to generate the @tt{sieve.run}
513- executable. This program expects to read a number from the standard
514- input port.
515-
516- Run:
517-
518- @centered{@tt{echo -n 100 | ./sieve.run}}
519-
520- to compute the 100th prime number.
521-
522- To measure the time it takes, add the time command:
523-
524- @centered{@tt{echo -n 100 | time ./sieve.run}}
525-
526- This will run the program and show the result @emph{and } timing
527- information. We will be concerned with improving the real time it
528- takes to run the program.
529-
530-
531- @section[#:tag-prefix "fp- " #:style 'unnumbered ]{Testing}
532-
533- @bold{There is separate a repository for tests.} When you push your
534- code, Travis will automatically run your code against the tests. If
535- you would like to run the tests locally, clone the following
536- repository into the directory that contains your compiler and run
537- @tt{raco test .} to test everything:
489+ @item{@racket[(dump-memory-stats)] prints information about the
490+ current stack and heap and returns void. See the @tt{iniquity-gc}
491+ langauge for an example.}
492+ ]
538493
539- @centered{@tt{https://github.com/cmsc430/fp-test.git}}
540494
541- This repository will evolve as the week goes on, but any time there's
542- a significant update it will be announced on Piazza.
543495
544- @section[#:tag-prefix "fp- " #:style 'unnumbered ]{Submitting}
545-
546- Pushing your local repository to github ``submits'' your work. We
547- will grade the latest submission that occurs before the deadline.
548- }
549-
550- }
551496
552497@section{Design your own}
553498
554499You may also design your own project, however, you will need to submit
555500a one-page write-up that documents what you plan to do and how you
556501will evaluate whether it is successful. You must submit this document
557- and have it approved by the instructor by April 29th.
558- }
502+ and have it approved by the instructor by XXX.
503+
504+ @section[#:tag "project " ]{Submitting}
505+
506+ Submissions should be made on Gradescope.
0 commit comments