GHC.Runtime.Interpreter.Types

ghc-9.2.0.20210331: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Runtime.Interpreter.Types

Description

Types used by the runtime interpreter

Synopsis

- data Interp = Interp {
  - interpInstance :: !InterpInstance
  - interpLoader :: !Loader
  }
- data InterpInstance
  - = ExternalInterp !IServConfig !IServ
  - | InternalInterp
- newtype IServ = IServ (MVar IServState)
- data IServInstance = IServInstance {
  - iservPipe :: !Pipe
  - iservProcess :: !ProcessHandle
  - iservLookupSymbolCache :: !(UniqFM FastString (Ptr ()))
  - iservPendingFrees :: ![HValueRef]
  }
- data IServConfig = IServConfig {
  - iservConfProgram :: !String
  - iservConfOpts :: ![String]
  - iservConfProfiled :: !Bool
  - iservConfDynamic :: !Bool
  - iservConfHook :: !(Maybe (CreateProcess -> IO ProcessHandle))
  - iservConfTrace :: IO ()
  }
- data IServState
  - = IServPending
  - | IServRunning !IServInstance

# Documentation

data Interp Source #

Interpreter

Constructors

Interp |
Fields interpInstance :: !InterpInstance Interpreter instance (internal, external) interpLoader :: !Loader Interpreter loader

data InterpInstance Source #

Constructors

ExternalInterp !IServConfig !IServ | External interpreter
InternalInterp | Internal interpreter

newtype IServ Source #

External interpreter

The external interpreter is spawned lazily (on first use) to avoid slowing down sessions that don't require it. The contents of the MVar reflects the state of the interpreter (running or not).

Constructors

IServ (MVar IServState) |

data IServInstance Source #

External interpreter instance

Constructors

IServInstance |
Fields iservPipe :: !Pipe iservProcess :: !ProcessHandle iservLookupSymbolCache :: !(UniqFM FastString (Ptr ())) iservPendingFrees :: ![HValueRef] Values that need to be freed before the next command is sent. Threads can append values to this list asynchronously (by modifying the IServ state MVar).

data IServConfig Source #

Configuration needed to spawn an external interpreter

Constructors

IServConfig |
Fields iservConfProgram :: !String External program to run iservConfOpts :: ![String] Command-line options iservConfProfiled :: !Bool Use Profiling way iservConfDynamic :: !Bool Use Dynamic way iservConfHook :: !(Maybe (CreateProcess -> IO ProcessHandle)) Hook iservConfTrace :: IO () Trace action executed after spawn

data IServState Source #

State of an external interpreter

Constructors

IServPending | Not spawned yet
IServRunning !IServInstance | Running