Ticket #3372 (new feature request)

Opened 4 years ago

Last modified 2 months ago

Allow for multiple linker instances

Reported by: jcpetruzza Owned by:
Priority: low Milestone: 7.6.2
Component: Compiler Version:
Keywords: Cc: howard_b_golden@…, ezyang@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By: #3658
Blocking: Related Tickets:

Description

Right now there is only one RTS linker with a single symbol table.This means, for example, that one cannot have multiple instances of the GHC interpreter in the same process running simultaneously.

Attachments

Main.hs Download (2.4 KB) - added by jcpetruzza 4 years ago.
Example that fails due to this limitation

Change History

Changed 4 years ago by jcpetruzza

Example that fails due to this limitation

  Changed 4 years ago by igloo

  • difficulty set to Unknown
  • milestone set to 6.14.1

  Changed 2 years ago by igloo

  • milestone changed from 7.0.1 to 7.0.2

  Changed 2 years ago by igloo

  • milestone changed from 7.0.2 to 7.2.1

follow-up: ↓ 5   Changed 22 months ago by hgolden

  • cc howard_b_golden@… added
  • failure set to None/Unknown

I looked at the attachment. Is it a significant problem to use separate processes when two interpreters are needed? Could you give a use case for this feature that shows its usefulness? Thanks.

in reply to: ↑ 4   Changed 22 months ago by jcpetruzza

Replying to hgolden:

[...] Could you give a use case for this feature that shows its usefulness? Thanks.

You may want to use ghc in interactive mode to implement some sort of evaluator as part of a Haskell IDE (e.g., like  this). You will then want to have one evaluator per opened project and each evaluator naturally corresponds to a ghc session. One can implement this with multiple processes but in an arguably less convenient way.

  Changed 22 months ago by simonmar

This is indeed a significant ugliness. I think fixing it would be fairly mechanical, just package up the linker's state as an object that gets passed in to every call, and then in GHC the PersistentLinkerState becomes the holder for the RTS linker state and is carried around in the HscEnv rather than being a global variable.

  Changed 20 months ago by igloo

  • milestone changed from 7.2.1 to 7.4.1

  Changed 15 months ago by igloo

  • priority changed from normal to low
  • milestone changed from 7.4.1 to 7.6.1

  Changed 8 months ago by igloo

  • milestone changed from 7.6.1 to 7.6.2

  Changed 7 months ago by igloo

  • blockedby 3658 added

  Changed 2 months ago by ezyang

  • cc ezyang@… added
Note: See TracTickets for help on using tickets.