
On 22/11/2012 19:54, Gábor Lehel wrote:
On Thu, Nov 22, 2012 at 8:41 PM, Henning Thielemann
wrote: On Thu, 22 Nov 2012, Brandon Allbery wrote:
I am wondering if we're trying to solve the problem in the wrong way. The core of the problem is that various things get baked into libraries in the name of optimization, such that a given binary library has dependencies on precise versions of other libraries; it's not like C where anything supporting the ABI can use the same .a/.lib or .so/.dll/.dylib.
C supports inlining. This should cause the same kind of problems, shouldn't it?
Indeed, and in Qt for example which has a strict binary compatibility guarantee, making a public function inline means you effectively cannot change it until the next major release. (In this case "making it inline" and "including the definition in the header file" are effectively synonymous, one requires the other.)
The problem is that in Haskell inlining is a lot more important for performance.
I would like to see GHC support fixed ABIs, and the work I did with ABI hashing in GHC was aiming towards exactly that. For fixed ABIs you would need to have the user explicitly declare every inline function, and then hash the definitions as part of the ABI. (also do something about strictness and arity, and other cross-module optimisation hints). It might be painful, but it could be optional, and the gains are quite nice: the ability to upgrade a library in-place without recompiling everything that depends on it. Especially now that we're moving towards shared libraries, this would become more useful. I'm sure it's not going to happen soon, but it would be an interesting project for someone (probably larger than a GSoC project though). Cheers, Simon

On 23 November 2012 21:06, Simon Marlow
On 22/11/2012 19:54, Gábor Lehel wrote:
On Thu, Nov 22, 2012 at 8:41 PM, Henning Thielemann
wrote: On Thu, 22 Nov 2012, Brandon Allbery wrote:
I am wondering if we're trying to solve the problem in the wrong way. The core of the problem is that various things get baked into libraries in the name of optimization, such that a given binary library has dependencies on precise versions of other libraries; it's not like C where anything supporting the ABI can use the same .a/.lib or .so/.dll/.dylib.
Right, I tend to agree. Multiple installs of packages make me feel uncomfortable and sleep less well at night... :)
I would like to see GHC support fixed ABIs, and the work I did with ABI hashing in GHC was aiming towards exactly that.
For fixed ABIs you would need to have the user explicitly declare every inline function, and then hash the definitions as part of the ABI. (also do something about strictness and arity, and other cross-module optimisation hints). It might be painful, but it could be optional, and the gains are quite nice: the ability to upgrade a library in-place without recompiling everything that depends on it. Especially now that we're moving towards shared libraries, this would become more useful.
Yes that would be really wonderful!! The current ABI situation is really very painful for packagers and beyond IMHO. To me it is actually the largest current problem with ghc. Jens

| > I would like to see GHC support fixed ABIs, and the work I did with | > ABI hashing in GHC was aiming towards exactly that. | > | > For fixed ABIs you would need to have the user explicitly declare | > every inline function, and then hash the definitions as part of the | > ABI. (also do something about strictness and arity, and other | > cross-module optimisation hints). It might be painful, but it could | > be optional, and the gains are quite nice: the ability to upgrade a | > library in-place without recompiling everything that depends on it. | > Especially now that we're moving towards shared libraries, this would | become more useful. | | Yes that would be really wonderful!! | | The current ABI situation is really very painful for packagers and | beyond IMHO. To me it is actually the largest current problem with ghc. Indeed. Offering fixed ABIs is something that Simon and I have often discussed, but never acted on. Why not? * There is significant design work to be done. Exactly how does the programmer specify which inlinings, strictness, arity etc appear in the ABI? What if the implementation of a function changes so that its strictness or arity really is different? * There is significant implementation work to do. Apart from anything else, we presumably do not want to inhibit cross-module inlining etc *within* a package. Currently GHC uses the same M.hi files *within* a package as *between* packages. So maybe we need to strip down these .hi files somehow for use cross-package; or generate a one-per-package portmanteau .hi file? That's real work. * There will be a performance penalty for reducing cross-package inlining. We don't know how much, and it's hard find out without doing the work of the earlier two bullets. So, if we want fixed ABIs then lots of people are going to have to help, including help lead! Simon
participants (3)
-
Jens Petersen
-
Simon Marlow
-
Simon Peyton-Jones