distributed-closure: Serializable closures for distributed programming.

[ bsd3, control, library, program ] [ Propose Tags ] [ Report a vulnerability ]

See README.


[Skip to Readme]

Flags

Manual Flags

NameDescriptionDefault
dev

Turn on development settings.

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.2.0.0, 0.2.1.0, 0.3.0.0, 0.3.1.0, 0.3.2.0, 0.3.3.0, 0.3.4.0, 0.3.5, 0.4.0, 0.4.1, 0.4.1.1, 0.4.2.0, 0.5.0.0 (info)
Dependencies async (>=2.1), base (>=4.11 && <5), binary (>=0.7.5), bytestring (>=0.10), constraints (>=0.4), distributed-closure, syb (>=0.5), template-haskell (>=2.10) [details]
License BSD-3-Clause
Copyright © Tweag I/O Limited
Author Mathieu Boespflug
Maintainer m@tweag.io
Category Control
Home page https://github.com/tweag/distributed-closure
Source repo head: git clone https://github.com/tweag/distributed-closure
Uploaded by FacundoDominguez at 2023-11-27T11:34:59Z
Distributions LTSHaskell:0.5.0.0, Stackage:0.5.0.0
Reverse Dependencies 7 direct, 2 indirect [details]
Executables example-client-server
Downloads 8587 total (42 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2023-11-27 [all 1 reports]

Readme for distributed-closure-0.5.0.0

[back to package description]

distributed-closure

Build status

Leverage the -XStaticPointers extension from GHC 7.10 onwards for distributed programming using lightweight serializable closures. This package implements a serializable closure abstraction on top of static pointers. Serializable closures can be shipped around a computer cluster. This is useful for implementing intuitive and modular distributed applications. See this blog post for a hands on introduction and this paper for the original motivation.

Example

In GHC 8 and above, remoting a computation on another node using this library goes along the lines of

data NodeId

-- Assume we're given a spaw primitive.
spawn :: NodeId -> Closure (IO ()) -> IO ()

-- A computation to remote on another node.
hello :: String -> IO ()
hello name = putStrLn ("Hello, " ++ name)

main = do
  name <- getLine
  spawn "someAddress" (static hello `cap` name)

An example of sending static pointers and closures through a communication channel is provided under examples/ClientServer.hs in the source repository.

distributed-closure does not implement sending/receiving/spawning closures - that's left for higher-level frameworks. Only closure creation, composition and (de)serialization.