• Justus Sagemüller's avatar
    Choose some default runtime options. · 52fbd3b1
    Justus Sagemüller authored
    These may be controversial. They are certainly not good for everybody,
    but in my opinion better than the GHC default (unlimited memory,
    single processor), especially for beginners:
    
    - In Haskell, it's unfortunately somewhat easy to allocate infinite
      amounts of memory. In the default setting, this can grind the entire
      system virtually to a halt by driving everything into swap. This
      is a huge frustration. (Yeah, Matlab likes to do this too, but that
      should be no benchmark...)
      With a memory cap, this will simply crash the program. Especially
      in Jupyter, that's not a big deal since the kernel can easily be
      restarted without losing any work.
    - ̶6̶4̶0̶k 3 GiB should be enough for most beginner-relevant
      IHaskell applications, but should fit in most computers' RAM or
      at least reach the limit quickly after entering swap space.
    - I see no reason to restrict the runtime to a single processor.
      Almost all machines today have multiple cores, and we're linking
      to the `-threaded` runtime anyway. For some applications it's
      basically necessary to use more than one thread for properly
      responsive operation, including my
      [dynamic-plot](http://hackage.haskell.org/package/dynamic-plot).
    - Two processors should be modest enough to not substantially
      slow down any modern system.
    
    Power users can of course always disable the memory cap and choose
    more processors, through e.g.
    
        ihaskell install --use-rtsopts="-N12"
    52fbd3b1
IPython.hs 11.1 KB