[mercury-users] exceptions considered bloody annoying

Dominique de Waleffe ddw at missioncriticalit.com
Tue Apr 16 17:42:09 AEST 2002

  >>> "Michael" == Michael Day <mikeday at bigpond.net.au> writes:

Michael> Here is a proposal: remove try and try_io from the library. If you want to
Michael> run dynamically loaded code without putting yourself at risk of errors,
Michael> then fork a child process to dynamically load and execute the code. It can
Michael> throw an exception, die, and the operating system will close its files and
Michael> release its memory. Then we can go back to using error for determinism
Michael> assertions and exceptions will stop screwing up interfaces.

Without try and try_io [they are already complicated to use, plus
not much is inferred by the compiler about exceptions (they should
really be part of the language)], it would be very difficult to write
a complex server with a lot of state information, that MUST stand on
its feet in all conditions.

The application we have written, and in production use since
september 2000, exploits and uses exception, quite sparingly, but
without them, Mercury would be totally useless.

In conclusion, exceptions are needed to catch unusual things and to
easily transfer control to an upper layer when they happen. They
should be defined by the language so that the compiler can derive
and exploit information about them. While this would probably require
extra annotations in the sources, that would be useful.


mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe

More information about the users mailing list