314-CSCE Programming Languages

Syllabus

Course Essentials

CourseCSCE 314 – Programming Languages, MWF 10:20 am – 11:10 am, Zachry Engineering Center 105B
InstructorJaakko Järvi
Course pageshttp://courses.cse.tamu.edu/jarvi/2009/CSCE-314
Contactjarvi@cse.tamu.edu
Office hoursBy appointment (my office is 416)
PrerequisiteCPSC 221.
Teaching AssistantXiaolong Tang (xiaolong@cse.tamu.edu), office hours: Tue and Thu 1:30 pm – 3:30 pm, 414D HRBB
Peer TeacherTravis Kosarek (tmk2948@neo.tamu.edu)

News

  • Tue Nov 15: Assignment 7 out
  • Tue Nov 3: Assignment 6 out (the skeleton code is not yet released)
  • Wed Oct 21: Assignment 5 out (the skeleton code is not yet released)
  • Midterm exam will be on Monday, Oct 26th (regular class hours)
  • Fri, Oct 10: Assignment 4 out.
  • Thu, Sep 24: Assignment 3 out.
  • Mon, Sep 14: Assignment 2 out.
  • Fri, Sep 4: Assignment 1 out.

In a nutshell

Explores the design space of programming languages via an in-depth study of two programming languages, one object-oriented (Java), one functional (Haskell); focuses on idiomatic uses of each language, and on features characteristic for each language.

Administrativia

Grading

Current grades

20% of your course grade will be based on assignments and quizzes 40% on the mid-term and 40% on the final exam. Participation, or more accurately, lack of it, can influence your grade you achieve otherwise, from assignments and on your project or exams, negatively, up to 10%. A grade of 90% or above guarantees an A, 80% or above a B, 70% or above a C, and 60% or above a D.

All grade assignments are final—unless there was a mistake made in recording your semester grades or in computing your final grade. If all numbers are correctly recorded and computed, I will not discuss changing the resulting letter grades.

There are situations that may warrant regrading a particular assignment. For example, making addition errors in computing your score, not seeing an answer that you gave, or not understanding an answer that you gave. Requests for regrading of assignments must be made within one week after the graded work has been handed back.

Policies

Academic Integrity Policy: An Aggie does not lie, cheat, or steal or tolerate those who do. The Honor Council Rules and Procedures are available on the web http://www.tamu.edu/aggiehonor.

Americans with Disabilities Act (ADA) Policy: The Americans with Disabilities Act (ADA) is a federal anti-discrimination statute that provides comprehensive civil rights protection for persons with disabilities. Among other things, this legislation requires that all students with disabilities be guaranteed a learning environment that provides for reasonable accommodation of their disabilities. If you believe you have a disability requiring an accommodation, please contact the Department of Student Life, Services for Students with Disabilities, in Room 126 of the Koldus Building or call 845-1637.

Topics

We use the following Haskell book, it is required:

Graham Hutton: Programming in Haskell, Cambridge University Press.

In addition, you will need some Java book (regarded as more of reference material), such as:

Java(TM) Programming Language, by James Gosling, Ken Arnold and David Holmes; 4th edition, Prentice Hall, 2006.

Other recent books about Java are suitable as well. Not all of the books will be covered, and other material is used as well.

The course aims to deepen understanding on the concepts and features of programming languages, and how programming languages work. After a general overview of language processing, we study the features of Haskell, focusing on what constitutes a functional programming language. Non-exhaustive list of what follows is:

  • Types, static typing and type inference
  • Parametric polymorphism
  • Higher-order functions, closures
  • Recursive types and functions
  • Algebraic data types
  • Abstract data types and modules
  • Type classes
  • Effects in a ``pure'' language

Along the way, we cover the basic ingredients of a programming language implementation, including:

  • Grammars, lexing and parsing
  • Abstract syntax, internal representations
  • Types and type checking
  • Interpretation, optimization, code generation

We use Haskell to implement a small imperative programming language as course assignments.

The Java portion of the class focuses on the major features of a modern object-oriented programming language, and focuses on interesting language features and the language infrastructure of Java, including:

  • Subtyping and inheritance
  • Subtype polymorphism
  • Exception handling
  • Generics, wildcards
  • Reflection
  • Concurrency

Programming languages are a very large area. The course aims at providing an understanding of the use, efficiency considerations, and implementation approaches of common abstraction mechanisms and language constructs in modern programming languages. I hope that the course will allow you to more effectively use the languages of today, make it easier for you to learn new programming languages in the future, and possibly get excited about contributing to research and development in the area of programming languages in the future. Even though we use and study two specific programming languages, Haskell and Java, learning more of these languages should be considered as a nice side benefit of the course, not the main goal.


Schedule and material

