[jhc] compilation error of my example raytracer program

John Meacham john at repetae.net
Thu Mar 26 19:16:03 EDT 2009

What a productive test case! Two important bugs and one feature request

Hi, for some reason you need to compile it with
-fno-monomorphism-restriction. I am not sure why jhc needs that and ghc
doesn't, I think there must be a bug in the way I implement it. thanks
for the test case!

The reason the error message seems oddly verbose is that it is printed
after renaming has been done, so everything has its fully qualified
name. 'unqualifying' code before printing it in error messages would be
a really useful feature. 

When I compile it, the C code doesn't compile because it has things like
'sinf(0.0)' in places where C expects a constant. So, this is a bug in
the C code generator. to jhc, sinf(0.0) is a constant expression, but
due to C's rules, I can't use it as such. Hmm.. hopefully I can find a
way around this that won't hurt performance. being able to treat things
as constant is a huge win. I will have to mull on it, a quick n dirty
fix is to stop treating Sin as a pure operation.

In any case, thanks for the example! A lot of the bugs in jhc are quite
shallow but they just need to be reported. :)

On the subject of bugs, how do people feel about ditz?
it's design appeals to me, but I have not used it before.


John Meacham - ⑆repetae.net⑆john⑈

More information about the jhc mailing list