Browse thread
Today's inflamatory opinion: exceptions are bad
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2006-12-15 (11:06) |
From: | Frédéric_Gava <gava@u...> |
Subject: | Re: [Caml-list] Today's inflamatory opinion: exceptions are bad |
----- Original Message ----- From: "Richard Jones" <rich@annexia.org> To: "Chris King" <colanderman@gmail.com> Cc: <caml-list@inria.fr> Sent: Monday, December 11, 2006 4:55 PM Subject: Re: [Caml-list] Today's inflamatory opinion: exceptions are bad >Perhaps though this is an argument that List.find and friends should >be returning 'a option, not an argument for all exceptions being bad. Hi all, There is also many case where exceptions are faster than 'a option. Could you imagine a program where (/) returns 'int option because 1/0 is impossible ? Could you benchmark serioulsy a OCaml matrix multiplication again C where Array.get return 'a option and that you have all the time to match the result ? Exceptions are goods for performance, easy to manipulate (except in tail-recursive functions) and understand. Return all the time 'a option thinks to me C programs where functions return 1 if it has been well computed or 0 otherwise (you all the time checked if it is 0 or 1 but with execption you just write try ... with on the block of functions). The case of Coq is another thinks because you can restric the cases using high level specification (and in this case, when you extract the proof in ocaml code you have "assert false"...an exception...arg.) Frédéric Gava