Skip to content
  • Simon Marlow's avatar
    Remote GHCi, -fexternal-interpreter · 4905b83a
    Simon Marlow authored
    Summary:
    (Apologies for the size of this patch, I couldn't make a smaller one
    that was validate-clean and also made sense independently)
    
    (Some of this code is derived from GHCJS.)
    
    This commit adds support for running interpreted code (for GHCi and
    TemplateHaskell) in a separate process.  The functionality is
    experimental, so for now it is off by default and enabled by the flag
    -fexternal-interpreter.
    
    Reaosns we want this:
    
    * compiling Template Haskell code with -prof does not require
      building the code without -prof first
    
    * when GHC itself is profiled, it can interpret unprofiled code, and
      the same applies to dynamic linking.  We would no longer need to
      force -dynamic-too with TemplateHaskell, and we can load ordinary
      objects into a dynamically-linked GHCi (and vice versa).
    
    * An unprofiled GHCi can load and run profiled code, which means it
      can use the stack-trace functionality provided by profiling without
      taking the performance hit on the compiler that...
    4905b83a