Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Commenting fix

  • Loading branch information...
commit 097b5d4863a19d818d76d28e3c4222ebd71415b3 1 parent dce476a
@jepst authored
View
9 README.md
@@ -1,4 +1,7 @@
-This is **Cloud Haskell**. It's a Haskell framework for distributed applications. Basically, it's a tool for writing applications that coordinate their work on a cluster of commodity computers. This is useful for providing highly reliable, redundant, long-running services, as well as for building compute-intensive applications that can benefit from lots of hardware.
+Cloud Haskell
+=============
+
+This is **Cloud Haskell**. It's a Haskell framework for distributed applications. Basically, it's a tool for writing applications that coordinate their work on a cluster of commodity computers or virtual machines. This is useful for providing highly reliable, redundant, long-running services, as well as for building compute-intensive applications that can benefit from lots of hardware.
Cloud Haskell has two interfaces:
@@ -7,7 +10,7 @@ Cloud Haskell has two interfaces:
This file contains a (slightly out-of-date) introduction to the process layer. We're working on proper documentation for the task layer, but there are example programs included in the distribution.
-We suggest perusing the up-to-date Haddock documentation [here](http://www.cl.cam.ac.uk/~jee36/remote/). The [paper](http://www.cl.cam.ac.uk/~jee36/remote.pdf) is also useful.
+We suggest perusing the up-to-date Haddock [documentation](http://www.cl.cam.ac.uk/~jee36/remote/) and the [paper](http://www.cl.cam.ac.uk/~jee36/remote.pdf).
Process layer: an introduction
------------------------------
@@ -51,6 +54,8 @@ I can run it on some node (and get its PID) like this:
pid <- spawn someNode (greet__closure "John Baptist")
```
+The `greet__closure` symbol here identifies a _closure generator_ and is automatically created by the framework from user-defined functions; see the examples or documentation for more details.
+
You can send messages to a process with its PID. The `send` function corresponds to Erlang's ! operator.
```haskell
View
43 Remote/Call.hs
@@ -3,7 +3,6 @@
-- | Provides Template Haskell-based tools
-- and syntactic sugar for dealing with closures
module Remote.Call (
--- * Compile-time metadata
remotable,
mkClosure,
mkClosureRec,
@@ -81,43 +80,41 @@ mkClosureRec name =
--
-- 1. First, enable Template Haskell in the module:
--
--- > {-# LANGUAGE TemplateHaskell #-}
--- > module Main where
--- > import Remote.Call (remotable)
--- > ...
+-- > {-# LANGUAGE TemplateHaskell #-}
+-- > module Main where
+-- > import Remote.Call (remotable)
+-- > ...
--
--- 2. Define your functions normally. Restrictions: function's type signature must be explicitly declared; no polymorphism; all parameters must be Serializable; return value must be pure, or in one of the 'ProcessM', 'TaskM', or 'IO' monads; probably other restrictions as well.
+-- 2. Define your functions normally. Restrictions: function's type signature must be explicitly declared; no polymorphism; all parameters must implement Serializable; return value must be pure, or in one of the 'ProcessM', 'TaskM', or 'IO' monads; probably other restrictions as well.
--
--- > greet :: String -> ProcessM ()
--- > greet name = say ("Hello, "++name)
--- > badFac :: Integer -> Integer
--- > badFac 0 = 1
--- > badFac 1 = 1
--- > badFac n = badFac (n-1) + badFac (n-2)
+-- > greet :: String -> ProcessM ()
+-- > greet name = say ("Hello, "++name)
+-- > badFib :: Integer -> Integer
+-- > badFib 0 = 1
+-- > badFib 1 = 1
+-- > badFib n = badFib (n-1) + badFib (n-2)
--
--- 3. Automagically generate stubs and closures for your functions like this:
+-- 3. Use the 'remotable' function to automagically generate stubs and closure generators for your functions:
--
--- > $( remotable ['greet, 'badFac] )
+-- > $( remotable ['greet, 'badFib] )
--
--- 'remotable' may be used only once per module.
+-- 'remotable' may be used only once per module.
--
--- 4. When you call 'remoteInit' (usually the first thing in your main function),
+-- 4. When you call 'remoteInit' (usually the first thing in your program),
-- be sure to give it the automagically generated function lookup tables
-- from all modules that use 'remotable':
--
--- > main = remoteInit (Just "config") [Main.__remoteCallMetaData, OtherModule.__remoteCallMetaData] initialProcess
+-- > main = remoteInit (Just "config") [Main.__remoteCallMetaData, OtherModule.__remoteCallMetaData] initialProcess
--
-- 5. Now you can invoke your functions remotely. When a function expects a closure, give it the name
-- of the generated closure, rather than the name of the original function. If the function takes parameters,
--- so will the closure.
---
--- To start the @greet@ function on @someNode@:
+-- so will the closure. To start the @greet@ function on @someNode@:
--
--- > spawn someNode (greet__closure "John Baptist")
+-- > spawn someNode (greet__closure "John Baptist")
--
--- Note that we say @greet__closure@ rather than just @greet@. If you prefer, you can use 'mkClosure' instead, i.e. @$(mkClosure 'greet)@, which will expand to @greet_closure@. To calculate a factorial remotely:
+-- Note that we say @greet__closure@ rather than just @greet@. If you prefer, you can use 'mkClosure' instead, i.e. @$(mkClosure 'greet)@, which will expand to @greet__closure@. To calculate a Fibonacci number remotely:
--
--- > val <- callRemotePure someNode (badFac__closure 5)
+-- > val <- callRemotePure someNode (badFib__closure 5)
remotable :: [Name] -> Q [Dec]
remotable names =
do info <- liftM concat $ mapM getType names
View
1  Remote/Closure.hs
@@ -6,7 +6,6 @@
-- swapped out for the \"static\" mechanism described in the
-- paper.
module Remote.Closure (
- -- * Closure
Closure(..)
) where
View
1  Remote/Reg.hs
@@ -1,7 +1,6 @@
-- | Runtime metadata functions, part of the
-- RPC mechanism
module Remote.Reg (
- -- * Runtime metadata
registerCalls,
Lookup,
Identifier,
View
2  remote.cabal
@@ -12,7 +12,7 @@ Build-Type: Simple
tested-with: GHC ==6.12.1
library
- Build-Depends: base >= 4, time, filepath, containers, network, syb, binary, mtl, bytestring, template-haskell, stm, pureMD5, utf8-string, directory
+ Build-Depends: base >= 4, time, filepath, containers, network, syb, mtl, binary, bytestring, template-haskell, stm, pureMD5, utf8-string, directory
ghc-options: -Wall
Extensions: TemplateHaskell, FlexibleInstances, UndecidableInstances, CPP, ExistentialQuantification, DeriveDataTypeable
Exposed-Modules: Remote.Process, Remote.Encoding, Remote.Call, Remote.Reg, Remote.Peer, Remote.Init, Remote.Closure, Remote.Channel, Remote.Task, Remote
Please sign in to comment.
Something went wrong with that request. Please try again.