Repository navigation
Lean into static pointers - #493
LaurentRDC wants to merge 1 commit into
Conversation
|
@davidsd I'm happy to produce a patch for |
281041b to
9969da1
Compare
|
@vasdommes and I discussed this today, and we are preparing a patch to But I should point out that this patch does remove functionality -- namely the ability to essentially extend the You could argue that in this case the user should use their own |
Hmmm that's true. I didn't think about the 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. |
|
I would add that this makes hibernating processes harder, for the reasons @davidsd mentions - albeit we don't really do that in the same way the Erlang vm does. I started thinking about this in the gen_server package here, and on a branch attempting to support server swaps in the same manner as Erlang processes. |
|
Would it be possible to spin out the remote table functionality into a separate package, and use static pointers as the primary mechanism, or perhaps add some other similar way to extend the process environment? |
We could. Then we end up in a situation where a CH program could use static pointers, or, optionally, a remote table (or both). That's what we actually have today! If people want to use |
TBH/FYI I don't have a preference here; I haven't used RemoteTable. My question was about curiosity really. But I have wondered about extensibility of Process, say by it using and underlying monad transformer instead of concrete |
9969da1 to
964ea4f
Compare
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
RemoteTableand lean into static pointers fully.This patch does just that: update
distributed-staticto redefineClosureand removeStatic, 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-staticanddistributed-process. I took this opportunity to address the type signature ofcall(to take aClosure).