Skip to content

Cannot support multiple Loaders in one process. #343

Description

@Saizan

The Loader is a GHC structure to keep track of symbols loaded for the interpreter.

Actually loading symbols goes through the OS, which sees the process memory as a single namespace, which is a bit of a problem:

  • C symbols from different versions of the same library will shadow each other, since they are not typically versioned.
  • We also want to unload things if no longer needed, but the Loader should be aware.

So it's a bad idea to have more than one Loader around.

The easy way to have a namespace per-session is to use one external interpreter each, since that's a separate process.

Plugins however need to run in the host process to access the ghc session, so those run in the internal interpreter.
One idea might be to have separate internal interpreters but have them all share the same loader.
Needs further investigation, not clear if GHC supports it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GHCRequires changing GHC and/or the RTSlinker

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions