
Hello libraries, current situation when Base lib includes everything, from 'const' to starship control, creates serious problems for upgrading to next GHC version. this problem arise because every GHC version arrives with its own, non-upgradable version of Base library and even minor API changes here results in total loss of ability to use new ghc version without #ifdef workarounds it seems strange, but even in this situation some developers prefer to include their modules in base lib instead of providing them as separate libs that can be easily upgraded using Cabal so that any library version can be used with any version of ghc after analyzing the situation, i concluded that source of problem, at least partially, is GHC HQ's policy of packaging libraries with GHC. The list of such libraries is *closed* and odd at first look. why, for example, it includes 2 of 4 regexp libs? at last end, we can learn that this is the list of libs required to build ghc itself! unfortunately, ghc building process don't require FilePath or ByteString support. this results in situation when authors of these libs, looking for a way to include their libs in every ghc distro, don't find other solution except for including them in Base lib. moreover, while Simon & Ian argued against inclusion of these very useful libs in base libs set, they don't have anything against inclusion of the same code in Base lib i'm all for docracy, but not in this case. having the experience of patching the program after each ghc upgrade, and having a bunch of conditionally compiled code in my libs, i can easily imagine ghc version hell that these new modules will provide for us so, i think, it is time to revise ghc libraries policy. i propose to split libs into the 3 "rings": core, base and other * core libs includes ghc version dependent libs. currently it's base, stm and th * base libs are libs, which is guaranteed to be shipped with *every* haskell distribution. on windows, it should be a part of monolithic installer while on unixes these libs may be a separate packages, but porters should ensure that they ported all these libs too this set should include only small and widely used libs, what is mainly datastructure processing ones. my current list includes regexps, bytestring, filepath, time, mtl, fgl, newbinary and so on * other libs are either too specific or too large, such as gui, database and xml ones. these may be included in some distros or installed separately these rules don't say anything about ghc self-building process. it will be great to maintain the list of libraries, required to do it, separately and while we are here - splitting of Base library should be very easy task. its ghc version specific part is in GHC.* modules. these modules should be moved into the new Core library. plus a few modules from Data.* or System.* hierarchy they imports. plus a few modules imported by Hugs/NHC Prelude. the rest of Base library should be pretty portable, at least between various GHC versions. and independent on this work, we can always look into moving pieces of Base into independent libs. as a rule of thumb, everything not used in Base lib may be moved outside of it. of course, these new libs should be included in base libs set in particular, my hottest hope is that ghc 6.6.1 will be shipped with fps 0.8 as separate library that will provide both backward compatibility with 6.6 and will allow to upgrade fps without recompiling ghc itself :D -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Hi
* core libs includes ghc version dependent libs. currently it's base, stm and th
* base libs are libs, which is guaranteed to be shipped with *every* haskell distribution. on windows, it should be a part of monolithic installer while on unixes these libs may be a separate packages, but porters should ensure that they ported all these libs too
* other libs are either too specific or too large, such as gui, database and xml ones. these may be included in some distros or installed separately
That sounds fine, and when this work has been done, bytestring and filepath both deserve to live in this second ring. Only modules which are deeply tied to the compiler should live in that core ring. However, for the moment, base (as we know it) is the first two layers of your proposal. As such, both bytestring and filepath belong in the base library. There is also the question of Cabal, your second layer is not guaranteed to be installed on all systems, so Cabal setup programs cannot use them. This means that all Cabal setup programs will have to keep randomly string hacking at FilePath's. This definitely sounds like the way to go for the future - it will make library porting to other compilers much easier. It is important to realise that this is the future, not the present, so to reject things from the base library on the basis they need moving to a place that doesn't currently exist is probably the wrong solution. I know Bulat is investigating this, are the GHC team/Igloo aiming to split up base with any particular target timeframe? Thanks Neil

Hello Neil, Thursday, November 23, 2006, 4:17:19 AM, you wrote:
* base libs are libs, which is guaranteed to be shipped with *every* haskell distribution.
That sounds fine, and when this work has been done, bytestring and filepath both deserve to live in this second ring. Only modules which are deeply tied to the compiler should live in that core ring.
However, for the moment, base (as we know it) is the first two layers of your proposal. As such, both bytestring and filepath belong in the base library.
so, the only reason why you want to include FilePath in Base is to make it available for any haskeller? i consider this as one more argument for GHC HQ to accept my proposal ;)
There is also the question of Cabal, your second layer is not guaranteed to be installed on all systems,
reread first line of message, please :)
so Cabal setup programs cannot use them. This means that all Cabal setup programs will have to keep randomly string hacking at FilePath's.
This definitely sounds like the way to go for the future - it will make library porting to other compilers much easier. It is important to realise that this is the future, not the present, so to reject things from the base library on the basis they need moving to a place that doesn't currently exist is probably the wrong solution.
I know Bulat is investigating this, are the GHC team/Igloo aiming to split up base with any particular target timeframe?
actually i investigate(d) another problem - splitting ghc.* into the simple ghc-specific and complex compiler-independent parts, i.e. reorganizing the future-coming Core library in a way that facilitate adding support of new compilers. this really needs rather complex rewriting of existing code what i proposed in this letter is an *independent* task. even two tasks - first, make a decision that filepath and fps modules may become a part of base libs if peoples want to have them with any ghc installation and this don't need much time ;) second - split base into GHC.* and remaining parts and see how this construction will fly :) sorry, i can't try it myself without recompiling GHC -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Hi
However, for the moment, base (as we know it) is the first two layers of your proposal. As such, both bytestring and filepath belong in the base library.
so, the only reason why you want to include FilePath in Base is to make it available for any haskeller? i consider this as one more argument for GHC HQ to accept my proposal ;)
There is also the question of Cabal, your second layer is not guaranteed to be installed on all systems,
reread first line of message, please :)
"on windows, it should be a part of monolithic installer while on unixes these libs may be a separate packages, but porters should ensure that they ported all these libs too" To me that implies that on unixes they will all be available to install, but not all be installed by default. That means they can't be used in cabal. For FilePath there is also the specific issue that its actually required by base (see System.Directory.Internal), but for fps is you can guarantee that all implementations provide this package in a transparent manner, and the user can't tell that its in a separate module and not base, then to the user they are the same thing. Thanks Neil

Hello Neil, Thursday, November 23, 2006, 1:23:19 PM, you wrote:
so, the only reason why you want to include FilePath in Base is to make it available for any haskeller? i consider this as one more argument for GHC HQ to accept my proposal ;)
"on windows, it should be a part of monolithic installer while on unixes these libs may be a separate packages, but porters should ensure that they ported all these libs too"
To me that implies that on unixes they will all be available to install, but not all be installed by default. That means they can't be used in cabal.
i'm not a unix guru so i missed this point :) but this seems to me as an argument to include filepath in a set of core libs, not a Base lib. i should reformulate this paragraph of my proposal: * core libs are installed as a aprt of ghc installation process. these includes libs that are either ghc-version dependent (base/stm/th) or required in process of installation of other libs (cabal, filepath, filesystem?) such decision will kill both hares - it will allow to use filepath lib in setup scripts and cabal itself and at the same time it will allow to install additional versions of filepath lib to use in user projects
For FilePath there is also the specific issue that its actually required by base (see System.Directory.Internal),
and you want to replace this module with your own, raising incompatibility problem again? how about going in opposite direction - moving filesystem-related modules from Base into your library? say, current version of Base is 2.0. you can release Base 2.1 + FilePath 2.1 which provides the same functionality as Base 2.0, only with modules rearranged. and then you can go to release FilePath 3.0, 4.0 and so on which may have backward-incompatible changes. anyone requiring just the old functionality then can install FilePath 2.10 and be happy, irrespective of Base version he uses -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Hi
* core libs are installed as a aprt of ghc installation process. these includes libs that are either ghc-version dependent (base/stm/th) or required in process of installation of other libs (cabal, filepath, filesystem?)
Yep, that seems a more sensible definition of core. All core libraries MUST be available to all Haskell implementations. If/when that direction is taken, things can be split out, but for the moment this is a future thing.
For FilePath there is also the specific issue that its actually required by base (see System.Directory.Internal),
and you want to replace this module with your own, raising incompatibility problem again?
I don't want to replace it now, but this might be something for the future, if the code is examined in detail, and seems to the same thing.
backward-incompatible changes. anyone requiring just the old functionality then can install FilePath 2.10 and be happy, irrespective of Base version he uses
I don't want to evolve or enhance FilePath, I want it to reach a stage where it provides a useful set of operations, and freeze it. I also don't want to pick up the responsibility for maintaining the File related chunks of base :) Thanks Neil

Hello Neil, Thursday, November 23, 2006, 4:33:57 PM, you wrote:
* core libs are installed as a aprt of ghc installation process. these includes libs that are either ghc-version dependent (base/stm/th) or required in process of installation of other libs (cabal, filepath, filesystem?)
Yep, that seems a more sensible definition of core. All core libraries MUST be available to all Haskell implementations. If/when that direction is taken, things can be split out, but for the moment this is a future thing.
it's no more future than inclusion of module in Base lib. we can discuss this just now and if GHC HQ will decline such proposal, i will agree that it may be better to include FilePath module in Cabal lib
For FilePath there is also the specific issue that its actually required by base (see System.Directory.Internal),
and you want to replace this module with your own, raising incompatibility problem again?
I don't want to replace it now, but this might be something for the future, if the code is examined in detail, and seems to the same thing.
so your argument for inclusion it into the Base is to have *two* modules here with overlapping functionality? :) someone who will does this optimization task may follow the same recommendations and move existing System.Directory modules into the FilePath lib. anyway, it will be better because it guarantees to not introduce backward-incompatible changes in non-upgradeable Base lib
backward-incompatible changes. anyone requiring just the old functionality then can install FilePath 2.10 and be happy, irrespective of Base version he uses
I don't want to evolve or enhance FilePath, I want it to reach a stage where it provides a useful set of operations, and freeze it. I also don't want to pick up the responsibility for maintaining the File related chunks of base :)
i always suspect that base inflated so much just because lack of responsibilitiness in some haskellers :) of course, it's much easier to put anything you can write here and don't think how it can be used and, while you can't imagine progress of FilePath module, i can do. what you propose to do in this case - have two filepath modules, one in the base and one in other place? or make incompatible changes in Base? to be concrete, i want to make these functions polymorphic and be able to work on various string-alikes experience shows that even such well-established modules as Data.List are sometimes changed. so, while your work is great, this don't mean that it will be frozen and can't be replaced with something even better -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On Thu, 2006-11-23 at 18:42 +0300, Bulat Ziganshin wrote:
it's no more future than inclusion of module in Base lib. we can discuss this just now and if GHC HQ will decline such proposal, i will agree that it may be better to include FilePath module in Cabal lib
No, putting FilePath into the Cabal lib is a very bad idea. Then loads of libs/progs will depend on the Cabal lib. As we know, the Cabal library api is not terribly stable. Duncan

