archives

Mondrian is going to the museum

Got this in my inbox earlier this week:

Date: Tue, 5 Aug 2008 09:01:12 +0000 (GMT)
From: Jose F. Poveda 
Subject: Re: Problem compiling qsort in mondrian
To: Mondrian Team 
MIME-Version: 1.0

Nigel,
Hi again!! And thanks for your help, it's been
quite useful. I suppose I'm the only person
using Mondrian (hopefully), but the thing is
that I'm implementing quicksort in all languages
of the history. The idea is a historical and
multimedia poster with code incrustated on it,
to include it at the computer science museum of
the city of Malaga. That's why I'm tricking on
mondrian and in many other languages that
probably are useless. And I also worked with F#,
Haskell and as I told you before many many
others.

Regards and thanks again.

Jose F. Poveda
LCC Department
University of Malaga

Scary how time flies. Just eight years ago I joined Microsoft as a young man dreaming of bringing fundamentalist functional programming to the masses. Now I am an old man whose language is inducted to the graveyard of dead programming languages. Apart from this great honor, I believe Mondrian was also briefly mentioned in Guy Steele and Richard Gabriel's fantastic "fifty in fifty" performance, but I was too blown away so I am not sure. Will have to watch the rerun at JAOO extra carefully.

Lightweight Monadic Regions

Oleg Kiselyov and Chung-chieh Shan. Lightweight Monadic Regions. Haskell'08.
We present Haskell libraries that statically ensure the safe use of resources such as file handles. We statically prevent accessing an already closed handle or forgetting to close it. The libraries can be trivially extended to other resources such as database connections and graphic contexts...

Region annotations are part of an expression's inferred type. Our new Haskell encoding of monadic regions as monad transformers needs no witness terms. It assures timely deallocation even when resources have markedly different lifetimes and the identity of the longest-living resource is determined only dynamically.

For contrast, we also implement a Haskell library for manual resource management, where deallocation is explicit and safety is assured by a form of linear types. We implement the linear typing in Haskell with the help of phantom types and a parameterized monad to statically track the type-state of resources.

I am starting to think we need a department for effect systems and related topics (though we managed without a monads department!)...

You'll probably want to read the code, so go ahead. The code makes it plain which features of the type system are needed to achieve the end result.