DateTopicMaterial
Mon, Aug 31IntroductionSlides 1: pdf 4up.pdf, Slides 2: pdf 4up.pdf
Wed, Sep 2Haskell & Functional Programming BasicsSlides 3: pdf 4up.pdf
Fri, Sep 4Haskell & Functional Programming Basics
Mon, Sep 7Haskell & Functional Programming Basics
Wed, Sep 9Pattern matching, comprehensions, higher-order functionsSlides 4: pdf 4up.pdf
Fri, Sep 11Pattern matching, comprehensions, higher-order functions
Mon, Sep 14Higher-order functions
Wed, Sep 16Data types, type classesSlides 5: pdf 4up.pdf
Fri, Sep 18Data types, type classes
Mon, Sep 21Syntactic analysisSlides 6: pdf 4up.pdf
Wed, Sep 23Syntactic analysis
Fri, Sep 25ModulesSlides 7: pdf 4up.pdf
Mon, Sep 28Functional ParsersSlides 8: pdf 4up.pdf
Wed, Sep 30Functional Parsers
Fri, Oct 2Example language, MonadsExprParser.hs Slides 9: pdf 4up.pdf
Mon, Oct 5Run-time structures (by Xiaolong Tang)pdf 4up.pdf
Wed, Oct 7IO
Fri, Oct 9Monads
Mon, Oct 12Monads, Types and typecheckingpdf 4up.pdf
Wed, Oct 14Types and typechecking
Fri, Oct 16Types and typechecking
Mon, Oct 19Types and typechecking
Wed, Oct 21Implementing a typechecker, Reader MonadReader.hs
Fri, Oct 23Writer, State, and Error Monads.Writer.hs State.hs Error.hs
Mon, Oct 26Exam
Wed, Oct 28Operational semanticspdf 4up.pdf
Fri, Oct 30Basics of OOpdf 4up.pdf
Mon, Nov 2Basics of OO
Wed, Nov 4Basics of OO
Fri, Nov 6Generics and OOpdf 4up.pdf
Mon, Nov 9Generics
Wed, Nov 11Co/contravariance
Fri, Nov 13Wildcards
Mon, Nov 16Type Erasure
Wed, Nov 18Java Reflectionpdf 4up.pdf examples
Fri, Nov 20Java Inner classes and closurespdf 4up.pdf
Mon, Nov 23Concurrency in Javapdf 4up.pdf examples
Wed, Nov 25Concurrency in Java
Fri, Nov 27No class, Thanksgiving
Mon, Nov 30
Wed, Dec 2
Wed, Dec 4
Mon, Dec 7

Assignments

Assignment 1Due on Friday, 11th of September
Assignment 2Due on Monday, 21st of September
Assignment 3, CliteLexer.hs, test.clDue on Monday, 5th of October
Assignment 4, a4.tarDue on Monday, 19th of October
Assignment 5, a5.tarDue on Friday, 30th of October
Assignment 6, a6.tarDue on Wednesday, 11th of November
Assignment 7Due on Sunday, 29th of November

Exams

There will be two exams, Midterm and Final. The first exam will be on Monday, Oct 26th, during regular class hours. Exam is based on lectures and discussions in class, all slides, assignments 1–4, and chapters 1–10 (inclusive) from the Haskell book.

Resources

Software

Many programming assignments will be done with Haskell, here are a few pointers to get you started:

Material useful for specific assignments:

Using GHC

A few other compilers exist, but we will use the Glasgow Haskell Compiler. An easy way to interact with GHC is to edit your document, say, Foo.hs in your favourite editor (== Emacs, with haskell-mode), and invoke the GHC interpreter in a shell window:

ghci -fglasgow-exts

The most commonly used commands are

  • :l Foo to load the module Foo (from your file Foo.hs)
  • :r to re-load the previously loaded module
  • :i x to inspect the value, type, … x
  • :q to quit the interpreter

The compiler is invoked, for example as:

ghci -fglasgow-exts --make

The --make option chases automatically which modules need to be recompiled, so you don't have to write a Makefile yourself. (Also GHC's analysis of what need to be recompiled is more fine grained, thus faster).

GHC and Emacs in linux.cs.tamu.edu

To set up ghc with Emacs, follow the directions below:

  1. Create a .emacs file (if you don't have one)
  2. Add the following to your .emacs
(load "/home/faculty/jarvi/lib/emacs/haskell-mode/haskell-site-file")

(add-hook 'haskell-mode-hook 'turn-on-haskell-ghci)
(add-hook 'haskell-mode-hook 'turn-on-font-lock)

(add-hook 'haskell-mode-hook 
          (function
           (lambda ()
             (setq haskell-program-name "ghci"))))

(setq haskell-ghci-program-args '("-fglasgow-exts"))
  1. Launch emacs, start editing some Haskell file, such as a1.hs.
  2. C-c l launches the interpreter and loads the current file.

Author: Jaakko Jarvi <jarvi@cse.tamu.edu>

Date: 2009-11-23 13:22:52 CST

HTML generated by org-mode 6.32trans in emacs 22