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.

Microsoft Software licences available

3 October 2010

The School of Informatics has a subscription to the Microsoft Developer Network Academic Alliance (MSDN AA). This means that we can offer licensed copies of a range of Microsoft packages. These are for “development” rather than “productivity” tools: Windows 7 and Visual Studio rather than Word and Excel. You can make arbitrary non-commercial use of these while studying here.

In particular, if your chosen coursework topic requires setting up one or more virtual machines running Windows, this can help.

If you would like an MSDN account to download the software and licence keys, send me an email.

Links: Microsoft Developer Network Academic Alliance; Student Use Agreement.

Lecture 4: Coursework Assignment Topics

1 October 2010

Presentation of the five coursework topics. Some good and bad examples of referencing. Requirements of preliminary report; investigation; and final report. Notes on working practices: aims of homework, exercises, coursework; avoiding plagiarism.

You need to commit to a topic choice by next Friday. This involves finding and reading references, as well as downloading, installing and running your chosen system. If you have difficulties with this, post a question below.

Links: Slides; Sheet; Coursework assignment; University marking scheme; Essay grade descriptors.

Lecture 19: Heterogeneous Metaprogramming in F#

15 March 2010

General overview of metaprogramming, with a range of examples in different languages ranging from C macros through Java reflection to MetaOCaml. Brief summary of the F# language, its history, features, and upcoming release in VS 2010.

Metaprogramming in F#, and how it can be combined with LINQ for database queries, runtime code-generation, and outsourcing computation. How to run Conway’s Life on a GPU without changing your code. This is based on the following paper:

To find out more about this, try also reading the series of articles about accelerating data-parallel code in F# on Tomáš Petrícek’s blog.

Finally, a job ad to work with the F# team.

Links: Slides; F# Developer Network; F# at Microsoft Research; Visual F# Developer Library; Don Syme as Geek of the Week.

Lecture 12: Heterogeneous Metaprogramming in F#

19 February 2009

Metaprogramming, code that manipulates code.  Examples: macros, templates, eval; quotation, quasiquotation, antiquotation; staged computation; run-time code generation, self-modifying code; MetaOCaml, homogeneous vs. heterogeneous metaprogramming, offshoring code.  The F# programming language; background, motivation; mixture of ML and .NET; interlanguage working.  Metaprogramming with LINQ: expressions in C#; quotations in F#, strongly typed expression data; using LINQ to map F# source to SQL queries; lightweight runtime code generation; Conway’s Game of Life in F#, outsourced to run on a GPU.

Advertisements for Martín Escardo’s seminar this afternoon, and Sam Lindley’s talk on Database Programming Without Tiers as an APL guest lecture on Monday.

Links for background material now available below. Read the rest of this entry »