16.01.2015 Views

CS2013-final-report

CS2013-final-report

CS2013-final-report

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

15-150: Functional Programming, Carnegie Mellon University<br />

Pittsburgh, PA, USA<br />

Daniel R. Licata and Robert Harper<br />

{drl,rwh}@cs.cmu.edu<br />

http://www.cs.cmu.edu/~15150/previous-semesters/2012-spring/<br />

Knowledge Areas that contain topics and learning outcomes covered in the course<br />

Knowledge Area<br />

Total Hours of Coverage<br />

Programming Languages (PL) 18<br />

Parallel and Distributed Computing (PD) 9<br />

Algorithms and Complexity (AL) 8<br />

Software Development Fundamentals (SDF) 7<br />

Discrete Structures (DS) 5<br />

Software Engineering (SE) 1<br />

Where does the course fit in your curriculum<br />

Functional Programming is a required course, and is typically taken in a student’s first, second, or third semester.<br />

Carnegie Mellon’s required introductory CS courses consist of this course on functional programming, a course on<br />

imperative programming, a course on discrete math, a course on parallel data structures and algorithms, and a course<br />

on computer systems. The only prerequisite for Functional Programming is a basic math course, though students<br />

usually have some prior programming experience. Functional Programming is a prerequisite for the parallel data<br />

structures and algorithms course. The course typically has an enrollment of 200-250 students per semester.<br />

Approximately 1/3 to 1/2 of the students are CS majors, though most of the remaining students are intending to<br />

minor or switch to a CS major.<br />

What is covered in the course<br />

The four key skills that students learn are<br />

• to write parallel functional programs<br />

• to analyze programs’ sequential and parallel time complexity<br />

• to write mathematical specifications and verify that programs meet them<br />

• to structure programs using modules and abstract types<br />

One central principle of the course design is that the skills of writing, analyzing, and verifying parallel programs are<br />

integrated throughout the semester, rather than separated into units. In the first three weeks of the course, students<br />

learn to write basic sequential functional programs on numbers and lists, to analyze their time complexity, and to<br />

prove mathematical correctness specifications using induction. Parallelism is introduced in the fourth week:<br />

Students learn to write data-parallel functional programs. They learn to analyze not just the usual sequential<br />

complexity of programs, but their parallel complexity, and how this influences algorithm and data structure design.<br />

An early example is sorting: One might think that mergesort would have logarithmic parallel complexity, because as<br />

a sorting problem is repeatedly divided in half, the length of the longest dependency is logarithmic. However, with<br />

lists as the data structure, mergesort has a linear parallel complexity, because just the operation of splitting a list into<br />

two halves takes linear time, independently of how many processors are available. This motivates studying<br />

mergesort on trees, which has a sublinear parallel complexity. Because the parallelism is deterministic, students can<br />

reason about the behavior of their programs as if they were sequential, but run them in parallel. These<br />

programming, analysis, and verification skills continue to be interwoven throughout the remainder of the course, as<br />

students learn more advanced techniques.<br />

- 384 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!