COM 1358 Assignment #6. Due: Thursday, 1 June 2000 Submit this assignment by sending email to will@ccs.neu.edu with a subject of "COM 1358 assignment 6". Be careful: Many email programs insert extra line breaks or truncate long lines. Either of these would corrupt your self-reproducing program, so be sure to test your email software before submitting this assignment. The interpreter of Figure 3.16 can be loaded into an implementation of R5RS Scheme as follows. % scheme > (begin (load "/course/com1358/pub/r5rs.scm") (load "/course/com1358/pub/define-datatype.scm") (load "/course/com1358/pub/sllgen.scm") (load "/course/com1358/pub/assignment6.scm")) If you are using Chez Scheme, Larceny, or DrScheme, you can substitute "chez.scm", "larceny.scm", or "drscheme.scm" for "r5rs.scm". If you are using DrScheme, you may also have to substitute "define-datatype-drscheme.scm" for "define-datatype.scm". 1. Time how long it takes to run the programs in /course/com1358/pub/EOPLsieve1.sch /course/com1358/pub/EOPLsieve2.sch Report these two timings, their units (e.g. CPU milliseconds), the machine on which you obtained them (e.g. archenar, a Sun Ultra 1 running at 167 MHz), the Scheme system you are using (e.g. Chez Scheme), and the optimization level (e.g. the default optimizations). 2. The two programs that you benchmarked in part 1 are identical except that EOPLsieve1.sch simulates call-by-name, while EOPLsieve2.sch simulates call-by-need. Which was faster? Why? 3. Add read statements to assignment6.scm as specified in exercise 3.9.1. Turn in the modified grammar and the modified code for execute-statement. 4. [If you did this for assignment #4, you do not need to do it again.] Write a complete Java application in a file named SelfReproducing.java that takes no inputs and writes its own source code to System.out. This program should not perform any i/o except for printing to System.out. Turn in the complete source code for SelfReproducing.java, preferably as an attachment to your email. If you do this correctly, the diff command below should produce a line of zeroes. % javac SelfReproducing.java % java SelfReproducing > temp % diff SelfReproducing.java temp | wc 0 0 0