Changes between Version 19 and Version 20 of DynamicByDefault
- Timestamp:
- 11/24/12 10:54:16 (6 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DynamicByDefault
v19 v20 10 10 For this to work, there is technically no need to change anything else: ghc could continue to compile for the static way by default. However, there are 2 problems that arise: 11 11 1. cabal-install would need to install libraries not only for the static way (for use by ghc), but also for the dynamic way (for use by ghci). This would double library installation times and disk usage. 12 2. GHCi would no longer be able to load modules compiled with `ghc -c`. 13 12 2. GHCi would no longer be able to load modules compiled with `ghc -c`. This would violate the principle of least surprise, and would make it harder to work around GHCi's limitations (such as performance, and lack of support for unboxed tuples). 13 14 Given these 2 issues, we think that if making GHCi use dynamic libraries, we should also make ghc compile the "dynamic way" by default. 14 15 15 16 == Bugs == … … 38 39 ||[ticket:7357 #7357 GHC.exe gives an internal error while linking vector's Monadic.hs]||no||no||no||no||'''YES'''||no||no|| 39 40 41 == Windows == 42 43 Currently, we don't know how to do dynamic-by-default on Windows in a satisfactory way. We can build dynamic libraries, but we don't have a way of telling them where to find their DLLs. This means that `ghc --make foo; ./foo` won't work unless we copy all the library DLLs into the current directory, which isn't very satisfactory. 44 45 We are currently working on this. 46 40 47 == Performance == 48 49 There are some performance questions to consider before making a decision. 50 51 === Performance of the dynamic way === 41 52 42 53 Full nofib results showing the effect of switching to dynamic-by-default are available for … … 45 56 [http://lambda.haskell.org/~igloo/dynamic-by-default/nofib-linux-x86_64.html Linux x86_64] and 46 57 [http://lambda.haskell.org/~igloo/dynamic-by-default/nofib-linux-x86.html Linux x86]. There is also a table of the highlights below. In summary: 58 59 (We don't have Windows performance numbers as we don't have dynamic-by-default working on Windows yet). 47 60 48 61 Binary sizes are way down across the board, as we are now dynamically linking to the libraries. … … 108 121 }}} 109 122 110 == OS X x86 vs x86_64==123 === OS X x86 vs x86_64 === 111 124 112 125 Currently, some people use the x86 version of GHC on OS X for performance reasons. It's not clear for how much longer this will be viable, as other OS X libraries start dropping x86 support. … … 176 189 </table> 177 190 }}} 191 192 === Implications of the performance difference === 193 194 If GHCi uses dynamic libraries by default, then `ghci` will need to be dynamically linked. It would make sense to therefore also have `ghc` be dynamically linked. This means that any performance difference will also affect the performance of the compiler (this is already accounted for in the "Compile Times" in the nofib results). 195 196 It would still be possible to compile programs using the "static way" by giving ghc the `-static` flag, and users would be able to configure `cabal-install` to do so by default if they wish. Then programs would be exactly the same as they are today. However, this would have the drawback that `cabal-install` would need to be configured to install libraries for the static way as well as the dynamic way, so library installation would take twice as long. 197 198 == Questions == 199 200 In summary, we need to answer the following questions: 201 202 1. Should we enable dynamic by default on OS X x86_64? 203 2. Should we enable dynamic by default on OS X x86? 204 3. Should we enable dynamic by default on Linux x86_64? 205 4. Should we enable dynamic by default on Linux x86? 206 5. Should we enable dynamic by default on Windows x86_64? 207 6. Should we enable dynamic by default on Windows x86? 208 7. Should we enable dynamic by default on other platforms? 209 8. For platforms using dynamic by default, should Cabal also install static libraries by default? 210 211 For 1 and 3, the performance impact appears negligible and some bugs will be fixed, so we would suggest that the answer should be yes.
