Skip to content

Lean into static pointers - #493

Draft
LaurentRDC wants to merge 1 commit into
masterfrom
static-ptrs-only
Draft

LaurentRDC wants to merge 1 commit into
masterfrom
static-ptrs-only

Conversation

@LaurentRDC

@LaurentRDC LaurentRDC commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Towards Haskell in the Cloud introduced the concept of static pointers, but they didn't land until GHC 7.10. Therefore, distributed-process (and the implementation of Towards Haskell in the Cloud) relied on a different mechanism to get things done, RemoteTable.

The upcoming GHC 10 fixes several usability issues and outstanding bugs with static pointers. This is the perfect opportunity to remove the historical wart that is RemoteTable and lean into static pointers fully.

This patch does just that: update distributed-static to redefine Closure and remove Static, for a more streamlined implementation that does not rely on a dynamic pointer table. Everything else follows from this change.

This leads to breaking changes in multiple packages, most importantly distributed-static and distributed-process. I took this opportunity to address the type signature of call (to take a Closure).

@LaurentRDC LaurentRDC changed the title Static ptrs only Lean into static pointers Oct 9, 2026
@LaurentRDC
LaurentRDC requested a review from davidsd October 13, 2026 01:06
@LaurentRDC

Copy link
Copy Markdown
Member Author

@davidsd I'm happy to produce a patch for hyperion based on this pull request, so that this breaking change incurs minimal cost to you

@davidsd

davidsd commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

@vasdommes and I discussed this today, and we are preparing a patch to hyperion ourselves. I think this is a good direction to go, and it will not be hard to adapt hyperion to it. (We only used RemoteTable in a few places, all of which are removable.)

But I should point out that this patch does remove functionality -- namely the ability to essentially extend the Process environment with arbitrary data that can be retrieved anywhere in the Process monad. I don't think that functionality is replaced in a simple way by the existence of StaticPointer's because you still need to pass the StaticPointer around in order to get access to it.

You could argue that in this case the user should use their own ReaderT on top of Process (which is what we do in hyperion). But maybe others like the old functionality?

@LaurentRDC

Copy link
Copy Markdown
Member Author

But I should point out that this patch does remove functionality -- namely the ability to essentially extend the Process environment with arbitrary data that can be retrieved anywhere in the Process monad

Hmmm that's true. I didn't think about the RemoteTable this way.

I have publicized this pull request on Discourse; hopefully someone can chime in if they use this functionality, although I would consider it accidental functionality.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants