[jhc] Re: Ids in Jhc.

Lemmih lemmih at gmail.com
Thu Feb 14 16:10:54 EST 2008


On Thu, Feb 14, 2008 at 8:01 PM, Samuel Bronson <naesten at gmail.com> wrote:
> On 2/14/08, Lemmih <lemmih at gmail.com> wrote:
>
>  > I mean something like: data Id = Phantom | Unnamed Int | Named Atom
>  > Giving special meaning to numbers seems like a hack. Optimizations
>  > should not come at the sacrifice of readability.
>
>  It's not a hack if you use a newtype... at least, not observably. Yhc
>  didn't, and it did do some really nasty stuff. (Possibly nhc predated
>  newtypes?)

If you hide the implementation then you might as well provide the user
with an ADT instead of an Int.

The optimizations in Jhc seems to be geared towards making things more
"basic". Data types are unrolled so they can fit in an integer,
Haskell code is replaced by C code. These optimizations give the
illusion of improvements at the cost of readability.
Rewriting a piece of Haskell code in C is rather silly when it is the
algorithm that's broken.

-- 
Cheers,
 Lemmih


More information about the jhc mailing list