On Sun, Dec 07, 2008 at 10:37:52PM -0500, Jonathan S. Shapiro wrote:
> The answer is a bit cheesy: BitC does not declare raised exceptions as part
> of a function type. Since *any* function can raise an exception

Why? Why aren't exceptions thrown at least declared with the function?
Why can't we have functions known to not throw exceptions?

There are a number of advantages:
- documentation,
- optimization: if the runtime cost in cycles of being able to catch
  exceptions can essentially be zero, there is a significant code size
  impact. Embedded code cares about that. Sometimes a *lot*. Knowing
  that a particular function doesn't throw any exceptions can help.
- less uncaught exceptions.

There are disadvantages: it can be cumbersome, especially without a way
of saying "f throws ExceptionA and whatever g-called-by-f is throwing",
i.e. polymorphism over exceptions.

Just wondering as I don't remember the subject being discussed here.

Thanks.
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to