[compiler-hacking] useful feature?

Nik Sultana ns441 at cam.ac.uk
Wed Oct 8 14:01:32 BST 2014


Hi all, not sure if this is a valid suggestion for a feature that could 
be tackled during one of the the compiler hacking sessions. (It's more 
to do with Lwt than the compiler.)

The problem was described by Thomas under "Error handling in key 
look-ups" at
http://roscidus.com/blog/blog/2013/11/28/asynchronous-python-vs-ocaml/

The problem occurs when "try..with" is used instead of the Lwt 
counterparts for handling exceptions.

My idea consists of emitting a warning each time the following two 
conditions are both met:
1. if we have an AST that contains "try EXP with (VAR, EXP')+", and
2. the type of EXP, and the type of each EXP' is "tp Lwt.t" for some 
type tp.

I'm not sure if this is entirely reasonable or useful, nor can I judge 
how difficult it is to implement since I don't know what the codebase 
looks like, but thought I'd offer it up for your judgement.

Best wishes,
Nik



More information about the Cam-compiler-hacking mailing list