314-CSCE Programming Languages
Syllabus
Course Essentials
| Course | CSCE 314 – Programming Languages, MWF 10:20 am – 11:10 am, Zachry Engineering Center 105B |
| Instructor | Jaakko Järvi |
| Course pages | http://courses.cse.tamu.edu/jarvi/2009/CSCE-314 |
| Contact | jarvi@cse.tamu.edu |
| Office hours | By appointment (my office is 416) |
| Prerequisite | CPSC 221. |
| Teaching Assistant | Xiaolong Tang (xiaolong@cse.tamu.edu), office hours: Tue and Thu 1:30 pm – 3:30 pm, 414D HRBB |
| Peer Teacher | Travis 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
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
| Date | Topic | Material |
|---|---|---|
| Mon, Aug 31 | Introduction | Slides 1: pdf 4up.pdf, Slides 2: pdf 4up.pdf |
| Wed, Sep 2 | Haskell & Functional Programming Basics | Slides 3: pdf 4up.pdf |
| Fri, Sep 4 | Haskell & Functional Programming Basics | |
| Mon, Sep 7 | Haskell & Functional Programming Basics | |
| Wed, Sep 9 | Pattern matching, comprehensions, higher-order functions | Slides 4: pdf 4up.pdf |
| Fri, Sep 11 | Pattern matching, comprehensions, higher-order functions | |
| Mon, Sep 14 | Higher-order functions | |
| Wed, Sep 16 | Data types, type classes | Slides 5: pdf 4up.pdf |
| Fri, Sep 18 | Data types, type classes | |
| Mon, Sep 21 | Syntactic analysis | Slides 6: pdf 4up.pdf |
| Wed, Sep 23 | Syntactic analysis | |
| Fri, Sep 25 | Modules | Slides 7: pdf 4up.pdf |
| Mon, Sep 28 | Functional Parsers | Slides 8: pdf 4up.pdf |
| Wed, Sep 30 | Functional Parsers | |
| Fri, Oct 2 | Example language, Monads | ExprParser.hs Slides 9: pdf 4up.pdf |
| Mon, Oct 5 | Run-time structures (by Xiaolong Tang) | pdf 4up.pdf |
| Wed, Oct 7 | IO | |
| Fri, Oct 9 | Monads | |
| Mon, Oct 12 | Monads, Types and typechecking | pdf 4up.pdf |
| Wed, Oct 14 | Types and typechecking | |
| Fri, Oct 16 | Types and typechecking | |
| Mon, Oct 19 | Types and typechecking | |
| Wed, Oct 21 | Implementing a typechecker, Reader Monad | Reader.hs |
| Fri, Oct 23 | Writer, State, and Error Monads. | Writer.hs State.hs Error.hs |
| Mon, Oct 26 | Exam | |
| Wed, Oct 28 | Operational semantics | pdf 4up.pdf |
| Fri, Oct 30 | Basics of OO | pdf 4up.pdf |
| Mon, Nov 2 | Basics of OO | |
| Wed, Nov 4 | Basics of OO | |
| Fri, Nov 6 | Generics and OO | pdf 4up.pdf |
| Mon, Nov 9 | Generics | |
| Wed, Nov 11 | Co/contravariance | |
| Fri, Nov 13 | Wildcards | |
| Mon, Nov 16 | Type Erasure | |
| Wed, Nov 18 | Java Reflection | pdf 4up.pdf examples |
| Fri, Nov 20 | Java Inner classes and closures | pdf 4up.pdf |
| Mon, Nov 23 | Concurrency in Java | pdf 4up.pdf examples |
| Wed, Nov 25 | Concurrency in Java | |
| Fri, Nov 27 | No class, Thanksgiving | |
| Mon, Nov 30 | ||
| Wed, Dec 2 | ||
| Wed, Dec 4 | ||
| Mon, Dec 7 |
Assignments
| Assignment 1 | Due on Friday, 11th of September |
| Assignment 2 | Due on Monday, 21st of September |
| Assignment 3, CliteLexer.hs, test.cl | Due on Monday, 5th of October |
| Assignment 4, a4.tar | Due on Monday, 19th of October |
| Assignment 5, a5.tar | Due on Friday, 30th of October |
| Assignment 6, a6.tar | Due on Wednesday, 11th of November |
| Assignment 7 | Due 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:
- The "Official" Haskell Web-site
- A gentle introduction to Haskell Version 98
- The Haskell 98 Report
- Glasgow Haskell Compiler
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 Footo load the moduleFoo(from your fileFoo.hs) -
:rto re-load the previously loaded module -
:i xto inspect the value, type, …x -
:qto 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:
- Create a .emacs file (if you don't have one)
- 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"))
-
Launch emacs, start editing some Haskell file, such as
a1.hs. -
C-c llaunches the interpreter and loads the current file.
Date: 2009-11-23 13:22:52 CST
HTML generated by org-mode 6.32trans in emacs 22