One Day Workshop in Refactoring Functional Programs

last updated: 27/02/2004

what? A one day workshop on Refactoring Functional Programs and related topics
when? Monday, 09 February 2004
where? Room SE14, Computing Lab, University of Kent, UK, Canterbury Campus
(how to get here, campus guide/map for printing - look for number 23 in the upper right/north east of the map, about the campus and the region),
a PDF map of Canterbury
On Sunday evening, 7.30pm, you can find us in Zizzi's Italian Restaurant, 53 St. Peters St (map)
(preliminary) schedule
0900 - 1030
"Metamorphisms and streaming algorithms" (slides) Jeremy Gibbons, Oxford University Computing Lab
"Obfuscating Functional Set Representations" (slides) Stephen Drape, Oxford University Computing Lab
"Extract Slice Refactoring" (slides) Ran Ettinger, Oxford University Computing Lab
1030 - 1100 Coffee break
1100 - 1230
"A tour of Programatica", talk+demo (summary) Thomas Hallgren, PacSoft, OGI
"Visual Studio / Haskell", talk + demo (slides) Simon Marlow, Microsoft Research Cambridge
"HaRe, the Haskell Refactorer", talk+demo (slides) Simon Thompson, Huiqing Li, Claus Reinke, Computing Lab, University of Kent
1230 - 1400 Lunch - buffet
1400 - 1500
"Program Calculation and Verification in the Presence of Partial and Infinite Values" (slides) Patrik Jansson, Computing Science, Chalmers University
"Higher-order matching for refactoring" (slides) Ganesh Sittampalam, Oxford University Computing Lab
1500 - 1515 Medina, demo (screenshots: filebrowser, modulebrowser, pixelrepresentation, temporal ) Chris Ryder, Computing Lab, University of Kent
1515 - 1545 Coffee break
1545 - 1715
"Implementing partial evaluation in Stratego/XT", talk + demo (slides) Eelco Visser, Center for Software Technology, Utrecht University
"Reflections on operator suites for refactoring and evolution" (slides) Ralf Lämmel, CWI and VU Amsterdam
"Strafunski update", talk+demo (slides) Joost Visser, Departamento de Informatica of the Universidade do Minho
1715 - 1745 discussion session
Dinner in The Ancient Raj, 25/26 North Lane
who? confirmed participants

Discussion session(s)

We'll probably have less than 12 full presentations, and so should be able to reserve at least one slot (just before lunch, or just before the end) for more formal discussions or practice sessions. Hoping to keep the whole event rather informal, demos can also be integrated with the talks (we'll assume this as the default unless you tell us otherwise), and discussions may emerge at any point.

Among the issues we'd like to raise during the discussion sessions are opportunities for collaboration, and ways in which tool-builders and tool-users could help each other:

It might be helpful if everyone prepared their thoughts on these issues before the workshop, perhaps in the form of brief "position papers" which we could distribute before the discussion? And if you would like to raise other issues for discussion, please let us know.


Metamorphisms and streaming algorithms (Jeremy Gibbons)
Unfolds generate data structures, and folds consume them. A hylomorphism is a fold after an unfold, generating then comsuming a virtual data structure. A metamorphism is the opposite composition, an unfold after a fold; typically, it will convert from one data representation to another.

In general, metamorphisms are less general than hylomorphisms: there is no automatic fusion to deforest the intermediate virtual data structure. However, under certain conditions fusion is possible: some of the work of the unfold can be done before all of the fold is complete. This permits streaming metamorphisms, and among other things allows conversion of infinite data representations.

We present the theory and outline some examples.

Obfuscating Functional Set Representations (Stephen Drape)
An obfuscation is a program transformation whose aim is to make a program "harder to understand" whilst preserving behaviour. Usually obfuscations are used with object-oriented languages but I'll consider obfuscating a functional language. I've adapted an imperative obfuscation - array splitting - to work with Haskell style lists. To demonstrate the techniques, I will look at representing sets and some basic operations using lists. I will show how to derive obfuscations for the set operations by using functional composition. By deriving the obfuscations, one can be sure that the functionality of the operations will not be changed.

Extract Slice Refactoring (Ran Ettinger)
In my research I am trying to demonstrate, in the context of imperative (object- and aspect- oriented) programs, how program analysis techniques (such as control-flow, data-flow and slicing) can help in constructing refactoring tools. In particular, we develop support for a slice extraction refactoring designed to enhance reusability of existing entangled code.

Higher-order matching for refactoring (Ganesh Sittampalam)
Higher-order matching gives us a way of expressing many interesting program transformations as rewrite rules. The MAG system uses it to apply a number of transformations at compile-time, and I'll talk about how these transformations could instead be viewed as refactorings. I'll also discuss one or two other examples of refactorings that higher-order matching might help with.

Program Calculation and Verification in the Presence of Partial and Infinite Values (work in progress by Nils-Anders Danielsson and Patrik Jansson)
We compare different approaches to reasoning about functional programs in a case study on the correctness of simple data conversion (printing and parsing). Fixed point induction, the approximation lemma, the improvement theorem and testing are all useful methods but how can we combine them and how can a tool help in constructing correct programs or verifying programs and transformations?
(This work is part of the Cover project at Chalmers.)

Implementing partial evaluation in Stratego/XT, talk+demo (Eelco Visser)
I've been working on implementation of partial evaluation in Stratego/XT recently. I could give a 30 min talk about the programming techniques used, accompanied by a short demonstration.

Reflections on operator suites for refactoring and evolution (Ralf Lämmel)
This talk will reflect on operator suites for refactoring and evolution. While functional programming will be one important object language to consider, language parametricity is considered a driving principle. That is, we will also touch upon suites for grammar transformation, suites for rule-based systems such as SOS, and others. We will deal with the following questions:

Visual Studio / Haskell, talk + demo (Simon Marlow)
Strafunski update, talk+demo (Joost Visser)
Strafunski is a Haskell-based bundle for generic programming and language processing, based on the notion of a functional strategy. These are generic functions that can traverse into terms of any type while mixing type-specific and uniform behaviour. In this talk we will give an extremely brief overview of Strafunski, touching on the following issues:

A tour of Programatica, talk+demo (Thomas Hallgren)
HaRe, the Haskell Refactorer, talk+demo (Simon Thompson, Huiqing Li, Claus Reinke)
Refactorings are meaning-preserving source-to-source program transformations, usually with the goal to implement design-level changes at the level of program source code. HaRe, our prototype refactoring tool for Haskell, implements about a dozen refactorings, and after a first release in October 2003, has just become module-aware (January 2004 release). We will give a brief overview of the current status of HaRe, user-level features, implementation, and possible directions for the future.