[Haskell-cafe] Understanding GHC allocations

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Thu Jun 17 14:57:35 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Jun 17, 2010, at 12:35 , Roman Cheplyaka wrote:
> That's exactly what I'm asking about. 'abs' in C does not require any
> allocations, does it? So why does it require any allocations in  
> Haskell,
> assuming we've got no lazyness, typeclass indirection (I assume 'abs'
> was specialized and inlined) or other high-level features in resulted
> low-level code?


Quite a few obvious specializations / rules are missing; you can  
propose them.  Answering your question about the implementation of  
abs, my guess is that the current definition works for every type (I'm  
pretty sure C doesn't know what to do with a Data.Ratio).

- --
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (Darwin)

iEYEARECAAYFAkwacCwACgkQIn7hlCsL25XS/wCgvZWVoxZLrIlNywg4ZLA6tEwW
UpEAnjTLW5E5EHYcOIu0Eq1Rclh2wxfR
=BFE2
-----END PGP SIGNATURE-----


More information about the Haskell-Cafe mailing list