Download: project0.zip

Due: Tuesday, 22 January 2013 at 11:59:59pm

To Submit: Go Here

Overview

This project provides an introduction to OCaml programming and some warm-up exercises involving tree manipulation and recursive programming (both of which will be highly useful when building the compiler). It will also familiarize you with the basic workflow of the projects in this course, including the testing framework that we will use to (partially) automate the grading of your projects.

Before you begin:

For help on how to get started with OCaml see the toolchain web pages and the Caml web site.

Please also take some time to skim the available resources on the course homepage -- in particular, the book Introduction to Objective Caml provides a very good reference for learning OCaml. In the problems below when you see a note like "See IOC 5.2" please refer to the corresponding section of the book.

It is not possible to cover all of OCaml's features in just a couple weeks, so we expect you to be able to learn most of what you need on your own.

Also, please feel free to ask a course staff member for help -- post on Piazza to make sure you reach everyone who might be available for help.

Getting Started

Unlike future projects, most of the instructions for this project are found as comments in the source files of project0.zip. To get started on this project, follow the instructions below. They assume that you will be developing your project code in Eclipse with the OcaIDE OCaml plugin. See the toolchain web pages for help getting your Eclipse installation set up.

The instructions below walk you through downloading and compiling this project for development in Eclipse. You will need to do a similar configuration process to import future project codebases too. Using Eclipse, while recommended, is not mandatory. The toolchain documentation gives a command-line oriented alternative, which can be helpful when you test later projects, or if you choose to use a different code editor (Emacs or vim both have good OCaml support).

First, download the project source and import it into Ecplise as a new project as directed on the toolchain web pages. If all was successful, Eclipse should pop up a Console window with the output of running the main program's test cases. You should see output like this:

Student-Provided Tests For Problem 1-3:
  case1: failed - Problem 3 case1 test unimplemented
  case2: failed - Problem 3 case2 test unimplemented
  case3: failed - not equal
Problem1-1 (0/3 points)
  pieces: failed - not equal
  cube0: failed - cube unimplemented
  cube1: failed - cube unimplemented
  cube2: failed - cube unimplemented
  cube3: failed - cube unimplemented
Problem1-2 (0/3 points)
  cents_of1: failed - cents_of unimplemented
  cents_of2: failed - cents_of unimplemented
  cents_of3: failed - cents_of unimplemented
  cents_of4: failed - cents_of unimplemented
  cents_of5: failed - cents_of unimplemented
  cents_of6: failed - cents_of unimplemented
  cents_of7: failed - cents_of unimplemented
Problem1-3 (??/3 points):
  Hidden
...
 
This output shows the results of test cases we provide. Some of the cases are available for you to see (such as Problem1-1), some tests will be written by you, and others are hidden in reserve for testing your final project.

Continue this project by browsing to the hellocaml.ml file in Eclipse and following the instructions (in comments) there.

What to submit

Submit hellocaml.ml, providedtests.ml, and team.txt (editted appropriately).

Submit it by following this link.

Grading

Projects that do not compile will receive no credit!

Your grade for this project will be based on:

You have 3 free attempts to submit your project, after which each extra attempt will cost you 5 penaly points.
Last modified: Thu Jan 10 17:27:29 EST 2013