[GHC] #12356: StaticPointers support in GHCi

#12356: StaticPointers support in GHCi -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature | Status: new request | Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: #12000 Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Currently GHCi does not support `-XStaticPointers`, which is quite annoying for those of us who actually use `-XStaticPointers` in day-to-day development. It would be great if GHCi could grow support for this extension. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12356 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12356: StaticPointers support in GHCi -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature request | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12000 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): there are a few notes on the current state of things on [[https://ghc.haskell.org/trac/ghc/wiki/StaticPointers/Old#InGHCi|StaticPointers/Old]] and #12000. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12356#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12356: StaticPointers support in GHCi -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature request | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12000 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * cc: facundo.dominguez (added) Comment: Facundo, do you suppose you could describe what is currently missing to get proper `StaticPointers` support in GHCi? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12356#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12356: StaticPointers support in GHCi -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature request | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12000 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by facundo.dominguez): When compiling a module, the FloatOut pass puts StaticPtrs in the top level and the tidy-core pass generates a C constructor function which inserts the top-level bindings in the static pointer table (SPT) when the module is loaded. In GHCi, I guess that bindings could be inserted in the SPT when they are linked. I don't know if the FloatOut pass is used when compiling code in GHCi, if not, floating the static pointer values to the top-level would need to be accomplished otherwise. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12356#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12356: StaticPointers support in GHCi -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature request | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12000, #9878 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * related: #12000 => #12000, #9878 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12356#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12356: StaticPointers support in GHCi -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature request | Status: patch Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12000, #9878 | Differential Rev(s): Phab:D2504 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D2504 Comment: I have the beginnings of an implementation of this in Phab:D2504. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12356#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12356: StaticPointers support in GHCi -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature request | Status: patch Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12000, #9878 | Differential Rev(s): Phab:D2504 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): One particularly hairy problem that arises here is that of breakpoint ticks interacting with FloatOut. Currently we disallow any floating through breakpoint ticks. However, static pointer support requires that we float out static expressions to the top level. I can see two options here, 1. Allow floating of `StaticPtr` values through breakpoints as a special case. 2. Disable breakpoint production while `-XStaticPointers` is enabled. Given that (1) may give rise to some rather surprising behavior in the face of recursive groups (e.g. a recursive group with one `StaticPtr` and a bunch of other bindings; the whole group will need to be floated, killing breakpoint support for all floated code), I suspect that (2) is the only sensible option. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12356#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12356: StaticPointers support in GHCi -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature request | Status: patch Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12000, #9878 | Differential Rev(s): Phab:D2504 Wiki Page: | -------------------------------------+------------------------------------- Changes (by nh2): * cc: nh2 (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12356#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12356: StaticPointers support in GHCi -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: feature request | Status: patch Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12000, #9878 | Differential Rev(s): Phab:D2504 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * owner: => bgamari -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12356#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12356: StaticPointers support in GHCi -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: feature request | Status: patch Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12000, #9878 | Differential Rev(s): Phab:D2504 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Phab:D2504 adds limited support for `StaticPointers` in GHCi. While expressions entered at the REPL still cannot contain `static` expressions, modules loaded into the interpreter may. This should recover the majority of the convenience that one previously lost with `StaticPointers`. Note, however, that there is a bit of a memory leak as static expressions will necessarily never be unloaded, even after the module that introduced them goes out of scope. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12356#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12356: StaticPointers support in GHCi
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: bgamari
Type: feature request | Status: patch
Priority: normal | Milestone: 8.2.1
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #12000, #9878 | Differential Rev(s): Phab:D2504
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#12356: StaticPointers support in GHCi -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: feature request | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12000, #9878 | Differential Rev(s): Phab:D2504 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12356#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12356: StaticPointers support in GHCi -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12000, #9878 | Differential Rev(s): Phab:D2504, Wiki Page: | Phab:D3663 -------------------------------------+------------------------------------- Changes (by bgamari): * owner: bgamari => (none) * status: closed => new * differential: Phab:D2504 => Phab:D2504, Phab:D3663 * resolution: fixed => Comment: RyanGlScott points out that this patch inadvertently added a `pprTrace` which blurts out in GHCi. Phab:D3663 fixes this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12356#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12356: StaticPointers support in GHCi -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: merge Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12000, #9878 | Differential Rev(s): Phab:D2504, Wiki Page: | Phab:D3663 -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12356#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12356: StaticPointers support in GHCi
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: (none)
Type: feature request | Status: merge
Priority: normal | Milestone: 8.2.1
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #12000, #9878 | Differential Rev(s): Phab:D2504,
Wiki Page: | Phab:D3663
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#12356: StaticPointers support in GHCi -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12000, #9878 | Differential Rev(s): Phab:D2504, Wiki Page: | Phab:D3663 -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged with 0fa0d6c2d64dc41783e04b5887f96a996a181d3b -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12356#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12356: StaticPointers support in GHCi -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12000, #9878 | Differential Rev(s): Phab:D2504, Wiki Page: | Phab:D3663 -------------------------------------+------------------------------------- Comment (by mpickering): Is this fixed? With 8.6.1 {{{
:set -XStaticPointers <interactive>: warning: StaticPointers is not supported in GHCi interactive expressions. }}}
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12356#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12356: StaticPointers support in GHCi
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: (none)
Type: feature request | Status: closed
Priority: normal | Milestone: 8.2.1
Component: Compiler | Version: 8.0.1
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #12000, #9878 | Differential Rev(s): Phab:D2504,
Wiki Page: | Phab:D3663
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#12356: StaticPointers support in GHCi -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12000, #9878 | Differential Rev(s): Phab:D2504, Wiki Page: | Phab:D3663 -------------------------------------+------------------------------------- Comment (by bgamari): It looks like I simply neglected to remove the warning. Fixed and merged to `ghc-8.6`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12356#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12356: StaticPointers support in GHCi -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12000, #9878 | Differential Rev(s): Phab:D2504, Wiki Page: | Phab:D3663 -------------------------------------+------------------------------------- Comment (by bgamari): Ahh, never mind; the patch in comment:17 is wrong. As noted in comment:9 we *still* don't support StaticPointers in the REPL. I'll revert and make sure there is a comment mentioning this next to the warning. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12356#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC