[EMAIL PROTECTED] writes:
> Hi,
>
> I know this is a trivial question, but may I ask who participated
> in the ICFP programming contest this year? (I mean, from the
> Haskell community, of course)
I admit that I recently converted some tea, coffee and kebabs into
Haskell 98 ray tracing code.
> And which features of the Haskell language helped the most,
> compared to Caml, C, etc.?
First class functions:
- Give each primitive solid an attribute of type (Point -> Texture),
so that the rendering subsystem doesn't need to know about GML
closures.
- Define a few lifting functions, so that predefined GML operators
can be expressed succinctly in terms of their Haskell equivalents.
Lazy evaluation:
- One of the performance hints in the task description was to avoid
texture calculation for shadow rays. Ha! We can just let *those*
thunks get garbage collected cheaply, and not write any extra
code.
Regards,
Tom