Academic & research homepage

I'm final year Masters student of Theoretical Computer Science at Faculty of Mathematics and Physics [^] of Charles University in Prague. During my studies, I visited Microsoft Research in Cambridge two times as an intern under the supervision of Don Syme [^].
I'm interested in programming models (that is, what is the best "language" for solving problems from some domain) and how to encode these models in programming languages. More specifically, I'm interested in techniques like meta-programming, embedded languages, monads and other abstract representations of computations. My most recent projects include:
- Reactive programming. I'm exploring ways that make event-driven programming in F# easier and I'm also experimenting with small language extension for computation expressions.
- Client/server web. My F# WebTools framework integrates the development of client-side and server-side of an application in a type-safe way using meta-programming and computation expressions.
Writings & talks

Drafts
The following articles are drafts that I'm currently working on. They have not been published (yet) and may contain false claims, errors and may not mention all existing work. I'd be very grateful for pointers to related work, suggestions and comments. I can be contacted at tomas@tomasp.net.
Pattern matching for monadic computations (with Don Syme)
Unpublished draftWe present an extension of monadic computations that adds support for pattern matching on monadic values, while preserving the usual intuition about pattern matching in ML languages. The extension is useful for encoding concurrent, parallel and reactive programming models (including futures and join calculus).
Full text (PDF)
Academic talks
- Collecting Hollywood’s Garbage: Avoiding Space-Leaks in Composite Events (June 2010, ISMM 2010)
Discusses a duality between references between passive objects and references between active events with respect to the problem of garbage collection. We use this idea to implement correct reactive library for F#.
- Pattern matching for monadic computations (March 2010, MSR Cambridge)
We add generalized pattern matching construct for F# computation expressions and show how to use it for encoding concurrency based on join calculus and parallel programming based on futures.
- Reactive pattern matching for F# (April 2009, Lang.NET, Redmond)
Presents generalized pattern matching with special focus on reactive programming with events. Shows how to write interactive user interfaces in a functional way using pattern matching.
Slides from the talk (PPTX, PDF)
Video recording of the talk - Reactive pattern matching for F# (March 2009, MSR Cambridge)
Talk given at the end of the MSR Cambridge internship. Presents my work on reactive programming in F#, extension of computation expressions and how to solve memory leaks in compositional programming with events.
Slides from the talk (PPTX, PDF)
Video recording of the talk - Ajax-style Client/Server Programming in F# (July 2007, MSR Cambridge)
Presents a library that allows development of client/server applications in a single programming langauge using meta-programming. We use monads and static types to make the client/server integration safer.
Publications

2010
Collecting Hollywood’s Garbage: Avoiding Space-Leaks in Composite Events (with Don Syme)
To appear in Proceedings of International Symposium on Memory Management, Toronto 2010This article deals with memory leaks that can occur in a reactive programming model based on events. It presents a formal garbage collection algorithm that could be used in this scenario and a correct reactive library based on this idea, implemented in F#.
Full text (PDF, version with all appendices)
Reactive Programming with Events (supervised by Don Syme)
Master Thesis, Charles University, 2010 (to be defended)The thesis summarizes my work on reactive programming in F#. First two parts of the work are based on the two above papers. Next, the thesis shows how to use them together to develop a powerful reactive programming library based on the imperative approach (waiting for events, triggering events). We also discuss how to reason about programs, to show (for example) that no event occurrence will be ignored.
Full text (PDF)
2009
Encoding monadic computations in C# using iterators
To appear in Proceedings of ITAT 2009This paper shows a general way for encoding monadic computations in C# 2.0 with a convenient syntax using iterators. This gives us a way to use computations enabling easy asynchronous programming or for example the use of software transactional memory in plain C#.
Full text (PDF, extended), Supplementary materials (PDF), Source code (ZIP)
2007
Client-side Scripting using Meta-programming (supervised by David Bednarek)
Bachelor Thesis, Charles University, 2007The thesis attempts to solve three fundamental problems of "AJAX" style of web development. We use meta-programming to provide rich programming evnironment for writing client-side code in F#. We present a way to integrate client-side and server-side code in a type safe way (using monads). And finally, we show how to integrate client-side code with the existing object-model provided by ASP.NET to make our work practically useful.
Full text (PDF)
Academic activities

Teaching
Programming languages F# and OCaml (Winter 2009/2010)
Faculty of Mathematics and Physics, Charles University (MFF SIS)The lecture introduces concepts used in ML-family of languages and tries to highlight the mathematical foundations of ML languages. As a results students should find understanding of some mathematical concepts easier. It also explains advanced F# features such as computation expressions (based on Haskell's monads).
Materials and other information (Slides and assignments are in English - you should be able to find them - the rest of the page is in Czech)
WinFX Programming with Vojtech Jakl (Summer 2005/2006)
Faculty of Mathematics and Physics, Charles UniversityA practically oriented lecture about Windows programming using the WinFX framework (now called WPF, WCF and WF), which was in beta version in 2006 (so we had a lot of fun doing it!) It discussed creating graphics, documents, animations, working with data and communication between applications.
Materials and other information (in Czech)
Published: January 10, 2007 22:33

