Changes to primops break libraries (was Re: 7.8 Feature window)

Jan Stolarek jan.stolarek at p.lodz.pl
Thu Aug 22 16:49:24 CEST 2013


I created a wiki page that describes the upgrade process in two easy steps:

http://ghc.haskell.org/trac/ghc/wiki/NewPrimopsInGHC7.8

I also added link to this page in the release notes. Simon, does this address points 3 & 4 of your mail? Of course aside from the fact that if we change name of GHC.PrimWrappers module than these page will need to be updated accordingly.

Janek

----- Oryginalna wiadomość -----
Od: "Simon Peyton-Jones" <simonpj at microsoft.com>
Do: "Jan Stolarek" <jan.stolarek at p.lodz.pl>, "Gabor Greif" <ggreif at gmail.com>
DW: ghc-devs at haskell.org
Wysłane: czwartek, 22 sierpień 2013 13:40:09
Temat: RE: Changes to primops break libraries (was Re: 7.8 Feature window)

Jan

Four things:

| •Six primops are an exception to the rules above: sameMutableArray#,
| sameMutableByteArray#, sameMutableArrayArray#, sameMutVar#, sameMVar#
| and sameTVar#. Their names have remained the same as before and new
| wrappers created for them lack # at the end of their name. We made that
| decission because this naming feels more consistent and these primops
| are rarely used so we expect that they won't break a lot of existing
| code.

1. Why do you say "this naming feels more consistent"?  Consistent with what?  I'd expect sameTVar# to return a Bool, just like ==#.

I'd prefer to say "just import PrimWrappers" than to say "just import PrimWrapper and change the names of these six functions".  I don’t really see a clear distinction at all.

2.  The module name PrimWrappers is terrible, because it's so close to PrimopWrappers, which is machine generated. Lots of scope for confusion.  How about CmpOpWrappers or BoolOpWrappers?  Any opinions from other ghc-devs?

3. Could you add a section "Breaking changes" to http://ghc.haskell.org/trac/ghc/wiki/PrimBool to explain what to change.  Currently it's buried (in bold I know) in "Implementation details" which is not where I'd look as a library author.

4. Can the release notes http://ghc.haskell.org/trac/ghc/browser/docs/users_guide/7.8.1-notes.xml perhaps refer to the wiki page?  That gives much more background.  Library authors will find that helpful.

So long as we get these choices fixed for 7.8 we are fine.

Simon




More information about the ghc-devs mailing list