Subject: [bug#75745] [PATCH] gnu: hugs: Ignore integer overflow.

From: Lennart Augustsson <[email-masked]>
Date: Sat, 25 Jan 2025 15:37:21 +0100

So, it seems random if Hugs need the patch or not.  Which suggests some
undefined behaviour.
But if it works for you without the patch, so much the better.

I have no idea what it would take to compile GHC with MicroHs.  I've not
tried.
I think it might not be too far away.  MicroHs will probably need to get
unboxed types (or at least fake them).  GHC is written fairly
conservatively and is not using all the latest features.
If somebody wants to try, I'm willing to add needed features to MicroHs if
they are not too crazy.

On Sat, Jan 25, 2025 at 3:28 PM Lars-Dominik Braun <[email-masked]> wrote:

> Hi Lennart,
>
> > If someone fixes all the warnings when compiling Hugs, then I bet this
> > problem goes away. But I am not going to do that. In its current state
> Hugs
> > can compile a fully functional MicroHs, and that's enough for me.
>
> actually, I can build the MicroHs package from
> https://issues.guix.gnu.org/75778 just fine with our default, unpatched
> Hugs. It can also compile/run the example from
> https://github.com/augustss/MicroHs?tab=readme-ov-file#example.
>
> Can we therefore just drop this patch? It causes Hugs to die with a
> SIGFPE while evaluating the example expression `fromInteger (9 ^ 100)
> :: Int` from above, which is rather ugly behavior.
>
> And on an unrelated note: Would it be possible to bootstrap (a possibly
> very, very old version of) GHC with MicroHs? (As far as I see our GHC
> 7 is currently bootstrapped via binaries.)
>
> Lars
>
>