Static types for dynamic documents

Dynamic, active documents are particularly troublesome to program within conventional languages. Documents are typically represented in XML or HTML, which use regular-expression like types instead of the familiar sums-of-products datatypes supported by conventional languages. Furthermore, documents tend to include embedded program in a variety of scripting languages, for which conventional languages offer no support at all. It is thus very difficult to verify that these programs generate even syntactically well-formed documents, let alone documents which are valid for their document type definition, and contain only well-typed scripts. This thesis develops the core type system for a Haskell-like functional programming language that directly supports dynamic, active documents. The first part presents a system of type-indexed rows, that supports many aspects of XML's regular-expression types without abandoning the type features which make functional programming attractive. In particular, type-indexed rows coexist cleanly with higher-order types and parametric polymorphism. The second part presents a system of staged computation, that allows server-side and client-side code to be cleanly separated. In both cases, the type system can guarantee that only well-formed and valid documents are generated. Hence, not only are document-generating programs easier to write using these systems, in addition they are much more likely to be correct.

[1]  Benjamin C. Pierce,et al.  Regular expression types for XML , 2000, TOPL.

[2]  Philip Wadler,et al.  How to make ad-hoc polymorphism less ad hoc , 1989, POPL '89.

[3]  Paul Hudak,et al.  Lambda in Motion: Controlling Robots with Haskell , 1999, PADL.

[4]  T. Sheard,et al.  A Categorical Analysis of Multi-Level Languages (Extended Abstract) , 1998 .

[5]  Mark P. Jones Simplifying and improving qualified types , 1995, FPCA '95.

[6]  Flemming Nielson,et al.  Automatic Binding Time Analysis for a Typed lambda-Calculus , 1988, Sci. Comput. Program..

[7]  Anders Berglund,et al.  Extensible Stylesheet Language (XSL) Version 1.0 , 1998 .

[8]  João Saraiva,et al.  Designing and Implementing Combinator Languages , 1998, Advanced Functional Programming.

[9]  Flemming Nielson,et al.  Two-Level Semantics and Code Generation , 1988, Theor. Comput. Sci..

[10]  Ralf Hinze,et al.  A new approach to generic functional programming , 2000, POPL '00.

[11]  Simon L. Peyton Jones,et al.  Composing the User Interface with Haggis , 1996, Advanced Functional Programming.

[12]  Samuel N. Kamin,et al.  Metacomputation-Based Compiler Architecture , 2000, MPC.

[13]  Peter Sestoft,et al.  Partial evaluation and automatic program generation , 1993, Prentice Hall international series in computer science.

[14]  Wolfram Kahl,et al.  Beyond Pretty-Printing: Galley Concepts in Document Formatting Combinators , 1999, PADL.

[15]  Andrew M. Pitts,et al.  A new approach to abstract syntax involving binders , 1999, Proceedings. 14th Symposium on Logic in Computer Science (Cat. No. PR00158).

[16]  John C. Reynolds,et al.  Design of the programming language FORSYTHE , 1997 .

[17]  John C. Mitchell,et al.  Foundations for programming languages , 1996, Foundation of computing series.

[18]  Walid Taha,et al.  An Idealized MetaML: Simpler, and More Expressive , 1999, ESOP.

[19]  S. Doaitse Swierstra,et al.  Fast, Error Correcting Parser Combinatiors: A Short Tutorial , 1999, SOFSEM.

[20]  Simon L. Peyton Jones,et al.  Dynamic typing as staged type inference , 1998, POPL '98.

[21]  Benedict R. Gaster,et al.  A Polymorphic Type System for Extensible Records and Variants , 1996 .

[22]  Martín Abadi,et al.  Dynamic typing in a statically-typed language , 1989, POPL '89.

[23]  Gordon D. Plotkin,et al.  A Powerdomain Construction , 1976, SIAM J. Comput..

[24]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[25]  Atsushi Ohori,et al.  A polymorphic record calculus and its compilation , 1995, TOPL.

[26]  Simon Peyton Jones,et al.  Lightweight Extensible Records for Haskell , 1999 .

[27]  Walid Taha,et al.  Multi-stage programming with explicit annotations , 1997 .

[28]  Martin Odersky,et al.  Type Inference with Constrained Types , 1999, Theory Pract. Object Syst..

[29]  Gordon D. Plotkin,et al.  An ideal model for recursive polymorphic types , 1984, Inf. Control..

[30]  P. J. Landin,et al.  The next 700 programming languages , 1966, CACM.

[31]  Flemming Nielson,et al.  Two-Level Functional Languages: Abstract Interpretation , 1992 .

[32]  Eugenio Moggi,et al.  Computational lambda-calculus and monads , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[33]  Mark P. Jones,et al.  First-class polymorphism with type inference , 1997, POPL '97.

[34]  Alexander Aiken,et al.  Type inclusion constraints and type inference , 1993, FPCA '93.

[35]  Andrew M. Pitts,et al.  Metalanguages and Applications , 1997 .

[36]  Frank J. Oles,et al.  Type Algebras, Functor Categories, and Block Structure , 1986 .

[37]  J. B. Wells,et al.  Typability and type checking in the second-order /spl lambda/-calculus are equivalent and undecidable , 1994, Proceedings Ninth Annual IEEE Symposium on Logic in Computer Science.