Skip to main content

2012 | Buch

Central European Functional Programming School

4th Summer School, CEFP 2011, Budapest, Hungary, June 14-24, 2011, Revised Selected Papers

herausgegeben von: Viktória Zsók, Zoltán Horváth, Rinus Plasmeijer

Verlag: Springer Berlin Heidelberg

Buchreihe : Lecture Notes in Computer Science

insite
SUCHEN

Über dieses Buch

This volume presents the revised lecture notes of selected talks given at the Fourth Central European Functional Programming School, CEFP 2011, held in June 2011 in Budapest, Hungary. The 11 revised full papers presented were carefully reviewed by experts on functional programming and revised based on the reviews. The lectures cover a wide range of distributed and multicore functional programming subjects. The last 2 papers are selected papers of the PhD Workshop organized for the participants of the summer school.

Inhaltsverzeichnis

Frontmatter
A Programming Tutor for Haskell
Abstract
In these lectures we will introduce an interactive system that supports writing simple functional programs. Using this system, students learning functional programming:
  • develop their programs incrementally,
  • receive feedback about whether or not they are on the right track,
  • can ask for a hint when they are stuck,
  • see how a complete program is stepwise constructed,
  • get suggestions about how to refactor their program.
The system itself is implemented as a functional program, and uses fundamental concepts such as rewriting, parsing, strategies, program transformations and higher-order combinators such as the fold. We will introduce these concepts, and show how they are used in the implementation of the interactive functional programming tutor.
Johan Jeuring, Alex Gerdes, Bastiaan Heeren
Defining Multi-user Web Applications with iTasks
Abstract
In these lecture notes we explain how multi-user web applications can be developed in a programming style that favors tasks as main building block for the construction of such systems. A task is work that has to be performed by human-beings and computers working together on the internet. This concept has been implemented in the iTask framework as a monadic combinator library that is embedded in the pure and lazy functional programming language Clean. These lecture notes consist of many examples and exercises, and also discusses the foundation of both the iTask system and task-oriented programming.
Rinus Plasmeijer, Peter Achten, Bas Lijnse, Steffen Michels
Reasoning about I/O in Functional Programs
Abstract
We look at formalisms for reasoning about the effects of I/O in pure functional programs, covering both the monadic I/O of Haskell and the uniqueness-based framework used by Clean. The material will cover comparative studies of I/O reasoning for Haskell, Clean and a C-like language, as well as describing the formal infrastructure needed and tool support available to do such reasoning.
Andrew Butterfield
Eden – Parallel Functional Programming with Haskell
Abstract
Eden is a parallel functional programming language which extends Haskell with constructs for the definition and instantiation of parallel processes. Processes evaluate function applications remotely in parallel. The programmer has control over process granularity, data distribution, communication topology, and evaluation site, but need not manage synchronisation and data exchange between processes. The latter are performed by the parallel runtime system through implicit communication channels, transparent to the programmer. Common and sophisticated parallel communication patterns and topologies, so-called algorithmic skeletons, are provided as higher-order functions in a user-extensible skeleton library written in Eden. Eden is geared toward distributed settings, i.e. processes do not share any data, but can equally well be used on multicore systems. This tutorial gives an up-to-date introduction into Eden’s programming methodology based on algorithmic skeletons, its language constructs, and its layered implementation on top of the Glasgow Haskell compiler.
Rita Loogen
Single Assignment C (SAC) High Productivity Meets High Performance
Abstract
We present the ins and outs of the purely functional, data parallel programming language SaC (Single Assignment C). SaC defines state- and side-effect-free semantics on top of a syntax resembling that of imperative languages like C/C++/C# or Java: functional programming with curly brackets. In contrast to other functional languages data aggregation in SaC is not based on lists and trees, but puts stateless arrays into the focus.
SaC implements an abstract calculus of truly multidimensional arrays that is adopted from interpreted array languages like Apl. Arrays are abstract values with certain structural properties. They are treated in a holistic way, not as loose collections of data cells or indexed memory address ranges. Programs can and should be written in a mostly index-free style. Functions consume array values as arguments and produce array values as results. The array type system of SaC allows such functions to abstract not only from the size of vectors or matrices but likewise from the number of array dimensions, supporting a highly generic programming style.
The design of SaC aims at reconciling high productivity in software engineering of compute-intensive applications with high performance in program execution on modern multi- and many-core computing systems. While SaC competes with other functional and declarative languages on the productivity aspect, it competes with hand-parallelised C and Fortran code on the performance aspect. We achieve our goal through stringent co-design of programming language and compilation technology.
The focus on arrays in general and the abstract view of arrays in particular combined with a functional state-free semantics are key ingredients in the design of SaC. In conjunction they allow for far-reaching program transformations and fully compiler-directed parallelisation. From literally the same source code SaC currently supports symmetric multi-socket, multi-core, hyperthreaded server systems, CUDA-enables graphics accelerators and the MicroGrid, an innovative general-purpose many-core architecture.
The CEFP lecture provides an introduction into the language design of SaC, followed by an illustration of how these concepts can be harnessed to write highly abstract, reusable and elegant code. We conclude with outlining the major compiler technologies for achieving runtime performance levels that are competitive with low-level machine-oriented programming environments.
Clemens Grelck
Reasoning about Multi-process Systems with the Box Calculus
Abstract
The box calculus is a formalism for reasoning about the properties of multi-process systems which enables account to be taken of pragmatic as well as computational concerns. It was developed for the programming language Hume which explicitly distinguishes between coordination, based on concurrent boxes linked by wires, and expressions, based on polymorphic recursive functions. This chapter introduces Hume expressions and surveys classic techniques for reasoning about functional programs. It then explores Hume coordination and the box calculus, and examines how Hume programs may be systematically transformed while maintaining computational and pragmatic correctness.
Greg Michaelson, Gudmund Grov
Parallel and Concurrent Programming in Haskell
Abstract
Haskell provides a rich set of abstractions for parallel and concurrent programming. This tutorial covers the basic concepts involved in writing parallel and concurrent programs in Haskell, and takes a deliberately practical approach: most of the examples are real Haskell programs that you can compile, run, measure, modify and experiment with. We cover parallel programming with the @Eval@ monad, Evaluation Strategies, and the @Par@ monad. On the concurrent side, we cover threads, @MVar@s, asynchronous exceptions, Software Transactional Memory, the Foreign Function Interface, and briefly look at the construction of high-speed network servers in Haskell.
Simon Marlow
Feldspar: Application and Implementation
Abstract
The Feldspar project aims to develop a domain specific language for Digital Signal Processing algorithm design. From functional descriptions, imperative code (currently C) is generated. The project partners are Ericsson, Chalmers and ELTE, Budapest. The background and motivation for the project have been documented elsewhere [3]. We aim to raise the level of abstraction at which algorithm developers and implementors work, and to generate, from Feldspar descriptions, the kind of code that is currently written by hand.
These lecture notes first give a brief introduction to Feldspar and the style of programming that it encourages. Next, we document the implementation of Feldspar as a domain specific language (DSL), embedded in Haskell. The implementation is built using a library called Syntactic that was built for this purpose, but also designed to be of use to other implementors of embedded domain specific languages. We show the implementation of Feldspar in sufficient detail to give the reader an understanding of how the use of the Syntactic library enables the modular construction of an embedded DSL. For those readers who would like to apply these techniques to their own DSL embedded in Haskell, further instructions are given in section 5.
The programming examples are available in the CEFP directory of the Feldspar package, version 0.5.0.1:
The code can be fetched by running:
> cabal unpack feldspar-language-0.5.0.1
All code is written in Haskell, and has been tested using the Glasgow Haskell Compiler (GHC), version 7.0.2, and the packages
  • syntactic-0.8
  • feldspar-language-0.5.0.1
  • feldspar-compiler-0.5.0.1
