Changes between Initial Version and Version 1 of Commentary/Compiler/UnpackPrimitiveFields


Ignore:
Timestamp:
Feb 18, 2012 4:53:15 PM (2 years ago)
Author:
tibbe
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/UnpackPrimitiveFields

    v1 v1  
     1= Unpacking primitive fields = 
     2 
     3This page describes a proposal to automatically unpack (strict) primitive fields. A primitive fields is a field that when unpacked has a pointer-sized representation. Examples include `Int`, `Word`, `Float`, and `newtype`s thereof. 
     4 
     5== Goals and non-goals == 
     6 
     7This proposal is about changing the default behavior of GHC, not changing expressiveness. Users can still use `UNPACK` and `NOUNPACK` to explicitly control the memory representation of fields. 
     8 
     9There are two goals: 
     10 
     11 1. Reduce the amount of boilerplate experienced programmers have to write: As of Feb 18th 2012, the [http://hackage.haskell.org/package/bytestring bytestring], [http://hackage.haskell.org/package/text text], and [http://hackage.haskell.org/package/containers containers] packages had 46 fields that matched the definition of primitive given above. 43 of these had an explicit `UNPACK` pragma (and the remaining 3 could have had one without changing the performance of the program.) 
     12 
     13 2. To provide better defaults for beginner and intermediate level Haskellers. Not unpacking e.g. `Int` fields can have a large, negative effect on performance and many beginner and intermediate level Haskellers are bitten by this. 
     14 
     15== Detailed design == 
     16 
     17== Benchmarks ==