[Yhc] Fixes for issue 110 and 139
golubovsky at gmail.com
Thu Jul 3 09:01:02 EDT 2008
As it comes to Core primitives.
Yes, there is a typo in the last line of the patch (lobal should be global)
hunk ./src/translator/js/lib/haskell/StdOverlay.hs 252
+global_YHC'_Primitive''primFloatIsIEEE a = unsafeJS "return false;"
+lobal_YHC'_Primitive''primDoubleIsIEEE a = unsafeJS "return false;"
This stuff looks OK for this moment. I am however working on some
standardization of Core primitives. See the ycextra repo on
code.haskell.org, and the following file in particular:
This file was obtained from a Google Spreadsheet (I can share it with
anyone who needs) by exporting to CSV, and there is a program that
converts it into Haskell
(http://code.haskell.org/ycextra/csvprim/GenPrimTable.hs), and further
into common annotations (unfinished as of now):
At some moment in the future, we will need to review this "normal" set
of primitives together, and possibly include more (like these IEEE
primitives); for now I am just setting up the framework. Since now we
can generate Core using Hugs*, there is more than one front-end.
* this has not been widely anounced yet, but the patch is already in
the Hugs repo that makes its own Core output more consistent, and
there is the hugs2yc repo on code.haskell.org where the front-end
converting Hugs Core to Yhc Core is being developed.
On 7/3/08, Neil Mitchell <ndmitchell at gmail.com> wrote:
> > I have uploaded patches for issues 110 and 77
> Both look good, and should be applied. I currently don't have SSH
> access, so if someone else wants to download them and apply that would
> be fine. Otherwise I'll do it in a week and a half (when I am back in
> York - Tom, if you are around, post viva celebrations?)
> > Issue 139
> > (http://code.google.com/p/yhc/issues/detail?id=139). Can
> > someone please check them.
> > For issue 139 I heavily borrowed from the GHC code to implement some of the
> > primitive functions for Floats and Doubles. Is that ok?
> Borrowing from GHC is fine, and probably the easiest thing to do. A
> couple of small points:
> 1) I see the line:
> +lobal_YHC'_Primitive''primDoubleIsIEEE a = unsafeJS "return false;"
> I'm going to assume that's missing a 'g'? Dimitry - does the
> 2) Can you add some pointer and acknowledgement to GHC, possibly
> saying which file in GHC you stole this stuff from. If it ever goes
> wrong in future, we can then go back and get them to fix it and steal
> their updated fixed :-)
> 3) Can you add a test suite item, just the example in the bug report,
> so we can make sure this doesn't go wrong and is well fixed.
> > Also can someone please explain to me how multiplication for floats and
> > doubles is done. I can see the call to primIntMul for Integers but I haven't
> > found anything for floats and doubles.
> No idea, I'm afraid. Tom should know?
> Many thanks for taking the time to do these fixes,
Anywhere on the Web
More information about the Yhc