Programming Languages

Investigate the basic concepts behind programming languages, with an emphasis on the techniques and benefits of functional programming. Use the programming languages ML, Racket, and Ruby to learn how the pieces of a language fit together to create more than the sum of the parts. Gain new software skills and the concepts needed to learn new languages on your own.


Course at a Glance

About the Course

Learn many of the concepts that underlie all programming languages. Use functional programming and contrast it with object-oriented programming. Through experience writing programs and studying three different languages, learn the key issues in designing and using programming languages, such as modularity and the complementary benefits of static and dynamic typing. This course is neither particularly theoretical nor just about programming specifics – it will give you a framework for understanding how to use language constructs effectively and how to design correct and elegant programs. By using different languages, you learn to think more deeply than in terms of the particular syntax of one language. The emphasis on functional programming is essential for learning how to write robust, reusable, composable, and elegant programs – in any language.

Beginning with the Fall 2014 offering, verified certificates are available for this course. The certificates look slightly different than for courses from other institutions. Here is an example.

Course Syllabus

Note: About half the students completing prior offerings report an estimated workload of 8-12 hours / week is accurate while most of the other half spent more time -- 15 hours / week or more. Workload naturally differs for different people depending on one's background. Do see the recommended-background section below.

Topics (most of which may not mean anything to you until you take the course):

  • Syntax vs. semantics vs. idioms vs. libraries vs. tools
  • ML basics (bindings, conditionals, records, functions)
  • Recursive functions and recursive types
  • Benefits of no mutation
  • Algebraic datatypes, pattern matching
  • Tail recursion
  • First-class functions and function closures
  • Lexical scope
  • Currying
  • Syntactic sugar
  • Equivalence and effects
  • Parametric polymorphism and container types
  • Type inference
  • Abstract types and modules
  • Racket basics
  • Dynamic vs. static typing
  • Laziness, streams, and memoization
  • Implementing languages, especially higher-order functions
  • Macros
  • Eval
  • Ruby basics
  • Object-oriented programming is dynamic dispatch
  • Pure object-orientation
  • Implementing dynamic dispatch
  • Multiple inheritance, interfaces, and mixins
  • OOP vs. functional decomposition and extensibility
  • Subtyping for records, functions, and objects
  • Subtyping
  • Class-based subtyping
  • Subtyping vs. parametric polymorphism; bounded polymorphism

Recommended Background

The course assumes students are familiar with programming covered by most introductory courses -- this is not an introductory programming course.  Conversely, it is also not a particularly advanced course -- a couple good prior programming courses should be enough.  Students should be comfortable with variables, conditionals, arrays, linked lists, stacks, and recursion (though recursion will be reviewed and expanded upon), and the difference between an interface and an implementation. Students should be eager to write programs in languages new to them.  Later parts of the course analyze basic object-oriented concepts and contrast them with those of other languages, so familiarity with Java or a closely related language (e.g., C#) is helpful, but not required for homework assignments.

Suggested Readings

Course videos and programming exercises serve as the bulk of class content. Written notes by the instructor are also available and serve as a valuable resource.

Course Format

Video segments have short question-and-answer sections, but the main work will be seven homework assignments that involve writing small programs. The programming assignments will be automatically graded and students will peer-assess each other's submissions for style. Critiquing other’s work and receiving comments about your own are invaluable learning experiences. The course also has a midterm exam and a final exam.