[jhc] Control.Exception

John Meacham john at repetae.net
Fri Aug 28 20:22:28 EDT 2009


On Fri, Aug 28, 2009 at 12:42:00PM +1000, Mark Wotton wrote:
> Is there something inherent in JHC which prohibits using exceptions? I  
> noticed the Control.Exception module is a bit anaemic - my use case here 
> is to catch pattern match failures. (Yeah, I know it's an ugly idiom, but 
> if I'm calling from Ruby, I just want an automatic exception that 
> packages the error back up into the ruby runtime.)

There is no particular issue with normal IO exceptions in jhc, they used
to be implemented in terms of Jhc.JumpPoint and Jhc.Hole. At some point
I disabled them because they made debugging more difficult and cluttered
the main IO libraries and never got around to reimplementing them.
however, Grin now has a 'continuation' primitive, which should be used.

That said, I am still undecided about imprecise exceptions. (catching
pattern match failures and error calls). They inhibit the optimizer and
signal bugs, not catchable exceptions. I may introduce a flag to control
this behavior though.. imprecise exceptions are occasionally useful for
things like writing an interpreter...

        John

-- 
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/


More information about the jhc mailing list