CS 94SI: Cross-Paradigm Programming with Scala

Spring 2008

Handouts | Assignments | References | Grading policy | Collaboration policy
Logistics: Contact: Course leaders: Faculty advisor:
1 unit, C/NC only
Wednesdays 4:15pm - 5:45pm
Gates 260 Gates B12
Staff mailing list
Scala mailing list
Scala IRC channel
Ben Newman
Jorge Ortiz
Julien Wetterwald
Mehran Sahami


Programming language design as exemplified by Scala, a new type-safe language that combines functional and object-oriented aspects at the language level and targets the Java Virtual Machine. Scala's type inference system and the promise of "scalable component abstractions" for software systems. Applications to concurrent programming and domain specific languages. Weekly readings. There will be 4-7 mandatory assignments.

Please note that this is a Student Initiated course so is classified as an "activity unit" and will not satisfy degree requirements.


Academic exposure to at least two programming languages; CS107 recommended.


  1. Syllabus
  2. Slides: A Tour of the Scala Programming Language
  3. Syntax Handout #1
  4. Example: mastermind.scala
  5. Example: rational.scala
  6. Slides: Mix-in composition
  7. Slides: Types
  8. Understanding variance (soon)
  9. Example: person.scala
  10. Example: buffer.scala
  11. Example: button.scala, InnerClass.java
  12. Example: iterable.scala
  13. Syntax Handout #2 (soon)
  14. Slides: Unifying Object-Oriented and Functional Programming
  15. Slides: Streams
  16. Slides: Implicits & DSLs
  17. Slides: Concurrent Paradigms
  18. Slides: lift
  19. Slides: For expressions and Software Composition


  1. Pure functional programming
  2. Object-oriented programming (Assignment2.scala)
  3. Pattern matching (Expressions.scala)
  4. None


Grading policy

The course is graded on a C/NC basis only. To receive a passing grade, you must complete all but one of the weekly assignments and participate actively in class.

The course description on Axess incorrectly states that weekly assignments are optional and that there is a mandatory final project. There will be no final project. Weekly assignments are mandatory.

Collaboration policy

You are encouraged to discuss their ideas with others. However, you should work on your programs independently and hand in original code. If you receive significant help from others, you should attribute them when handing in your assignments.

Class Mailing List

Signing up for the class on Axess will automatically subscribe you to the class mailing list. Please make sure to do so as soon as possible.


Auditors are welcome, but please make sure to sign up for the class mailing list manually by visiting: https://mailman.stanford.edu/mailman/listinfo/cs94si-spr0708-students

Scala Version

The class will use the Scala 2.7.0-final release of the language. It can be obtained from: http://www.scala-lang.org/ Instructions on how to install Scala will be included in the first assignment.

"Scala lift off" Conference

On Saturday, May 10th a Scala/lift conference will be held in San Francisco. The conference is free for students (free lunch is provided). This is a fantastic opportunity to meet many of the people in the Scala and lift communities, including Prof. Martin Odersky. Please register for the conference at: http://scalaliftoff.com/liftoff/