Lecture 11: Heterogeneous Metaprogramming in F#

2 November 2010

This is the last of three lectures on integrating domain-specific languages with general-purpose programming languages. This lecture looked at metaprogramming, where one program manipulates another; in particular the possibilities for heterogeneous metaprogramming provided by the LINQ framework mentioned in the previous lecture. This leads to an example from the following paper where existing F# code for running Conway’s Game of Life can be automatically transformed to run on a GPU.

D. Syme Leveraging .NET meta-programming components from F#: Integrated queries and interoperable heterogeneous execution. In ML ’06: Proceedings of the ACM SIGPLAN 2006 Workshop on ML, pages 43–54. ACM Press, September 2006. DOI 10.1145/1159876.1159884

Link: Slides

Coursework office hour

If you have questions or problems you wish to raise regarding the course or your coursework, you can bring them to me this Wednesday afternoon.

Office Hour: 1.30–2.30pm Wednesday 27 October, Informatics Forum 5.04

If the turnstile gates are closed and your student card does not open them, ask at the front desk for admission.

Otherwise, please post any questions here on the blog or by email either to the mailing list apl-students@inf.ed.ac.uk or to me Ian.Stark@ed.ac.uk.


Lecture 10: Bridging Query and Programming Languages

29 October 2010

This is the second of three lectures on integrating domain-specific languages with general-purpose programming languages. In particular, SQL for database queries. This lecture presented LINQ, Language Integrated Query, together with some background on Microsoft’s .NET framework, and the language features added to C# to support LINQ.
Read the rest of this entry »


Lecture 9: Using SQL from Java

26 October 2010

This is the first of three lectures on integrating domain-specific languages with general-purpose programming languages. In particular, SQL for database queries.
Read the rest of this entry »


Lecture 8: Monads and I/O

15 October 2010

Leading on from the slides by Peyton Jones, this lecture sets out how constructor classes and higher-order functions can help to treat effectful computation within a pure functional language; or potentially contain its influence within an imperative one.

Read the rest of this entry »


Lecture 20: Type-Checking for SQLizability

18 March 2010

Review of what LINQ can do in C# to lower the impedance mismatch between general-purpose programming languages and database query languages. Advantages and limitations on this; in particular the possibility of runtime failure, limits of abstraction, and the role of reflection.

One possible route to improving this: introduction of a type and effect system to track behaviour that cannot be represented in SQL. This allows arbitrary use of parametrization and higher-order functions, while providing compile-time guarantees of on-database execution. Outline of proof via a strongly-normalizing rewrite system. Several examples of how this more deeply embeds querying into a functional language, allowing modular construction of code and opening up queries to conventional compiler rewriting as well as SQL database-specific optimisations.

This lecture is based on the work of Ezra Cooper, in particular the following paper:

You can follow his research blog for more on this.

Homework

Please fill out and submit an anonymous feedback questionnaire. Thank you.