Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] GC and file descriptors
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-11-18 (23:49)
From: Benjamin Geer <ben@s...>
Subject: Re: [Caml-list] GC and file descriptors
Xavier Leroy wrote:
>>If the type of a function included its exception specification,
>>could Caml infer exception specifications?
> Yes, with the proviso that you need a fairly sophisticated exception
> analysis to get enough precision in practice.  See for instance the
> PhD work of my former student, François Pessaux:
> François Pessaux and Xavier Leroy. Type-based analysis of uncaught
> exceptions. ACM Transactions on Programming Languages and Systems,
> 22(2):340-377, 2000.

I've just read this paper, and it looks like very promising work.  I 
wholeheartedly agree with the presentation of the issues in the 
Introduction, which makes two very important points:

(1) 'Our experience with large ML applications is that uncaught 
exceptions are the most frequent mode of failure.'

(2) 'Declaring escaping exceptions in functions and method signatures 
works well in first-order, monomorphic programs, but is not adequate for 
the kind of higher-order, polymorphic programming that ML promotes.'

(As the article points out, this problem comes up in Java as well; in an 
implementation of the Command pattern, it's difficult not to define the 
execute() method of the Command interface as being able to throw any 

The paper makes a convincing case for inference as a better approach.

Has the work described in this paper been continued?  Are there any 
plans to integrate it, or something like it, into Caml?


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: