Re: [Haskell] Re: compiler-independent core libraries infrastructure

[Moving to cafe for follow up discussions] Hi Bulat, So, just to confirm in my mind what you are proposing: Compiler/Version specific Core: Yhc.Core, Hugs.Core, GHC.Core .... With a different version for each compiler version. Tied intimately to the compiler. The leveler: Core - which abstracts each version/variant of *.Core into one big pile. Contains versions of STM/Arrays in Pure Haskell which might not give the expected performance, but at least keep the semantics as best they can. Base: Pure Haskell which depends on Core, but NOT on *.Core. (Then after you split up base - useful, but personally not of massive importance to me ;) ) I think this is a great plan! Now you have a concrete idea of what you want to achieve in the end, how are you going to get there? It seems a rather ambitious project. Perhaps you might be best suited by getting base to compile with Cabal (and maybe even natively on Windows - without MingW), then you can go from there to the splitting in a Cabal friendly manner without hacking through makefiles? Anyway, once you have decided what you want, I'm sure the Yhc team will do their best to help you get to where you want with regards to that specific compiler. Just to try and keep your work more generally applicable, it would be nice if you kept the Hat project in the back of your mind, so that this work can be reused by them to get full haskell.org libraries. Thanks Neil

Hello Neil, Friday, September 15, 2006, 8:12:34 PM, you wrote:
[Moving to cafe for follow up discussions]
i should be started this discussion in libraries... :(
Yhc.Core, Hugs.Core, GHC.Core ....
With a different version for each compiler version. Tied intimately to the compiler.
The leveler:
Core - which abstracts each version/variant of *.Core into one big pile. Contains versions of STM/Arrays in Pure Haskell which might not give the expected performance, but at least keep the semantics as best they can.
Core - provides common API *hc-core - implements strict subset of this API Core, again - checks compiler brand and version and either imports appropriate module or emulates required behavior So, the *Core and Core has the same API, although each *Core defines only subset of these names. it's why i called Core "equalizer" - it adds unimplemented "rights" to the "poor" Haskell compilers :)
Base:
Pure Haskell which depends on Core, but NOT on *.Core.
yes, keeping in mind that *Core APIs are subsets of Core API
I think this is a great plan! Now you have a concrete idea of what you want to achieve in the end, how are you going to get there? It seems a rather ambitious project.
Perhaps you might be best suited by getting base to compile with Cabal (and maybe even natively on Windows - without MingW), then you can go from there to the splitting in a Cabal friendly manner without hacking through makefiles?
Igloo just wrote that he changes the 'base' to compile with Cabal (i even don't known that it don't works). To be exact, i propose some algorithm of doing it in a way that should allow 1) work over existing 'base' repository, so we don't end with two libraries to maintain in-between 2) make the changes in small steps, don't breaking anything in-between 3) allow to participate all the 'base' hackers if it will be possible to work with modified 'base' library as with any other package, without rebuilding the GHC itself, i will make some contribution to this work. as i said, i have great experience of developing portable software
Anyway, once you have decided what you want, I'm sure the Yhc team will do their best to help you get to where you want with regards to that specific compiler. Just to try and keep your work more generally applicable, it would be nice if you kept the Hat project in the back of your mind, so that this work can be reused by them to get full haskell.org libraries.
first - i propose to do a series of incremental rewrites of existing base package, i never mind to do it from scratch :) second - are you sure that Hat needs to work over core libs? all that these libs should contain is just a lots of trivial definitions like this: type Arr = Arr# newArr = newArray# ..... third - you can point to the guidelines of writing Hat-comptaible libraries so that we will know how to write right code. as i said, developing of basic libs is easy in terms of algorithms but a pain in terms of lot of requirements from many various sources about yhc - hopefully, current base lib don't supports it. ensuring compatibility with ghc, hugs and nhc during transition will be a hard problem by itself. but once transition will be completed, implementation of yhc.core library should be very easy, especially using nhc.core as a start point. that you can do to help us is to provide list of differences between nhc and yhc low-level libraries so that we account for these differences when developing Core API -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On Fri, Sep 15, 2006 at 05:12:34PM +0100, Neil Mitchell wrote:
So, just to confirm in my mind what you are proposing:
Compiler/Version specific Core:
Yhc.Core, Hugs.Core, GHC.Core ....
With a different version for each compiler version. Tied intimately to the compiler.
A large issue with this, is that what needs to be tied intimately to the complier is very different for different compilers. for instance Data.Typeable and Data.Dynamic are fairly portableish haskell on ghc, but are primitives provided by the compiler in jhc as a very simple example. It leads to the current mess with the jhc libraries where it has bits and pieces of base. I can't just use base as is, because it implements a lot that jhc needs to implement natively or expects things that GHC.* provides, but Jhc.* doesn't, or at least provides with a different interface/semantics (and #ifdefs or tieing jhc's development with the fptools repos are not acceptable solutions) However, a lot of stuff depends on libraries provided by base, so I can't just ignore it. so I end up syncing some code from base, modifying some, having a big mess that is somewhat tricky to maintain. In any case, haskell-prime will clean this up some by giving a more complete compiler-provided set of libraries, and it looks like the fptools repos are moving in the right direction with modularization. John -- John Meacham - ⑆repetae.net⑆john⑈
participants (3)
-
Bulat Ziganshin
-
John Meacham
-
Neil Mitchell