cvs commit: hugs98/libraries Prelude.hs

sof 2002/09/07 19:28:20 PDT Added files: libraries Prelude.hs Log: A Haskell98 compliant Prelude

On Sat, Sep 07, 2002 at 07:28:20PM -0700, Sigbjorn Finne wrote:
sof 2002/09/07 19:28:20 PDT
Added files: libraries Prelude.hs Log: A Haskell98 compliant Prelude
I'd been playing around with this myself, using Alastair's patch (hugs-bugs, 17 Aug 2001). It seems that your change allows only one module under the Prelude, while Alastair's patch allows several, though the first one (like your PrelImpl) is special. Incidentally, the hierarchical way would be to rename PrelImpl to Hugs.something (I used Hugs.Base, by analogy with GHC.Base). We might as well do that now, even though it will be the only hierarchical module in the old setup. Having multiple modules under the Prelude makes it possible to share more with the hierarchical libraries. I was using the Prelude out of fptools/libraries/base, so at startup Hugs loads {Hugs}/libraries/Hugs/Base.hs {Hugs}/libraries/Data/Maybe.hs {Hugs}/libraries/Control/Monad.hs {Hugs}/libraries/Hugs/IO.hs {Hugs}/libraries/Hugs/IOExts.hs {Hugs}/libraries/System/IO/Error.hs {Hugs}/libraries/System/IO.hs {Hugs}/libraries/Text/Read.hs {Hugs}/libraries/Text/Show.hs {Hugs}/libraries/Data/List.hs {Hugs}/libraries/Data/Either.hs {Hugs}/libraries/Data/Bool.hs {Hugs}/libraries/Data/Tuple.hs {Hugs}/libraries/Prelude.hs That also makes it possible to cut about 100 lines from Hugs.Base, and remove some #ifndef __HUGS__ stuff from fptools/libraries.

"Ross Paterson"
...
Having multiple modules under the Prelude makes it possible to share more with the hierarchical libraries. I was using the Prelude out of fptools/libraries/base, so at startup Hugs loads
{Hugs}/libraries/Hugs/Base.hs
...dozen modules deleted..
{Hugs}/libraries/Prelude.hs
That also makes it possible to cut about 100 lines from Hugs.Base, and remove some #ifndef __HUGS__ stuff from fptools/libraries.
..forcing all users to pay for this very slight internal improvement by way of increased startup times each time Hugs is loaded. Didn't/doesn't look like a Win to me. --sigbjorn

On Sun, Sep 08, 2002 at 05:50:26AM -0700, Sigbjorn Finne wrote:
"Ross Paterson"
writes: ...
Having multiple modules under the Prelude makes it possible to share more with the hierarchical libraries. I was using the Prelude out of fptools/libraries/base, so at startup Hugs loads
{Hugs}/libraries/Hugs/Base.hs
...dozen modules deleted..
{Hugs}/libraries/Prelude.hs
That also makes it possible to cut about 100 lines from Hugs.Base, and remove some #ifndef __HUGS__ stuff from fptools/libraries.
..forcing all users to pay for this very slight internal improvement by way of increased startup times each time Hugs is loaded. Didn't/doesn't look like a Win to me.
Yes, It is slower. Some times for hugs

That also makes it possible to cut about 100 lines from Hugs.Base, and remove some #ifndef __HUGS__ stuff from fptools/libraries.
..forcing all users to pay for this very slight internal improvement by way of increased startup times each time Hugs is loaded. Didn't/doesn't look like a Win to me.
I think bringing the structure closer to the Haskell Prelude and the Hierarchial libraries and having things more modular is probably the Right Thing in the long term (for all the usual software engineering reasons) but we're probably shaking things up enough that we should go with a relatively monolithic Prelude at first. (I'm particularily worried that those bits you were loading are from the hierarchial module world - what's the story in the old hierarchial world?) So how about we stay fairly monolithic in this release and look at where it's useful and possible to be more structured for future releases. -- Alastair ps It's probably safe to assume that Hugs isn't going to learn to cope with mutually recursive modules anytime soon. (I came really, really close to making them work about 5 years ago (diffs could probably be tracked down if interested) but came unstuck due to complex interactions with the typechecker.) That being so, we might sometime want to resurrect the trick I used to get round this when building STG-Hugs (first version of which used code taken direct from the Haskell report). What I did was run the dozen or so modules through a preprocessor (nothing fancy, just cpp) which split each module into two parts: 1) A big blob of code with no module header - these were all concatenated to produce Prelude_Core (or whatever I called the module); and 2) A module consisting of the old module header and a body which just imported Prelude_Core so that it could be re-exported. Whether we do this or not depends a bit on how much recursion the libs we use contain - probably not much seeing as how the GHC folk tend to avoid recursion too.

On Sun, Sep 08, 2002 at 03:10:41PM +0100, Alastair Reid wrote:
That also makes it possible to cut about 100 lines from Hugs.Base, and remove some #ifndef __HUGS__ stuff from fptools/libraries.
..forcing all users to pay for this very slight internal improvement by way of increased startup times each time Hugs is loaded. Didn't/doesn't look like a Win to me.
I think bringing the structure closer to the Haskell Prelude and the Hierarchial libraries and having things more modular is probably the Right Thing in the long term (for all the usual software engineering reasons) but we're probably shaking things up enough that we should go with a relatively monolithic Prelude at first.
Quite so -- that's why I suggested doing this after the release, when it can be done more comprehensively.
(I'm particularily worried that those bits you were loading are from the hierarchial module world - what's the story in the old hierarchial world?)
The old library setup is unaffected (same for Sigbjorn's version).
participants (4)
-
Alastair Reid
-
Ross Paterson
-
Sigbjorn Finne
-
Sigbjorn Finne