Hello Duncan, Thursday, November 23, 2006, 7:56:35 PM, you wrote:
it's no more future than inclusion of module in Base lib. we can discuss this just now and if GHC HQ will decline such proposal, i will agree that it may be better to include FilePath module in Cabal lib
No, putting FilePath into the Cabal lib is a very bad idea. Then loads of libs/progs will depend on the Cabal lib. As we know, the Cabal library api is not terribly stable.
this looks strange but it is current state-of-the-art: it's better now to put anything into Cabal package rather than Base. why? because both packages are installed with ghc and cabal can be upgraded while base cannot :) well, i'm not serious. actually we need some package that can be upgraded via Cabal itself -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Hi
it's no more future than inclusion of module in Base lib.
It would be nice if your library splitting thing did happen so, although my feeling is that it probably won't happen as fast as you might hope, its quite a big change.
we can discuss this just now and if GHC HQ will decline such proposal, i will agree that it may be better to include FilePath module in Cabal lib
I think base is a much better place to put a library than Cabal. (as dcoutts said while I was writing this message)
so your argument for inclusion it into the Base is to have *two* modules here with overlapping functionality? :) someone who will does this optimization task may follow the same recommendations and move existing System.Directory modules into the FilePath lib. anyway, it will be better because it guarantees to not introduce backward-incompatible changes in non-upgradeable Base lib
I'm not 100% convinced the current System.Directory modules are correct, I haven't examined them in enough detail, but experience suggests that writing a FilePath library without QuickCheck and without the Windows spec on what a drive/share looks like in front of you will introduce corner cases.
and, while you can't imagine progress of FilePath module, i can do. what you propose to do in this case - have two filepath modules, one in the base and one in other place? or make incompatible changes in Base? to be concrete, i want to make these functions polymorphic and be able to work on various string-alikes
type FilePath = String I would hope that when/if we ever replace FilePath with a string-a-like or ADT, we might want to rename the type at the same time.
experience shows that even such well-established modules as Data.List are sometimes changed. so, while your work is great, this don't mean that it will be frozen and can't be replaced with something even better
It can, but I suspect the better thing wouldn't manipulate FilePath's, but general URL's or something with the file:// protocol as just a special case. We will never achieve perfection, but at some point we have to commit to providing something with a fixed API that people can use. Having things in a set of libraries which are tightly controlled is a good idea - currently as my libraries stand, I can change the functionality to reverse all the strings on the way out as I choose - hopefully if I did that to a base library someone would stop me. Thanks Neil

Hello Neil, Thursday, November 23, 2006, 7:57:53 PM, you wrote:
and, while you can't imagine progress of FilePath module, i can do. what you propose to do in this case - have two filepath modules, one in the base and one in other place? or make incompatible changes in Base? to be concrete, i want to make these functions polymorphic and be able to work on various string-alikes
type FilePath = String
I would hope that when/if we ever replace FilePath with a string-a-like or ADT, we might want to rename the type at the same time.
what i mean here: now we have, for example splitToBaseExt :: FilePath -> (FilePath,FilePath) the same function, in polymorphic way: splitToBaseExt :: FilePathClass fp => fp -> (fp,fp) and instance FilePathClass FilePath instance FilePathClass UTF8ByteString instance FilePathClass UTF16ByteString this change in interface would be indistinguishable for 99% of us. for the rest, old version of library should still be available. and only way to do it - versioning, that is impossible with Base
experience shows that even such well-established modules as Data.List are sometimes changed. so, while your work is great, this don't mean that it will be frozen and can't be replaced with something even better
It can, but I suspect the better thing wouldn't manipulate FilePath's, but general URL's or something with the file:// protocol as just a special case.
We will never achieve perfection, but at some point we have to commit to providing something with a fixed API that people can use.
YES! it's my whole argument - with Base, you can't provide fixed API. the only way to do it is to request library with specific version number that is installed via Cabal
Having things in a set of libraries which are tightly controlled is a good idea - currently as my libraries stand, I can change the functionality to reverse all the strings on the way out as I choose - hopefully if I did that to a base library someone would stop me.
sorry, i don't known that you are agent of KGB :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin wrote:
what i mean here: now we have, for example
splitToBaseExt :: FilePath -> (FilePath,FilePath)
the same function, in polymorphic way:
splitToBaseExt :: FilePathClass fp => fp -> (fp,fp) and instance FilePathClass FilePath instance FilePathClass UTF8ByteString instance FilePathClass UTF16ByteString
Let me try to put this in a diplomatic way: No.
this change in interface would be indistinguishable for 99% of us.
Err, no. 99% of us _don't_ write flawless programs. With every overloaded symbol you get worse error messages. Have you ever used C++? Ever got a screenful of completely incomprehensible gobbledygook because you forgot a namespace qualification somewhere? Go ahead with all these FooLike and BarAble classes and you get the same from Haskell (and then some, including exponential runtime of the type checker). Pathnames are short strings. No need to optimize for performance, instead optimize for clarity. An algebraic datatype reflecting the algebra of filenames would likely be even more clear, but defining a type class just to support different encodings is definitely overengineering and very likely a bad idea. Remember, this ends with std::basic_ios< char, std::char_traits<char> > or worse. -Udo -- Lebensmittelskandal: Gene im Mais entdeckt! (angeblich eine Schlagzeile aus der BILD)

On Sat, Nov 25, 2006 at 02:34:21AM +0100, Udo Stenzel wrote:
Pathnames are short strings. No need to optimize for performance, instead optimize for clarity.
There have been times in darcs where the performance of path names was an issue. For example, running "darcs whatsnew" in a large repository with no changes was taking a few seconds, I think (which doesn't sound very long, but feels like an age when you are waiting for the prompt to appear). I was able to cut it down to something almost unnoticable by optimising (and thus losing clarity), but I think the code would have been both faster and clearer had a suitable bytestring-like file path representation been available. Thanks Ian

Ian Lynagh wrote:
On Sat, Nov 25, 2006 at 02:34:21AM +0100, Udo Stenzel wrote:
Pathnames are short strings. No need to optimize for performance, instead optimize for clarity.
There have been times in darcs where the performance of path names was an issue.
Let me guess: Lots of (++) used in a left associative way compounded by lots of init, last and (reverse . dropWhile p . reverse)? If so, that's easily avoided by giving pathnames a structure. Lists have too little structure and operations are cheap at the wrong end. -Udo -- AMAZING BUT TRUE ... If all the salmon caught in Canada in one year were laid end to end across the Sahara Desert, the smell would be absolutely awful.

Hello Udo, Saturday, November 25, 2006, 4:34:21 AM, you wrote:
the same function, in polymorphic way:
splitToBaseExt :: FilePathClass fp => fp -> (fp,fp)
this change in interface would be indistinguishable for 99% of us.
Err, no. 99% of us _don't_ write flawless programs. With every overloaded symbol you get worse error messages. Have you ever used C++? Ever got a screenful of completely incomprehensible gobbledygook because you forgot a namespace qualification somewhere? Go ahead with all these FooLike and BarAble classes and you get the same from Haskell (and then some, including exponential runtime of the type checker).
you shouldn't mix C++ template system with Haskell classes. C++ can't check templates at the time where template defined that leads to too late error messages. just imagine that improper definition of 'sum' will barks on each call site with a message that you can't use (&&) on Ints. and complex types in such messages is just because templates *don't* use C++ class system with its abstraction ability and the whole type structure shows up in the message if you want to argument against my idea, it's better to find situation where Haskell classes bite you (and stop rely on false assumption that something that is like C++ is automatically bad)
Pathnames are short strings. No need to optimize for performance, instead optimize for clarity.
let's say that 99% of programs don't need any optimization at all. so there is no need in ByteString, Int and other stupid types. stop polymorphism and use BigDecimal for any numeric data! :) functional programming is widely recognized as strong but slow approach. while now anyone who need to write efficient program will probably select C++, things changes and we wrote more and more efficient libraries - be it for integers, strings, arrays or pathnames. I've broken the rule that archivers (like zip) should be written in C++ and developed one with Haskell. in order to make this program efficient, i've written several general-purpose libs that don't existed before - such as serialization or packed string ones, or I/O using unicode filenames so, now i have a code that allows to write efficient programs dealing with a very large number of files. next, Unix/Win works with utf8/utf16 encoded filenames. so, efficient program should use natural filename representation instead of converting to/from String while we can develop a series of libraries that works with filenames represented as Strings, UTF8 ByteStrings and so on, i think the right way is to have one FilePath library that uses operations of some typeclass. as long as you don't argue for restricting monad libraries to IO monad, array libraries - to boxed arrays and numeric libraries - to Integer, you should agree that functionality required only by *some* developers, makes error messages more complex for the rest moreover, i think that Haskell now is the best language for system programming, such as developing mailer daemon, gaming server, or transaction system. but lack of efficient networking, I/O and data structure libraries makes development of system software sort of do-it-yourself task
An algebraic datatype reflecting the algebra of filenames would likely be even more clear, but defining a type class just to support different encodings is definitely overengineering and very likely a bad idea. Remember, this ends with std::basic_ios< char, std::char_traits<char> > or worse.
yes, types are complex nowadays :) you should look into my Streams library which includes such type of beasts. it uses class-based, multi-layered design in order to provide wide set of operations on wide set of stream types with wide set of optional modifiers (such as Char encoding or inter-thread locking). type classes allows here to split functionality into smaller manageable pieces, that can be easily replaced with 3rd-party libs. can you propose alternative design that allow the same flexibility with a less cluttered type names? i think no. the good news for you is that Haskell can infer types and constraints so using very complex types don't need a tons of type constructors as in C++ complex type names reflects *factorizing* of functionality and that is the C++ templates idea that i reused in my Streams lib. instead of defining a lot of independent getByte operations for each possible stream type, i use a class here, and this allows the next, serialization level, to work with any stream. i think that type classes are underweighted in Haskell community because it's not classical FP technique, and while we can't live without standard classes, we develop too small number of our own ones. or at least, not in all areas. besides of Monad or IArray classes, we should think about collection classes (for which Stringable is just a very partial case) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin wrote:
you shouldn't mix C++ template system with Haskell classes. C++ can't check templates at the time where template defined that leads to too late error messages. just imagine that improper definition of 'sum' will barks on each call site with a message that you can't use (&&) on Ints.
Instead it will tell you that there is no instance for (Boolean Int), and it will do so at every call site, assuming (&&) was indeed overloaded. Where's the difference? And conversely, a properly defined 'sum' will tell you that there is no instance for (Num String) at every wrong call site, which again is just the same, of course assuming that nobody made String into an instance of Num. Sounds like we're actually in violent agreement here. -Udo -- "Let me be the first Common Lisp troll to mount the pulpit and scream, Greenspuns 10th Law waved high in my clenched fist, 'Been there, done that'." -- Will Hartung, in response to the Meta Programming System for Java

Hello Udo, Sunday, November 26, 2006, 5:21:29 PM, you wrote:
you shouldn't mix C++ template system with Haskell classes. C++ can't check templates at the time where template defined that leads to too late error messages. just imagine that improper definition of 'sum' will barks on each call site with a message that you can't use (&&) on Ints.
Instead it will tell you that there is no instance for (Boolean Int), and it will do so at every call site, assuming (&&) was indeed overloaded. Where's the difference? And conversely, a properly defined 'sum' will tell you that there is no instance for (Num String) at every wrong call site, which again is just the same, of course assuming that nobody made String into an instance of Num. Sounds like we're actually in violent agreement here.
seems that you never used type signatures. just try: sum :: Num a => [a] -> a sum = foldr1 (&&) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Hmmm, this whole base library reoganization discussion gets a little bit long a confusing, because quite a few things are mixed up IMHO, so I don't even know to which mail I should reply... Just a few miscellaneous thoughts about this area: * Splitting up libraries in tiny little packages does not only have advantages. Even if every small package is well-tested, there is no guarantee at all that it will work well with the rest of the packages. If we split up things more and more, this problem will get more severe, because probably nobody will have the same set of versioned packages as somebody else => testing nightmare! * There are other quite successful libraries out there, which are very monolithic: Java's standard libraries, Boost, etc. Their advantage is: If I download version XY of them, I get a consistent, well-tested library. * Bulat wants to do several things at once, if I understand it correctly: a) Split the compiler-dependent parts of the libraries from the portable ones b) Introduce a finer package granularity in general. While I think that a) is a worthy goal, I think that this will be very, very tricky due to the fact that different Haskell implementations have quite different notions of builtins, extensions, etc. Furthermore, I am not yet fully convinced that the resulting structure will be vastly superior regarding readability and maintainability, sometimes some simple CPP tricks are the lesser evil. Regarding b): As already mentioned above, there is always a tension between the ease of upgrading and testing. Furthermore, we should not abuse the package system to get versioned *modules*. Anyway, let's not mix a) and b)! * It is silly to split a data type like FilePath and the only portable operations on it into different packages. Let's put the file path handling operations whereever FilePath lives, and this is "base" in the foreseeable future. Discussing if FilePath should belong into "base" is a different topic. Cheers, S.

Hello Sven, Friday, November 24, 2006, 11:32:35 AM, you wrote:
Hmmm, this whole base library reoganization discussion gets a little bit long a confusing, because quite a few things are mixed up IMHO, so I don't even know to which mail I should reply...
Just a few miscellaneous thoughts about this area:
* Splitting up libraries in tiny little packages does not only have advantages. Even if every small package is well-tested, there is no guarantee at all that it will work well with the rest of the packages. If we split up things more and more, this problem will get more severe, because probably nobody will have the same set of versioned packages as somebody else => testing nightmare!
this problem may be solved by versioning policy (or police :), i will write a separate letter about it
* There are other quite successful libraries out there, which are very monolithic: Java's standard libraries, Boost, etc. Their advantage is: If I download version XY of them, I get a consistent, well-tested library.
i think that you just not enough involved to see complaints about impossibility of using new features in old projects
* Bulat wants to do several things at once, if I understand it correctly: a)
no. i discuss several things at once, because Neil thinks that these things must be done at once. But as i said in each letter, we don't need to wait major splitting of Base library to start development in new way. problems he mentioned may be solved just by inclusion FilePath into the set of base libs, and it's very easy change
Split the compiler-dependent parts of the libraries from the portable ones b) Introduce a finer package granularity in general. While I think that a) is a worthy goal, I think that this will be very, very tricky due to the fact that different Haskell implementations have quite different notions of builtins, extensions, etc. Furthermore, I am not yet fully convinced that the resulting structure will be vastly superior regarding readability and maintainability, sometimes some simple CPP tricks are the lesser evil.
i'm not purist and don't propose to do something supernatural. my plan is just to split base at the natural bound (ghc.*) and look how this can be made more portable by moving parts of code between two splitted parts
* It is silly to split a data type like FilePath and the only portable operations on it into different packages. Let's put the file path handling operations whereever FilePath lives, and this is "base" in the foreseeable future. Discussing if FilePath should belong into "base" is a different topic.
of course, it will be much better to move all I/O stuff from Base into separate package. that's impossible, though, because: 1) Prelude needs readFile and other I/O operations that can be imported only from Base (afaiu) 2) "instance Monad IO" defines 'fail' for I/O monad which uses Exception type whose definition involves Handle i think that these two problems shows "monolithic design" problem of Haskell itself, but while we should live with it, it should not force us to put everything Prelude-related into Base. naturally, FilePath type should belong to Files package, not amorphous and non-upgradeable Base. while we can't do it, we should at least put any other functionality here, again, while "put the type and its functions together" is a nice theory, practice, in this case, shows that 1) FilePath type never mind to change itself :) 2) Base is non-upgradeable which creates real problems for using functionality included here -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Am Freitag, 24. November 2006 11:22 schrieb Bulat Ziganshin:
[...] i think that you just not enough involved to see complaints about impossibility of using new features in old projects
And *I* think that *you* have just not been involved long enough in the Haskell business to make assumptions about me.
[...] i'm not purist and don't propose to do something supernatural. my plan is just to split base at the natural bound (ghc.*) and look how this can be made more portable by moving parts of code between two splitted parts
To make this effort worthwile, the new arrangement should support jhc, yhc, nhc98, ... as well (and doesn't break Hugs). And do you consider platform portability issues (Linux vs. Windows vs. Mac OS vs. Solaris vs. ...) Are there already some results to look at? Cheers, S.

On Thu, Nov 23, 2006 at 01:17:19AM +0000, Neil Mitchell wrote:
I know Bulat is investigating this, are the GHC team/Igloo aiming to split up base with any particular target timeframe?
It would be possible to split off bytestring, containers, prettyprinting and printf now (though some of them would still be in GHC's core, as they're used by Cabal). Splitting the rest is more complicated than picking GHC.*, as there are many interdependencies. But we could do the easy part now. On Thu, Nov 23, 2006 at 03:35:49AM +0300, Bulat Ziganshin wrote:
in particular, my hottest hope is that ghc 6.6.1 will be shipped with fps 0.8 as separate library that will provide both backward compatibility with 6.6 and will allow to upgrade fps without recompiling ghc itself :D
This would be a violation of the "no interface changes in minor releases" rule (though at the package level rather than the module level, assuming the split fps was core), but I think there's a strong argument for it, since development of this package is continuing outside base.

Hello Ross, Thursday, November 23, 2006, 11:55:32 AM, you wrote:
It would be possible to split off bytestring, containers, prettyprinting and printf now (though some of them would still be in GHC's core, as they're used by Cabal). Splitting the rest is more complicated than picking GHC.*, as there are many interdependencies. But we could do the easy part now.
i think that most important tasks is splitting off of rather new code, especially code added/changed in 6.6. this can create possibility to use it with ghc 6.4; moreover, this code is more likely to change in future i don't know every bit of base lib, but i suppose that any code on which ghc.*/Hugs.Prelude is not dependent can be easily moved outside? -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

ross:
On Thu, Nov 23, 2006 at 01:17:19AM +0000, Neil Mitchell wrote:
I know Bulat is investigating this, are the GHC team/Igloo aiming to split up base with any particular target timeframe?
It would be possible to split off bytestring, containers, prettyprinting and printf now (though some of them would still be in GHC's core, as they're used by Cabal). Splitting the rest is more complicated than picking GHC.*, as there are many interdependencies. But we could do the easy part now.
On Thu, Nov 23, 2006 at 03:35:49AM +0300, Bulat Ziganshin wrote:
in particular, my hottest hope is that ghc 6.6.1 will be shipped with fps 0.8 as separate library that will provide both backward compatibility with 6.6 and will allow to upgrade fps without recompiling ghc itself :D
This would be a violation of the "no interface changes in minor releases" rule (though at the package level rather than the module level, assuming the split fps was core), but I think there's a strong argument for it, since development of this package is continuing outside base.
I'd be ok with this. I'm interested in SimonM's opinion, as he was interested in adding it to base originally (to replace PackedString, and to have things in base use ByteStrings). -- Don

Hello Donald, Friday, November 24, 2006, 5:15:04 AM, you wrote:
I'm interested in SimonM's opinion, as he was interested in adding it to base originally (to replace PackedString, and to have things in base use ByteStrings).
oh, no. Base never used PackedStrings. and if something in Base go to be rewritten using BS, it's better to split this up into separate package -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Donald Bruce Stewart wrote:
ross:
On Thu, Nov 23, 2006 at 01:17:19AM +0000, Neil Mitchell wrote:
I know Bulat is investigating this, are the GHC team/Igloo aiming to split up base with any particular target timeframe?
It would be possible to split off bytestring, containers, prettyprinting and printf now (though some of them would still be in GHC's core, as they're used by Cabal). Splitting the rest is more complicated than picking GHC.*, as there are many interdependencies. But we could do the easy part now.
On Thu, Nov 23, 2006 at 03:35:49AM +0300, Bulat Ziganshin wrote:
in particular, my hottest hope is that ghc 6.6.1 will be shipped with fps 0.8 as separate library that will provide both backward compatibility with 6.6 and will allow to upgrade fps without recompiling ghc itself :D
This would be a violation of the "no interface changes in minor releases" rule (though at the package level rather than the module level, assuming the split fps was core), but I think there's a strong argument for it, since development of this package is continuing outside base.
I'd be ok with this.
I'm interested in SimonM's opinion, as he was interested in adding it to base originally (to replace PackedString, and to have things in base use ByteStrings).
We shouldn't change anything for 6.6.1, but we can reconsider for 6.8. If we think it's unlikely that anything in base will use ByteString, or that we can extract anything that does require ByteString into separate packages, then it might make sense to separate it again. Cheers, Simon

Am Donnerstag, 23. November 2006 09:55 schrieb Ross Paterson:
[...] On Thu, Nov 23, 2006 at 03:35:49AM +0300, Bulat Ziganshin wrote:
in particular, my hottest hope is that ghc 6.6.1 will be shipped with fps 0.8 as separate library that will provide both backward compatibility with 6.6 and will allow to upgrade fps without recompiling ghc itself :D
This would be a violation of the "no interface changes in minor releases" rule (though at the package level rather than the module level, assuming the split fps was core), but I think there's a strong argument for it, since development of this package is continuing outside base.
I strongly object against the violation of this rule: A lot people on this list seem to have a programmer's view only, but forget about the people packaging and distributing SW. Breaking the rule makes the life for the latter people much, much harder and would lead our numbering scheme ad absurdum. Cheers, S.

Hello Sven, Friday, November 24, 2006, 11:01:55 AM, you wrote:
in particular, my hottest hope is that ghc 6.6.1 will be shipped with fps 0.8 as separate library that will provide both backward compatibility with 6.6 and will allow to upgrade fps without recompiling ghc itself :D
This would be a violation of the "no interface changes in minor releases" rule (though at the package level rather than the module level, assuming the split fps was core), but I think there's a strong argument for it, since development of this package is continuing outside base.
I strongly object against the violation of this rule: A lot people on this list seem to have a programmer's view only, but forget about the people packaging and distributing SW. Breaking the rule makes the life for the latter people much, much harder and would lead our numbering scheme ad absurdum.
we want to break this rule just to make packaging and distribution easier. inclusion of fps into Bse was mistake, imho, which should be fixed asap. 6.6.0 probably is not in wide use, and we propose the most compatible plan which breaks only .cabal files. these files are already broken on 6.4->6.6 switch and we just want to restore 6.4 behavior - usage of ByteString require import of FPS library. so, we will end up with two sorts of Cabal files - one for 6.6.0 and one for all other ghc versions alternative solution - continue to include fps 0.8 in Base lib, and upgrade it to 0.9 in 6.8, will mean a much more serious incompatibility when switching to 6.8. plus, it will make impossible using of fps 0.9 in about year, until 6.8 arrives Don's solution - include fps 0.9 as part of 6.6.1 Base is even more terrible - it's 100% violation of these rules so, now we need to select most gracious plan of escaping from problem created by inclusion of FPS in base lib -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On Fri, 2006-11-24 at 12:18 +0300, Bulat Ziganshin wrote:
alternative solution - continue to include fps 0.8 in Base lib, and upgrade it to 0.9 in 6.8, will mean a much more serious incompatibility when switching to 6.8. plus, it will make impossible using of fps 0.9 in about year, until 6.8 arrives
Don's solution - include fps 0.9 as part of 6.6.1 Base is even more terrible - it's 100% violation of these rules
Um, no it isn't. fps 0.9 is completely API compatible with the current version. It's a performance upgrade only. We are not breaking API. We knew this when we had it included in base, so we trimmed the API down to make it supportable. We have no problem following the rules. Duncan

Am Freitag, 24. November 2006 12:23 schrieb Duncan Coutts:
[...] Um, no it isn't. fps 0.9 is completely API compatible with the current version. It's a performance upgrade only. We are not breaking API.
We knew this when we had it included in base, so we trimmed the API down to make it supportable. We have no problem following the rules.
If this is the case, there is no reason to *not* include fps 0.9 in "base" for 6.6.1. If we all agree that it would be better to have it somewhere else, we can do this for 6.8. Cheers, S.

On Fri, 2006-11-24 at 13:00 +0100, Sven Panne wrote:
Am Freitag, 24. November 2006 12:23 schrieb Duncan Coutts:
[...] Um, no it isn't. fps 0.9 is completely API compatible with the current version. It's a performance upgrade only. We are not breaking API.
We knew this when we had it included in base, so we trimmed the API down to make it supportable. We have no problem following the rules.
If this is the case, there is no reason to *not* include fps 0.9 in "base" for 6.6.1.
Yes, this was our original plan.
If we all agree that it would be better to have it somewhere else, we can do this for 6.8.
Sure. Duncan

Hello Sven, Friday, November 24, 2006, 3:00:35 PM, you wrote:
Um, no it isn't. fps 0.9 is completely API compatible with the current version. It's a performance upgrade only. We are not breaking API.
We knew this when we had it included in base, so we trimmed the API down to make it supportable. We have no problem following the rules.
If this is the case, there is no reason to *not* include fps 0.9 in "base" for 6.6.1. If we all agree that it would be better to have it somewhere else, we can do this for 6.8.
oh no! if you mean Base library here, this will continue the same problem - when something new will be added to FPS, it will be impossible to use it before 6.8 arrives. and with 6.8, all old programs will stop working because FPS changes i just try to solve our *future* problems, which you don't foresee -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Am Freitag, 24. November 2006 15:37 schrieb Bulat Ziganshin:
Hello Sven,
Friday, November 24, 2006, 3:00:35 PM, you wrote:
[...] If this is the case, there is no reason to *not* include fps 0.9 in "base" for 6.6.1. If we all agree that it would be better to have it somewhere else, we can do this for 6.8.
oh no! if you mean Base library here, this will continue the same problem - when something new will be added to FPS, it will be impossible to use it before 6.8 arrives. and with 6.8, all old programs will stop working because FPS changes
This is *exactly* what I want to achieve: No API changes between minor releases. It might very well be a personal tragedy for you that some really cool new feature won't show up for some time, but I think I can live with that. And may I remind you of your own proposed major/minor numbering scheme?
i just try to solve our *future* problems, which you don't foresee
I really urge you to improve your writing style: Almost all your emails seem to imply that you have extremely elegant brand-new solutions to the hardest problems, envision the future without using a crystal ball, have mad programming skillz, and know what the world wants, while the rest of the people on the lists are shortsighted idiots. If that's not what you want to express, think twice before hitting "Send"... Cheers, S.

Am Freitag, 24. November 2006 10:18 schrieb Bulat Ziganshin:
[...] we want to break this rule just to make packaging and distribution easier. [...]
Apart from being a contradiction in itself, it is quite funny that you argue against your own version numbering proposal. Of course everybody thinks that he has a very special case, and general rules of course don't apply then, but then we could immediately abandon any numbering scheme because its semantics would be void...
inclusion of fps into Bse was mistake, imho, which should be fixed asap. 6.6.0 probably is not in wide use, and we propose the most compatible plan which breaks only .cabal files. these files are already broken on 6.4->6.6 switch and we just want to restore 6.4 behavior - usage of ByteString require import of FPS library. so, we will end up with two sorts of Cabal files - one for 6.6.0 and one for all other ghc versions [...]
Making assumptions who will use what are a bit dangerous. And it doesn't really matter if "only" .cabal files are broken or an import has to be changed or an identifier has to replaced all over the project: A working project will be broken, and some manual intervention will be needed. Cheers, S.

On Thu, Nov 23, 2006 at 01:17:19AM +0000, Neil Mitchell wrote:
I know Bulat is investigating this, are the GHC team/Igloo aiming to split up base with any particular target timeframe?
I hope that we will have made significant progress for GHC 6.8. Note that we don't have to do it all at once - we can pull individual packages out of the top or bottom of the dependency graph (with a few fiddly changes along the way to make everything still work). Thanks Ian

This is a small reply to clarify the regular expression situation: Bulat Ziganshin wrote:
Hello libraries,
after analyzing the situation, i concluded that source of problem, at least partially, is GHC HQ's policy of packaging libraries with GHC. The list of such libraries is *closed* and odd at first look. why, for example, it includes 2 of 4 regexp libs? at last end, we can learn that this is the list of libs required to build ghc itself!
Some of the other regex-* libraries are interfaces to c-library backends (pcre and tre) and it is not GHC's place to come with copies of those libraries. But GHC used regex internally, so it must come with at least a single backend.
[...snip...]
and while we are here - splitting of Base library should be very easy task. its ghc version specific part is in GHC.* modules. these modules should be moved into the new Core library. plus a few modules from Data.* or System.* hierarchy they imports. plus a few modules imported by Hugs/NHC Prelude. the rest of Base library should be pretty portable, at least between various GHC versions.
and independent on this work, we can always look into moving pieces of Base into independent libs. as a rule of thumb, everything not used in Base lib may be moved outside of it. of course, these new libs should be included in base libs set
The regex-* modules that are installed with GHC are not in the "base" package. They are in "regex-base" and "regex-posix" and "regex-compat" because I took excellent design advice and finely split the modules. I see no reason one could not by able to upgrade these on top of the GHC versions.
in particular, my hottest hope is that ghc 6.6.1 will be shipped with fps 0.8 as separate library that will provide both backward compatibility with 6.6 and will allow to upgrade fps without recompiling ghc itself :D
By separate library you really mean using a separate package name instead of "base". The Text.XHtml is already separate into the "xhtml" package. You are correct: as far as I can see the only module that is in "base" which might need to be split out is Data.ByteString. The same may or may not apply to Data.Sequence. Cheers, Chris

Hello Chris, Thursday, November 23, 2006, 1:20:51 PM, you wrote:
example, it includes 2 of 4 regexp libs? at last end, we can learn that this is the list of libs required to build ghc itself!
Some of the other regex-* libraries are interfaces to c-library backends (pcre and tre) and it is not GHC's place to come with copies of those libraries. But GHC used regex internally, so it must come with at least a single backend.
what means "used internally"? you mean compiler sources? i don't see reasons why each copy of ghc should be able to compile ghc itself
The regex-* modules that are installed with GHC are not in the "base" package. They are in "regex-base" and "regex-posix" and "regex-compat" because I took excellent design advice and finely split the modules. I see no reason one could not by able to upgrade these on top of the GHC versions.
of course. i say here about base libraries, i.e. those strange set shipped with ghc 6.6. i argue to including here not only regex-* which is excellent work, but other widely used libs too
You are correct: as far as I can see the only module that is in "base" which might need to be split out is Data.ByteString. The same may or may not apply to Data.Sequence.
ByteString is most offending example, but not alone. what is the base library now? is it about data structures, I/O, concurrency or monads? there is no answer - this lib contains everything developed by peoples having accounts at darcs.haskell.org. why it's impossible to use Applicative class with ghc 6.4? because Ross Paterson was so kind to include this in a base lib. why peoples get a problems with their mutable arrays in 6.6? because arrays interface was changed and there is no way to use old lib in 6.6. why ForeignPtrs in 6.4 are slow? because it's a part of base lib and it's impossible to use faster ForeignPtr implementation without upgrading entire compiler. and so on, so on inflation of base library and inability to upgrade it have cumulative effect. i think that our ultimate goal is a set of ghc-independent concrete libs: arrays, control, files, concurrency... and any step in this direction will simplify upgrading to next ghc version -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin wrote:
what is the base library now? is it about data structures, I/O, concurrency or monads? there is no answer - this lib contains everything developed by peoples having accounts at darcs.haskell.org. why it's impossible to use Applicative class with ghc 6.4? because Ross Paterson was so kind to include this in a base lib. why peoples get a problems with their mutable arrays in 6.6? because arrays interface was changed and there is no way to use old lib in 6.6. why ForeignPtrs in 6.4 are slow? because it's a part of base lib and it's impossible to use faster ForeignPtr implementation without upgrading entire compiler. and so on, so on
inflation of base library and inability to upgrade it have cumulative effect. i think that our ultimate goal is a set of ghc-independent concrete libs: arrays, control, files, concurrency... and any step in this direction will simplify upgrading to next ghc version
Chris:
example, it includes 2 of 4 regexp libs? at last end, we can learn that this is the list of libs required to build ghc itself!
Some of the other regex-* libraries are interfaces to c-library backends (pcre and tre) and it is not GHC's place to come with copies of those
I think Bulat has a made very convincing argument here. These problems with upgrading (or downgrading, for compatibility) of base library have bitten me too sometimes. libraries. Â But
GHC used regex internally, so it must come with at least a single backend.
what means "used internally"? you mean compiler sources? i don't see reasons why each copy of ghc should be able to compile ghc itself
In the improbable case that Haskell compiler has been installed without some basic libraries, I think it would be okay if ghc build would complain that it needs library X or Y. It should say from where these can be downloaded and the installation should be straight forward. Ben

Hi
In the improbable case that Haskell compiler has been installed without some basic libraries, I think it would be okay if ghc build would complain that it needs library X or Y. It should say from where these can be downloaded and the installation should be straight forward.
That's not the job of GHC, that's the job of Cabal. And if the libraries to run Cabal are not present, then what happens? Thanks Neil

Neil Mitchell wrote:
In the improbable case that Haskell compiler has been installed without some basic libraries, I think it would be okay if ghc build would complain that it needs library X or Y. It should say from where these can be downloaded and the installation should be straight forward.
That's not the job of GHC, that's the job of Cabal. And if the libraries to run Cabal are not present, then what happens?
This would be bad. Of course there must be some core libraries that have to be shipped with the compiler. Cabal and anything that cabal needs to run is definitely a must-have. What I am arguing for (and Bulat, if I understand him correctly) is that it's ok if building the _compiler itself_ (or profiler or whatever else (apart from some exceptions like cabal) is shipped with the compiler) needs libraries from outside the core library set. Cheers, Ben

On Thu, 2006-11-23 at 19:15 +0100, Benjamin Franksen wrote:
Neil Mitchell wrote:
In the improbable case that Haskell compiler has been installed without some basic libraries, I think it would be okay if ghc build would complain that it needs library X or Y. It should say from where these can be downloaded and the installation should be straight forward.
That's not the job of GHC, that's the job of Cabal. And if the libraries to run Cabal are not present, then what happens?
This would be bad. Of course there must be some core libraries that have to be shipped with the compiler. Cabal and anything that cabal needs to run is definitely a must-have.
Sadly this may be rather expansive. Building software is not a simple task. If we include cabal-get too then that pulls in networking, http, and if we want to do security properly a bit of crypto too.
What I am arguing for (and Bulat, if I understand him correctly) is that it's ok if building the _compiler itself_ (or profiler or whatever else (apart from some exceptions like cabal) is shipped with the compiler) needs libraries from outside the core library set.
Yes. I agree. Since GHC is currently statically linked, the set of libs that are required to build GHC need not be related to the set of libs that come with GHC by default. Duncan

Duncan Coutts wrote:
This would be bad. Of course there must be some core libraries that have to be shipped with the compiler. Cabal and anything that cabal needs to run is definitely a must-have.
Sadly this may be rather expansive. Building software is not a simple task. If we include cabal-get too then that pulls in networking, http, and if we want to do security properly a bit of crypto too.
While I'm happy to see this discussion (the base inflation has been a hobby horse of mine for some time now), I think that the important issue is the definition of the packages, not bundling and unbundling with the compiler. As I see it, this comes down to whether you want cathedral or bazaar-style development: When a library comes as a separate package, it is easy to download the current development version with darcs, install it in place of the default compiler version with cabal, and tinker away. If it is part of base (or any other huge, catch-all package), things get more complicated and it is simpler to wait for the next release ex cathedra. For instance, I used to follow FPS regularly, and played with it a bit, (e.g., I implemented support for non-latin 8-bit charsets). After it got incorporated in base, I instead just whine and wait, even for simple stuff like interface issues that I could easily fix myself. This is not to say that the cathedral model is necessarily a bad one, but it seems a shame that with tools that seem so ideal for bazaar-style development, users are reduced from participants to consumers. -k

Am Freitag, 24. November 2006 10:06 schrieb Ketil Malde:
[...] This is not to say that the cathedral model is necessarily a bad one, but it seems a shame that with tools that seem so ideal for bazaar-style development, users are reduced from participants to consumers.
Even if my last emails on this list might give a different impression, I really like bazaar-style development. But currently all the necessary tools (cabal-get etc.) and APIs (e.g. stuff needed in the Setup.hs for Cabal) are far from being stable and widespread (Does your latest and greatest openSUSE DVD or Ubuntu download have all this? And if yes, which API version? Does your Setup.hs still work?). This is no criticism of the projects, quite the opposite, it is just the current state of affairs. I fear that if we move from the cathedral to the bazaar too fast without having the necessary infrastructure already on everybody's hard disk, we will hurt Haskell development more than we help it. Cheers, S.

Hi I'm proud to present yet another tremendously important contribution to the ever-growing collection of Haskell libraries. FPS was included in 'base' for recent GHCs, which has broken backwards compatiblity of .cabal files (since they typically Build-Depends on base and fps). My solution is a new fps package which contains no useful functionality at all, and which consequently, should go in the officially sanctioned and sprinkled-with-holy-water core libraries ASAP. :-) Anyway: Version: 0.8 Availability: darcs get http://www.ii.uib.no/~ketil/fps Functionality: none Bugs: none known Todo: QuickCheck properties, Haddock documentation Enjoy! -k

Hello Ketil, Friday, November 24, 2006, 1:10:43 PM, you wrote:
FPS was included in 'base' for recent GHCs, which has broken backwards compatiblity of .cabal files (since they typically Build-Depends on base and fps).
great work. sad that i don't found this solution before you. the only problem is that it need to be downloaded but it's not worse than with 6.4 is it possible to integrate this with 0.8 sources in order to get package that will work with any ghc version (6.4, 6.6.0, 6.6.1) and allow us to write just one cabal file for all ghc versions? -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Hello Sven, Friday, November 24, 2006, 12:24:34 PM, you wrote:
This is not to say that the cathedral model is necessarily a bad one, but it seems a shame that with tools that seem so ideal for bazaar-style development, users are reduced from participants to consumers.
Even if my last emails on this list might give a different impression, I really like bazaar-style development. But currently all the necessary tools (cabal-get etc.) and APIs (e.g. stuff needed in the Setup.hs for Cabal) are far from being stable and widespread (Does your latest and greatest openSUSE DVD or Ubuntu download have all this? And if yes, which API version? Does your Setup.hs still work?). This is no criticism of the projects, quite the opposite, it is just the current state of affairs. I fear that if we move from the cathedral to the bazaar too fast without having the necessary infrastructure already on everybody's hard disk, we will hurt Haskell development more than we help it.
i'm pretty happy with just darcs + cabal (and i also participated in fps development a bit). while for the users who can't use it, the things will remain the same - they will got a large number of preinstalled and/or easily installed libs which they can consider as unbreakable thing. and at the same time, any new libs they install may silently require other versions of the same libs, install them and users will not even see that something changed so, i think that both models now supported, we just don't have tools to simplify working in bazaar model -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Hello Ketil, Friday, November 24, 2006, 12:06:43 PM, you wrote:
While I'm happy to see this discussion (the base inflation has been a hobby horse of mine for some time now), I think that the important issue is the definition of the packages, not bundling and unbundling with the compiler.
as i already said, we have both problems with Base and this have cumulative effect -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Duncan Coutts wrote:
On Thu, 2006-11-23 at 19:15 +0100, Benjamin Franksen wrote:
What I am arguing for (and Bulat, if I understand him correctly) is that it's ok if building the _compiler itself_ (or profiler or whatever else (apart from some exceptions like cabal) is shipped with the compiler) needs libraries from outside the core library set.
Yes. I agree.
Since GHC is currently statically linked, the set of libs that are required to build GHC need not be related to the set of libs that come with GHC by default.
Just one comment here: the set of packages required to build GHC is actually very small: just unix (if you're on Unix) and regex-compat. The set of packages required to build a stage 2 GHC is larger, but we include all those in the source tree. Yes there's no reason that we actually have to *install* these packages too, but it seems silly not to, since we just built them. It would be more trouble to arrange that we didn't install them, I guess. Cheers, Simon

Hello Simon, Friday, November 24, 2006, 2:09:05 PM, you wrote:
Since GHC is currently statically linked, the set of libs that are required to build GHC need not be related to the set of libs that come with GHC by default.
Yes there's no reason that we actually have to *install* these packages too, but it seems silly not to, since we just built them. It would be more trouble to arrange that we didn't install them, I guess.
for me the problem is not that you include these packages - i like them all (except for ghc-library). the problem is that you don;t want to make guarantees that anything else will be available with *every* haskell installation. i think that set of base libraries should be redesigned to include all the widely used functionality. this includes FPS, although it's not used for build GHC. this includes Time package. this includes NewBinary. i.e. we should provide really rich set of libs to every haskell user. and when Neil, for example, arote a great lib which he thinks should be available to every haskell user, he should not propose to include it in Base, he should propose to include it in this base libs set -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin wrote:
Hello Simon,
Friday, November 24, 2006, 2:09:05 PM, you wrote:
Yes there's no reason that we actually have to *install* these packages too, but it seems silly not to, since we just built them. It would be more trouble to arrange that we didn't install them, I guess.
for me the problem is not that you include these packages - i like them all (except for ghc-library). the problem is that you don;t want to make guarantees that anything else will be available with *every* haskell installation.
What makes you think we don't want that? We (the GHC developers) are very supportive of the idea of having a consistent set of packages provided by default (whatever that means) across different compilers and platforms. Cheers, Simon

On Fri, Nov 24, 2006 at 11:09:05AM +0000, Simon Marlow wrote:
Since GHC is currently statically linked, the set of libs that are required to build GHC need not be related to the set of libs that come with GHC by default.
Just one comment here: the set of packages required to build GHC is actually very small: just unix (if you're on Unix) and regex-compat. The set of packages required to build a stage 2 GHC is larger, but we include all those in the source tree.
Yes there's no reason that we actually have to *install* these packages too, but it seems silly not to, since we just built them. It would be more trouble to arrange that we didn't install them, I guess.
Also, once we have dynamic libraries working we'll have to go back to installing them again (or jump through some hoops), so it seems shortsighted to go this route. Thanks Ian

Hello Ian, Friday, November 24, 2006, 8:17:59 PM, you wrote:
Since GHC is currently statically linked, the set of libs that are required to build GHC need not be related to the set of libs that come with GHC by default.
Also, once we have dynamic libraries working we'll have to go back to installing them again (or jump through some hoops), so it seems shortsighted to go this route.
i think about standardization (i.e. inclusion in set of Core libs) of library as 4-step process: * library author propose to do it * user wants this library * compiler developers and porters agree to support it * deal! in general, users want to include as much libs as possible while developers/porters want to have to support as few libs as possible. so main problem is balance between these two requirements if developers want to include more - as in this case - it is no problem at all (with exception of large libs that will significantly increase size of downloading/installation) so, i don't see any reason to discontinue including in GHC bundles these small libs which you support anyway. my request was about inclusion in this set additional libs, which is not required to compile ghc but nevertheless widely used and should be easily available, say, for windows users -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On Sun, Nov 26, 2006 at 01:19:24PM +0300, Bulat Ziganshin wrote:
which is not required to compile ghc but nevertheless widely used and should be easily available, say, for windows users
You seem to be implying that "not included with $implementation" means "not easily available". This means that any library not included in this core libs set is not easily available, which is not a good position for us to be in! It means library writers are unhappy that no-one uses their libraries, users are unhappy that it is hard to get libraries they need and increases the pressure on us to put more libraries into core libs. For GHC at least, the set of libraries included isn't going to change before 6.8, so we have until then to bring Hackage up to speed so that this is not true. So, I would like to through down the gauntlet to the community to make this happen! We have ambitions to make large steps in this direction at Hac 07 http://haskell.org/haskellwiki/Hac_2007 (but that shouldn't stop people who can't be there from working on it too, or people working on it before then!). Thanks Ian

Hello Ian, Monday, November 27, 2006, 5:47:01 PM, you wrote:
It means library writers are unhappy that no-one uses their libraries, users are unhappy that it is hard to get libraries they need and increases the pressure on us to put more libraries into core libs.
All you need is to be in Cabal! Cabal, Cabal, Cabal! It's all you need!!! :) i will write more serious answer in another letter :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Hello Ian, Monday, November 27, 2006, 5:47:01 PM, you wrote:
For GHC at least, the set of libraries included isn't going to change before 6.8
i don't see any problems in 1) including more libraries 2) including more versions of the same libraries -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On Mon, Nov 27, 2006 at 02:47:01PM +0000, Ian Lynagh wrote:
For GHC at least, the set of libraries included isn't going to change before 6.8, so we have until then to bring Hackage up to speed so that this is not true.
So, I would like to through down the gauntlet to the community to make this happen! We have ambitions to make large steps in this direction at Hac 07 http://haskell.org/haskellwiki/Hac_2007 (but that shouldn't stop people who can't be there from working on it too, or people working on it before then!).
A noble quest. Does anyone know if the following are the most recent versions of the various components of Hackage? cabal-setup: darcs get http://darcs.haskell.org/cabal cabal-install: darcs get http://darcs.haskell.org/cabal-with-install hackagedb: darcs get http://darcs.haskell.org/~lemmih/hackagedb package upload tool: none, though there is a Perl script /usr/local/bin/cabal-put on darcs.haskell.org Anything else?

On Tue, 2006-11-28 at 12:23 +0000, Ross Paterson wrote:
On Mon, Nov 27, 2006 at 02:47:01PM +0000, Ian Lynagh wrote:
For GHC at least, the set of libraries included isn't going to change before 6.8, so we have until then to bring Hackage up to speed so that this is not true.
So, I would like to through down the gauntlet to the community to make this happen! We have ambitions to make large steps in this direction at Hac 07 http://haskell.org/haskellwiki/Hac_2007 (but that shouldn't stop people who can't be there from working on it too, or people working on it before then!).
A noble quest. Does anyone know if the following are the most recent versions of the various components of Hackage?
cabal-setup: darcs get http://darcs.haskell.org/cabal
Yes.
cabal-install: darcs get http://darcs.haskell.org/cabal-with-install
I think this is now the latest. The -with-install branch is slated to be merged with the main cabal branch some time (Paolo: any word on that?). Duncan

On Tue, Nov 28, 2006 at 01:19:21PM +0000, Duncan Coutts wrote:
On Tue, 2006-11-28 at 12:23 +0000, Ross Paterson wrote:
Does anyone know if the following are the most recent versions of the various components of Hackage?
cabal-setup: darcs get http://darcs.haskell.org/cabal
Yes.
cabal-install: darcs get http://darcs.haskell.org/cabal-with-install
I think this is now the latest. The -with-install branch is slated to be merged with the main cabal branch some time (Paolo: any word on that?).
How about hackageDB? What's the situation there?

Am Montag, 27. November 2006 15:47 schrieb Ian Lynagh:
[...] So, I would like to through down the gauntlet to the community to make this happen! We have ambitions to make large steps in this direction at Hac 07 http://haskell.org/haskellwiki/Hac_2007 (but that shouldn't stop people who can't be there from working on it too, or people working on it before then!).
I have to admit that I didn't follow the development of Cabal-related tools very closely, so perhaps my concerns are already handled: Given a normal Linux distribution, the *only* sensible way to install/remove/... any SW is not via some specialized tools like cabal-foo or hackage-bar, but via tools like rpm, apt-get, smart, ... and their related GUI frontends. Doing things behind the back of the native package manager will lead to trouble sooner or later, and many users will outright reject any other tool (for very good reasons). Another thing is that I fear duplication of features like e.g. package signing, handling installation sources, searching for new packages, notification of updates, etc. To give an example for my openSUSE 10.1: If one finds some interesting package repository on e.g. http://en.opensuse.org/Additional_YaST_Package_Repositories its URL can easily be added to YaST (the openSUSE package management GUI), perhaps importing some keys to trust in the future, and starting from that point, the packages from that repository are seamlessly integrated with the rest: One can search for new interesting packages, install/remove packages, get update notifications, etc. The right way for openSUSE (and probably every RPM-based distro) would be to set up some kind of Haskell repository, and there are even efforts into that direction. I am sure that this has already been considered somehow, but could somebody be so kind to give a short explanation of the plans in this area? I think that the proposed tools should somehow be called from RPM .spec files, but I am missing the big picture... Cheers, S.

On Tue, Nov 28, 2006 at 05:13:24PM +0100, Sven Panne wrote:
I am sure that this has already been considered somehow, but could somebody be so kind to give a short explanation of the plans in this area?
There are a number of things going on here. If SuSE has an RPM for hnop then yes, using yast is definitely the way to go. If it doesn't then you can either tell the magic rpm-maker to convert hnop-0.1.tar.gz into an rpm and install that as above, or you can tell cabal to install it into /usr/local. This last option has the downside that yast/rpm won't know it exists, and so can't use it to know the deps of something else are satisfied (although presumably nothing will depend on it as it wasn't packaged), and it could stop working at a later date if a package it depends on that was provided by an rpm is removed. What hackage provides is a place to keep all the tarballs, a way to view and search for them and a way to upload new packages and new versions. Then people making SuSE rpms, or people looking for things that aren't packaged for SuSE, know where to go. It also provides a set of packages that can be used by cabal-get, for SuSE users to get packages that have not been made into SuSE RPMs, as well as for people who do not use a package manager (e.g. students on uni machines that they don't have root on). In the future we can add things like the ability to rate packages, mark packages as bitrotted, automated testing that packages compile and their testsuites pass, mailing lists, darcs repos, bug trackers etc for packages in hackage. Thanks Ian

Sven Panne
Given a normal Linux distribution, the *only* sensible way to install/remove/... any SW is not via some specialized tools like cabal-foo or hackage-bar, but via tools like rpm, apt-get, smart, ... and their related GUI frontends.
Right. And one of the explicit goals of Cabal was to provide enough infrastructure on the Haskell side to make it easy for rpm/apt/smart builders to do their job. The idea was that Cabal is a minimal but compiler-independent interface to build source code, register libraries with a compiler's package database, and so on. Then an RPM/whatever can be used to install/uninstall the library package (internally calling the Cabal routines to build/register it). Cabal-get and hackage do go a bit beyond that, but they are intended for those who do not live in an OS-package managed universe (or who don't want to).
Another thing is that I fear duplication of features like e.g. package signing, handling installation sources, searching for new packages, notification of updates, etc.
Sure, there are already so many OS package managers out there... :-) I don't think we want to duplicate all those "advanced" features in Haskell. But I do think it would be useful to provide some of the basic package manager services (auto-download, auto-dependency validation) for those who do not have a package manager. Keep it simple though. If a user starts to need more features, then she should probably look into just using rpm/apt/smart/ports instead. Regards, Malcolm

Am Donnerstag, 30. November 2006 18:10 schrieb Malcolm Wallace:
[...] Right. And one of the explicit goals of Cabal was to provide enough infrastructure on the Haskell side to make it easy for rpm/apt/smart builders to do their job. [...] Cabal-get and hackage do go a bit beyond that, but they are intended for those who do not live in an OS-package managed universe (or who don't want to). [...]
OK, that makes sense. Just to test if I understood things correctly: * For a package building RPMs, only Cabal is relevant and it is used from .spec files to (un-)register Haskell packages. * Resolving dependencies, upgrading, etc. is done as usual in the RPM world, the .cabal files are just a hint for writing the .spec files. * For a package builder, Hackage will make it easier to find the latest and greatest packages in source, but apart from that it is of no use/only a convenient "one-stop-shop". * Joe User on an RPM-based system will never invoke Cabal and will never use Hackage. The same holds for other packaging systems, of course. Cheers, S.

Bulat Ziganshin wrote:
ByteString is most offending example, but not alone. what is the base library now? is it about data structures, I/O, concurrency or monads? there is no answer - this lib contains everything developed by peoples having accounts at darcs.haskell.org.
ByteString went into base because we felt that it was likely to be used in other libraries in the base package in the future, and since packages cannot be mutually recursive it would therefore have to be in base. This was the *only* reason.
why it's impossible to use Applicative class with ghc 6.4? because Ross Paterson was so kind to include this in a base lib. why peoples get a problems with their mutable arrays in 6.6? because arrays interface was changed and there is no way to use old lib in 6.6. why ForeignPtrs in 6.4 are slow? because it's a part of base lib and it's impossible to use faster ForeignPtr implementation without upgrading entire compiler. and so on, so on
In 6.6 you can, in theory, upgrade the base package. We've never tried it, but at least we did design the package system in GHC such that it should be possible, as long as the replacement base package is sufficiently compatible with the old one, and agrees with GHC on the representation of certain wired-in types and classes and the names and location of certain functions. However, it's highly unlikely that you'll ever be able to separate ForeignPtr from the base library, because of the dependencies: ForeignPtr is part of the FFI, the FFI is used by other libraries, etc. etc. The dependencies in base are very intertwined, as you well know. Cheers, Simon

Simon Marlow
In 6.6 you can, in theory, upgrade the base package.
This, I think, is the heart of Bulat's complaint: namely, that until recently it was not possible to upgrade the 'base' package in ghc. All the other implementations of Haskell do permit the base package to be upgraded (or downgraded) separately from upgrading the compiler itself. All of the questions about whether such-and-such a library belongs in the 'base' package or in some separate package, are questions of policy. The answers really don't matter quite so much, provided the mechanism exists to choose to install whatever version of whatever packages you like. So can we take all this discussion about contents of the 'base' package as a bug-report about (older versions of) ghc, rather than a bug-report about the 'base' package itself?
However, it's highly unlikely that you'll ever be able to separate ForeignPtr from the base library, because of the dependencies: ForeignPtr is part of the FFI, the FFI is used by other libraries, etc. etc. The dependencies in base are very intertwined, as you well know.
Ah, so how do the other compilers manage it? Answer: Hugs has a separate package 'hugs-base' with essential but implementation-dependent things like ForeignPtr in it. (Likewise nhc98/yhc.) The 'base' package just imports and uses it. If we could separate out a 'ghc-base' package from 'base', that would be great. (And I think that is one of Bulat's proposals.) Regards, Malcolm

Hello Malcolm, Friday, November 24, 2006, 6:36:03 PM, you wrote:
In 6.6 you can, in theory, upgrade the base package.
This, I think, is the heart of Bulat's complaint: namely, that until recently it was not possible to upgrade the 'base' package in ghc.
as i many times said, the problem is two-sided: first, Base can't be upgraded without upgrading ghc. second, Base contains many different functionality which is artificially tied together. this has cumulative effect. for example, i want to use old arrays and new foreign ptrs both with 6.4 and 6.6. there are no technical problems here - both arrays and fptrs implementations don't rely on compiler version specific apis. but due to this tieing, i should use old arrays and old array with 6.4 and new ones with 6.6. this leads to #ifdefs in program as far as i want to support both ghc versions and to poor performance with 6.4
All the other implementations of Haskell do permit the base package to be upgraded (or downgraded) separately from upgrading the compiler itself.
never known about it! but it is only theoretical advantage - while Base developed as all-in-one package, we don't have any real upgrade offers on this market
All of the questions about whether such-and-such a library belongs in the 'base' package or in some separate package, are questions of policy. The answers really don't matter quite so much, provided the mechanism exists to choose to install whatever version of whatever packages you like.
unfortunately, it's not enough. it easy part of problem, but we should also work on splitting Base into natural parts. currently, it's more than 2 megs. maintainable parts should be about 100-300k, i think. rather obvious splitting is at upper level of module names: Control, Data, so on. Another possible criterion is that everything which can be detached from Base should be extracted and put into separate library -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

| as i many times said, the problem is two-sided: first, Base can't be | upgraded without upgrading ghc. I don't think that is any longer true, though we have admittedly not run a full-scale experiment. Please try. | second, Base contains many different | functionality which is artificially tied together. That remains a good point. S

Hello Simon, Friday, November 24, 2006, 7:59:13 PM, you wrote:
| as i many times said, the problem is two-sided: first, Base can't be | upgraded without upgrading ghc.
I don't think that is any longer true, though we have admittedly not run a full-scale experiment. Please try.
where can i download Base 2.0 for ghc 6.2 ? :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin wrote:
Hello Simon,
Friday, November 24, 2006, 7:59:13 PM, you wrote:
| as i many times said, the problem is two-sided: first, Base can't be | upgraded without upgrading ghc.
I don't think that is any longer true, though we have admittedly not run a full-scale experiment. Please try.
where can i download Base 2.0 for ghc 6.2 ? :)
Nobody has implemented it. That doesn't mean it cannot be done. Cheers, Simon

In the wiki page that Simon and I put up, we attempt to identify * goals * terminology (E.g. Core Packages, Hugs Install Packages, etc) and we make a straw-man proposal for how to proceed. http://hackage.haskell.org/trac/ghc/wiki/PackageReorg I'd be interested to know whether the proposal has general support; what goals are omitted; and what other details are omitted. I'm sure there are many, because this is a complex issue. I also think it'd be helpful to use a common terminology; we propose one on the wiki. Let's use it -- or choose an alternative. As ever, discussion by email; design choices, alternative proposals, pros & cons etc can go on the wiki. Simon | -----Original Message----- | From: libraries-bounces@haskell.org [mailto:libraries-bounces@haskell.org] On Behalf Of Bulat | Ziganshin | Sent: 24 November 2006 16:29 | To: Malcolm Wallace | Cc: libraries@haskell.org | Subject: Re[2]: [Haskell] base libraries | | Hello Malcolm, | | Friday, November 24, 2006, 6:36:03 PM, you wrote: | | >> In 6.6 you can, in theory, upgrade the base package. | | > This, I think, is the heart of Bulat's complaint: namely, that until | > recently it was not possible to upgrade the 'base' package in ghc. | | as i many times said, the problem is two-sided: first, Base can't be | upgraded without upgrading ghc. second, Base contains many different | functionality which is artificially tied together. this has cumulative | effect. for example, i want to use old arrays and new foreign ptrs | both with 6.4 and 6.6. there are no technical problems here - both | arrays and fptrs implementations don't rely on compiler version | specific apis. but due to this tieing, i should use old arrays and old | array with 6.4 and new ones with 6.6. this leads to #ifdefs in program | as far as i want to support both ghc versions and to poor performance | with 6.4 | | | > All the other implementations of Haskell do permit the base package to be | > upgraded (or downgraded) separately from upgrading the compiler itself. | | never known about it! but it is only theoretical advantage - while | Base developed as all-in-one package, we don't have any real upgrade | offers on this market | | | > All of the questions about whether such-and-such a library belongs in | > the 'base' package or in some separate package, are questions of policy. | > The answers really don't matter quite so much, provided the mechanism | > exists to choose to install whatever version of whatever packages you | > like. | | unfortunately, it's not enough. it easy part of problem, but we | should also work on splitting Base into natural parts. currently, it's | more than 2 megs. maintainable parts should be about 100-300k, i | think. rather obvious splitting is at upper level of module names: | Control, Data, so on. Another possible criterion is that everything | which can be detached from Base should be extracted and put into | separate library | | | -- | Best regards, | Bulat mailto:Bulat.Ziganshin@gmail.com | | _______________________________________________ | Libraries mailing list | Libraries@haskell.org | http://www.haskell.org/mailman/listinfo/libraries

Simon Peyton-Jones
http://hackage.haskell.org/trac/ghc/wiki/PackageReorg
I'd be interested to know whether the proposal has general support;
Yes, it has my general support. The proposed terminology is good.
what goals are omitted;
Possibly the following are just more detailed expansions of the existing two goals: * Forwards compatibility. Users would like their programs written against the 'core' packages to continue to work, without modification to source text or build system, after upgrading the compiler, or its packages, or switching to a different compiler. * Backwards compatibility. Users would like to be able to take a program written against some version of the 'core' packages, and build it with an older compiler, accepting that they may have to install newer versions of the 'core' packages in order to do so. It may not be possible to fully achieve these goals (in particular the latter), but that does not mean we should not aim for them. Regards, Malcolm

Hi
A couple of points: * It's rather worrying to define a set of Core libraries, and then have that set change depending on your operating system. The Win32 library is also quite big, and definately won't be bundled with the minimal version of Hugs on Windows (it would more than double the size!). * It would be nice if things that are in the Core libraries are somehow under the libraries@ list control. It would be unfortunate if things defined as Core suddenly changed their semantics, their interface etc. I'm not sure what in particular can be done about that, but its definately worth thinking about. Thanks Neil

On Fri, Nov 24, 2006 at 05:35:31PM +0000, Simon Peyton-Jones wrote:
http://hackage.haskell.org/trac/ghc/wiki/PackageReorg
I'd be interested to know whether the proposal has general support; what goals are omitted; and what other details are omitted. I'm sure there are many, because this is a complex issue.
I'd like to see some rationale for why each of the core packages have been chosen. I'd have base, haskell98, Cabal, filepath with the rationale that it is likely that people will want to write Setup.hs with them (haskell98 is debatable here, but could probably be argued in on the grounds that it's needed for lots of books/tutorials/... to work). I can't really think of any rationale for any others. For userfriendliness we can have a cabal package called usefulstuff that depends on mtl, regex, ..., but I don't see any need to bundle them all with the compiler. The less we force the implementations to come with, the quicker compilation will be when developing, the smaller Debian packages (for example) can be, the lower the disk space requirements to build GHC, the lower the time wasted when a Debian package (for example) build fails and the fewer packages we are tangling up with compiler release schedules (OK, they can be upgraded independently, but it causes headaches for package-management systems). On quickcheck, the testsuite and GHC: we can have GHC compile any libraries that are put in libraries/ and make ./darcs-all --get-dev grab quickcheck too. On the other hand, you might want to run the testsuite automatically when building debs/rpms/... but personally I'd prefer to use a copy of QC compiled and installed under the testsuite tree for that. This way we wouldn't suffer from the disadvantages above. We don't need the testsuite programs to work after GHC has been installed so we don't have to worry about providing the QC dynamic libraries in the future. Thanks Ian

I've elaborated the Wiki to try to articulate the choice that Ian describes here; it's in direct tension with Bulat's goals. Simon | -----Original Message----- | From: Ian Lynagh [mailto:igloo@earth.li] | Sent: 24 November 2006 19:35 | To: Simon Peyton-Jones | Cc: Bulat Ziganshin; Malcolm Wallace; libraries@haskell.org | Subject: Re: Re[2]: [Haskell] base libraries | | On Fri, Nov 24, 2006 at 05:35:31PM +0000, Simon Peyton-Jones wrote: | > | > http://hackage.haskell.org/trac/ghc/wiki/PackageReorg | > | > I'd be interested to know whether the proposal has general support; | > what goals are omitted; and what other details are omitted. I'm sure | > there are many, because this is a complex issue. | | I'd like to see some rationale for why each of the core packages have | been chosen. | | I'd have | | base, haskell98, Cabal, filepath | | with the rationale that it is likely that people will want to write | Setup.hs with them (haskell98 is debatable here, but could probably be | argued in on the grounds that it's needed for lots of | books/tutorials/... to work). | | I can't really think of any rationale for any others. For | userfriendliness we can have a cabal package called usefulstuff that | depends on mtl, regex, ..., but I don't see any need to bundle them all | with the compiler. | | The less we force the implementations to come with, the quicker | compilation will be when developing, the smaller Debian packages (for | example) can be, the lower the disk space requirements to build GHC, the | lower the time wasted when a Debian package (for example) build fails | and the fewer packages we are tangling up with compiler release | schedules (OK, they can be upgraded independently, but it causes | headaches for package-management systems). | | On quickcheck, the testsuite and GHC: we can have GHC compile any | libraries that are put in libraries/ and make ./darcs-all --get-dev grab | quickcheck too. On the other hand, you might want to run the testsuite | automatically when building debs/rpms/... but personally I'd prefer to | use a copy of QC compiled and installed under the testsuite tree for | that. This way we wouldn't suffer from the disadvantages above. We don't | need the testsuite programs to work after GHC has been installed so we | don't have to worry about providing the QC dynamic libraries in the | future. | | | Thanks | Ian

Malcolm Wallace wrote:
Simon Marlow
wrote:
However, it's highly unlikely that you'll ever be able to separate ForeignPtr from the base library, because of the dependencies: ForeignPtr is part of the FFI, the FFI is used by other libraries, etc. etc. The dependencies in base are very intertwined, as you well know.
Ah, so how do the other compilers manage it? Answer: Hugs has a separate package 'hugs-base' with essential but implementation-dependent things like ForeignPtr in it. (Likewise nhc98/yhc.) The 'base' package just imports and uses it. If we could separate out a 'ghc-base' package from 'base', that would be great. (And I think that is one of Bulat's proposals.)
As I understand it, Hugs and nhc98 do this by having their own copies of a lot of the library code (up to and including the Prelude?). We could do this for GHC, but it would mean extracting a lot of code that isn't really GHC-specific into ghc-base, and that doesn't seem like the right way to go. So there are two approaches to reducing the size of the base package: 1. removing modules from the top into separate packages 2. try to extract a compiler-dependent portion from the bottom (1) is way, way easier than (2), because of the heavily intertwined dependencies between the code underneath Prelude. That's unfortunate. Bulat did start to try to separate things this way, but he didn't finish (Bulat - did you give up because it was too hard, or just stop?). In the wiki page, we describe how to get part of the benefit of (2) as far as the user is concerned, by having a separate "view" of the base package with the compiler-dependent modules removed. Cheers, Simon

Simon Marlow
Answer: Hugs has a separate package 'hugs-base' with essential but implementation-dependent things like ForeignPtr in it. (Likewise nhc98/yhc.) The 'base' package just imports and uses it.
As I understand it, Hugs and nhc98 do this by having their own copies of a lot of the library code (up to and including the Prelude?).
Yes. Essentially, we took the view that the Haskell'98 libraries (+ primitives + FFI) can be assumed, and then built the 'base' package on top of that. Whereas GHC took the opposite approach, making 'base' the bottom of the hierarchy and building 'haskell98' on top of that. Hence why lots of GHC-only primitives ended up in 'base', which is not good for a so-called portable package. But I do think that eventually every implementation ought to assume some minimal underlying private libraries, and build 'base' upwards (portably) from there. Regards, Malcolm

On Mon, Nov 27, 2006 at 02:42:18PM +0000, Malcolm Wallace wrote:
Simon Marlow
wrote: Answer: Hugs has a separate package 'hugs-base' with essential but implementation-dependent things like ForeignPtr in it. (Likewise nhc98/yhc.) The 'base' package just imports and uses it.
As I understand it, Hugs and nhc98 do this by having their own copies of a lot of the library code (up to and including the Prelude?).
Yes. Essentially, we took the view that the Haskell'98 libraries (+ primitives + FFI) can be assumed, and then built the 'base' package on top of that. Whereas GHC took the opposite approach, making 'base' the bottom of the hierarchy and building 'haskell98' on top of that. Hence why lots of GHC-only primitives ended up in 'base', which is not good for a so-called portable package.
Hugs takes an intermediate approach, basically as described by Simon: There's a copy of the Prelude (and parts of other modules that are mutually recursive with it, and some other primitives); base is built on that, and haskell98 on top of that. So we share most of base (and all of haskell98) with GHC. The Hugs module system would allow the Prelude to import other modules like Data.Maybe and System.IO, getting more sharing, but since the whole thing will be interpreted each time Hugs starts, we preferred to minimize the part under the Prelude. There is some other duplication, notably large chunks of Numeric, due to constraints on module relationships imposed by GHC's specialization pragmas.

Hello Simon, Monday, November 27, 2006, 1:38:27 PM, you wrote:
However, it's highly unlikely that you'll ever be able to separate ForeignPtr from the base library, because of the dependencies: ForeignPtr is part of the FFI, the FFI is used by other libraries, etc. etc. The dependencies in base are very intertwined, as you well know.
FPTR representation was changed ghc 6.6 Base - now it includes Addr#, which makes things a lot faster. is it technically possible to do the same thing in ghc 6.4? yes. it don't require any changes in compiler - FPTR type is not primitive (like Addr#, f.e.) and not wired into compiler. can we do it on practice? no. what is the problem? we should be able to compile new Base library with 6.4 and install it here now, with 6.6 we can install alternative Base implementations. but only in theory - there are no such alternatives, and situation is the same (now) for ghc, hugs and nhc. next step is to make Base library portable across compiler versions. i.e. Base 2.0 should be compilable with ghc 6.8, and Base 2.1 should remain compatible with 6.6. the same for hugs/nhc. if we will do it, then this aspect of problem will be solved on practice. this would simplify upgrading/downgrading compiler version for large projects and allow to combine features of newest Base with stability of older compiler is it possible to have several Base installed at the same time so that Cabal expose only version requested by .cabal file? in ghc/hugs/nhc?
Ah, so how do the other compilers manage it? Answer: Hugs has a separate package 'hugs-base' with essential but implementation-dependent things like ForeignPtr in it. (Likewise nhc98/yhc.) The 'base' package just imports and uses it. If we could separate out a 'ghc-base' package from 'base', that would be great. (And I think that is one of Bulat's proposals.)
As I understand it, Hugs and nhc98 do this by having their own copies of a lot of the library code (up to and including the Prelude?). We could do this for GHC, but it would mean extracting a lot of code that isn't really GHC-specific into ghc-base, and that doesn't seem like the right way to go.
ghc does just the same :) Hugs Prelude and ghc.* modules has many common code, from 'const' to showFFloat
So there are two approaches to reducing the size of the base package:
1. removing modules from the top into separate packages 2. try to extract a compiler-dependent portion from the bottom
(1) is way, way easier than (2), because of the heavily intertwined dependencies between the code underneath Prelude.
we should go in both ways, definitely! Base is too large *and* compiler-specific, at the same time. we should reduce it by splitting to more specific packages and we should isolate compiler-specific code from compiler-independent. so, it will be great (if possible) to split off smth like ghc-base, and we should work on moving more code into separate packages
That's unfortunate. Bulat did start to try to separate things this way, but he didn't finish (Bulat - did you give up because it was too hard, or just stop?).
both :) it was too hard for 1-2 week project. i will report its state and potential problems here
In the wiki page, we describe how to get part of the benefit of (2) as far as the user is concerned, by having a separate "view" of the base package with the compiler-dependent modules removed.
believe it or not, but i think that we need just opposite view :) the problem is not to make ghc.* inaccessible, the problem is to make inaccessible the rest! :) why? let's imagine that Control.Monad in ghc 6.8 was extended with function repeatM_. how it can be used in 6.6? one need to write some library that provides new version of Control.Monad with this function included. but it's impossible to export such module - it will interfere with module from Base. and it's impossible to remove this module from Base because it's used in Prelude. so, it should remain in Base, but used only by Base itself! so, one more possible approach is to rename all Base modules to say Base.* and export from Base only GHC.* (and closely related) functionality. Then another package will import GHC.* and provide all other Base functionality, but its code will be compiler-independent and therefore easily upgradeable of course, it also not so very good - 1) code duplication, 2) wired-in things should be imported from original definition places, but at least i showed up the problem. and the problem is the following: our compiler-dependent code use a lot of higher-level code. if we want to be able to freely upgrade higher-level code without modifying lower-level one, we should leave a copy of old high-level code to be used only in low-level code and hide this copy from the rest of world (or use library versioning mechanism, but it seems inappropriate due to huge number of low->high->low dependency jumps) and Haskell Prelude sitting on top of this problem :) i'm right assuming that Prelude can't import anything outside of Base? this means that Base should include everything, from I/O to text parsing -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On Thu, Nov 23, 2006 at 10:20:51AM +0000, Chris Kuklewicz wrote:
Some of the other regex-* libraries are interfaces to c-library backends (pcre and tre) and it is not GHC's place to come with copies of those libraries. But GHC used regex internally, so it must come with at least a single backend.
A problem with these packages is that they're a good deal less portable than the Text.Regex they replaced. They use multi-parameter type classes, but they also rely on late overlapping resolution, which is a GHC-only feature. That is, instances overlap, but they're only used outside of the overlap, e.g.: instance (RegexLike a b) => RegexContext a b (Array Int b) instance (RegexLike a b) => RegexContext a b MatchArray type MatchArray = Array Int (MatchOffset, MatchLength) type MatchOffset = Int type MatchLength = Int These overlap at RegexContext a (Int,Int) (Array Int (Int,Int)), but as long as you don't use that instance GHC doesn't complain. (And you won't, because there's no instance RegexLike a (Int,Int), but overlaps are decided by comparing instance heads only.) Similarly instance (RegexLike a b) => RegexContext a b [Array Int b] instance (RegexLike a b) => RegexContext a b [MatchArray] and also instance (RegexLike a b) => RegexContext a b [b] instance (RegexLike a b) => RegexContext a b [MatchArray] instance (RegexLike a b) => RegexContext a b [(MatchOffset,MatchLength)] Can anything be done about that?

On Thu, Nov 23, 2006 at 03:35:49AM +0300, Bulat Ziganshin wrote:
for a way to include their libs in every ghc distro, don't find other solution except for including them in Base lib. moreover, while Simon & Ian argued against inclusion of these very useful libs in base libs set, they don't have anything against inclusion of the same code in Base lib
FWIW I don't think bytestring should have gone into base either. There's no advantage to adding it before we have something in base that actually needs it.
in particular, my hottest hope is that ghc 6.6.1 will be shipped with fps 0.8 as separate library that will provide both backward compatibility with 6.6 and will allow to upgrade fps without recompiling ghc itself :D
I agree with the others that, now that we have done it, we should stick with it for the 6.6 branch, though. Thanks Ian
participants (15)
-
Benjamin Franksen
-
Bulat Ziganshin
-
Chris Kuklewicz
-
donsīŧ cse.unsw.edu.au
-
Duncan Coutts
-
Ian Lynagh
-
Ketil Malde
-
Malcolm Wallace
-
Neil Mitchell
-
Ross Paterson
-
Simon Marlow
-
Simon Marlow
-
Simon Peyton-Jones
-
Sven Panne
-
Udo Stenzel