Note: This page refers to a past version of the course. You can also consult the current APL course web pages.
Link: Course webpage. Jump to lecture: 1, 2, 3, 4, 5, 6.
New! The lecture log is (probably) moving to a blog.
Introduction to the course; review of some programming languages; how languages shape programs; some topics to be covered in the course.
Homework: Lecture 2 concerns the language Objective Caml (OCaml). You can find out about this at the Caml Language home page. Before the next lecture you should:
ocaml
implementation. For example, typing ocaml
at the command line on
a DICE machine. Implementations of OCaml are available for Linux, Windows,
and Mac OS X.Also, Wikipedia's History of programming languages is an easy read and fairly informative.
References:
Update: Having flippantly included a quote from 1984, I now discover that the prototype release of the Newspeak programming language is due out this month.
go to
Statements, ACM Computing
Surveys 6(4):261–301, December 1974.This is held in the British National Archives at Kew (ref. DSIR 10/385). You can view it online in the Turing Archive, as item AMT/C/32; there is also a PDF scan of the typescript report available.
The report has been reprinted in various collections, with accompanying annotations and introductions.
Different examples of types in programming languages; what is a type system; a problem with Java array subtyping; covariant, contravariant and invariant type dependencies; brief mention of OCaml.
Homework:
By the next lecture on Monday:
Lecture 3 will present material on the OCaml language. If you have not done the homework from last time, do it now. If you are still uncertain about OCaml programming, try these online guides:
References:
The Scala programming language smoothly integrates object-oriented and functional features in a concise and type-safe way. It is fully interoperable with the Java language and Java runtime environment, and also the .NET Framework from Microsoft. Martin Odersky is the language designer.
Links: Scala; Introduction; A Tour of Scala.
Bracha is one of the co-authors of the Java Language Specification, and writes about a range of object-oriented programming issues on his blog See also note above on the Newspeak language, of which he is a designer.
Brief overview of basic expressions and types in OCaml. Some choices in type systems: nominal vs. structural typing; parametric and classic OO polymorphism. OCaml example: region quadtrees for efficient image representation.
Homework: Basic exercises, just reviewing the lecture material:
More advanced exercises, requiring you to write original code:
OCaml graphics are described in the language manual and Chapter 5 of Developing Applications with Objective Caml.
Post your results on the newsgroup; and if you find any additional information necessary for using OCaml or its graphics library on platforms other than DICE, post that too.
References:
This is the textbook for a whole course on types for programming. It's expensive, but the University library has several copies for loan.
All about how to use Java Generics, and particularly their appearance in the Collections library classes.
http://java.sun.com/j2se/1.5.0/docs/guide/language/index.html
The first section is on generics: “This long-awaited enhancement to the type system allows a type or method to operate on objects of various types while providing compile-time type safety. It adds compile-time type safety to the Collections Framework and eliminates the drudgery of casting.”
Available from the JDK 5 webpage above, this is a tutorial on using generics.
http://homepages.inf.ed.ac.uk/wadler/gj/Documents/#gj-tutorial
A tutorial for the GJ language, from which Java took its implementation of generics.
http://homepages.inf.ed.ac.uk/wadler/gj/
Details about GJ and its history.
The story of how parametric polymorphism made it from purely functional languages like Haskell and ML into the object-oriented world of Java and C# generics is spread across several research papers, presented at computer science conferences and published in learned journals. These are fairly technical, but do give some indication of the mathematical background and research required to safely add powerful features to a general-purpose programming language.
Describes the addition of “?” wildcards to increase the power of parametric polymorphism in Java.
Demonstration of quadtrees and octrees for collision detection; the challenge of static type-checking for object-oriented programming; OCaml's use of row variables and row polymorphism to provide structural typing for objects.
Homework:
References:
java.util.Collections.max
in the Java 2 Platform, Standard Edition, v1.3.1 API Specification. Sun,
2001. (This method was present in v1.2.2, but Sun no longer provide online
documentation.)java.util.Collections.max
in the Java Platform, Standard Edition 6 API Specification. Sun, 2006.Rémy is the chief designer of the OCaml object system. This tutorial covers all of OCaml; Objects are treated in Chapter 3.
An original paper setting out the use of row variables for ML. Quite technical, and the syntax is different to that eventually used in OCaml.
Copies available in the University library.
Thanks to the translation efforts of a volunteer collaboration, there is an English version available online.
Copies on order for the University library.
Presentation of coursework topics; suggested report outline; notes on working practices.
Link: Coursework web page.
First-order logic; a simple imperative language; Hoare triples. Rules for derivation; validity with respect to an operational semantics; soundness and completeness. Applications in program specification and verification; tools for formal verification; Design by Contract™.
References:
Hoare's original article setting out the use of triples. Note that this uses the notation P{C}Q with braces around the command rather than the assertions.
A collection of articles by Hoare. Proving programs correct is addressed in most chapters, but particularly 4 and 5.
Both the article and the book should be directly available from machines within the University. For access from outside you can use a proxy provided by the University Library:
Design methodologies often attract heated discussion of their effectiveness. For example, would design by contract have averted the Ariane disaster? Look at the following two articles:
Textbook introduction to the subject. Chapter 6 presents axiomatic semantics and Hoare logic. Good if you want to find out about more about language semantics and verification.
Technical article describing a machine-checked proof that Hoare logic is sound and complete. Section 3 gives some history of the "consequence" rule. Again, the article is available directly from within the University, or through a library proxy from outside:
Beauty is truth, truth beauty — that is all
Ye know on earth, and all ye need to know
Keats praising the virtue of "Mysteries, doubts without any irritable reaching after fact & reason". Not a fan of formal semantics, we guess.
Informatics Forum, 10 Crichton Street, Edinburgh, EH8 9AB, Scotland, UK
Tel: +44 131 651 5661, Fax: +44 131 651 1426, E-mail: school-office@inf.ed.ac.uk Please contact our webadmin with any comments or corrections. Logging and Cookies Unless explicitly stated otherwise, all material is copyright © The University of Edinburgh |