Emil Axelsson, Mary Sheeran
Static Analysis of Complex Software Systems Implemented in Erlang
Abstract
Static software analyser tools use different levels of intermediate source code representations that depend on the syntax and semantics of the language to be analysed. Most of the analyser tools use graph representation to efficiently retrieve information. Building such graphs for dynamically typed languages, such as Erlang, is not straightforward. In this paper we present static analysis methods to define the Dependency Graph representation of Erlang programs. The introduced methods cover the data-, control-, behaviour-flow and dependency analyses for sequential and parallel language constructs.
Melinda Tóth, István Bozó
Extending Little Languages into Big Systems
Abstract
A classic layout for complex software applications usually involves a set of fine-tuned performance-optimized routines that are combined and controlled from a higher layer in a lightweight fashion. As the application grows, reliable operation, portability, and maintainability gets to be a real concern. However, this can be tamed by abstracting away from the platform-dependent details by modelling the components and their relation on a higher level. Using a functional programming language combined with the technique of language embedding may be an answer when implementation of such solution comes in question [1][2]. In this design, the component descriptions may be captured by an adequate embedded domain-specific language that compiles to a lower-level language but there also has to be a way for composition and therefore getting a complete working application out of them. In this paper, we propose a method for extending compiled embedded domain-specific languages into a stand-alone system with minimal effort.
Gábor Páli
Some New Approaches in Functional Programming Based on Categories
Abstract
In this paper we deal the recursion and corecursion in functional programming. We discuss about the morphisms which express the recursion or corecursion, resp. We apply the linear logic which provides a logical perspective on computational issues such as control of resources and order of evaluation. The most important feature of linear logic is that formulae are considered as actions and its truth value depends on an internal state of a dynamic system. In this paper we present an alternative way of computation based on algebras and coalgebras. The correctness of our approaches we show by Curry-Howard correspondence.
Viliam Slodičák, Pavol Macko, Valerie Novitzká
Backmatter
Metadaten
Titel
Central European Functional Programming School
herausgegeben von
Viktória Zsók
Zoltán Horváth
Rinus Plasmeijer
Copyright-Jahr
2012
Verlag
Springer Berlin Heidelberg
Electronic ISBN
978-3-642-32096-5
Print ISBN
978-3-642-32095-8
DOI
https://doi.org/10.1007/978-3-642-32096-5

Premium Partner