Subject: [ANNOUNCE] Erlang-style Distributed Haskell To: glasgow-haskell-users@haskell.org This is the first release of an implementation of an Erlang-style communication mechanism with runtime typing which provides a Haskell equivalent for sending using "!" (pronounced "bang!") and "receive". Distributed Haskell´s home is at http://www-i2.informatik.rwth-aachen.de/~stolz/dhs/ where you will find HTML-ified information about the package. You can use Distributed Haskell to safely communicate data (derived from classes Read & Show) across a network. A small example implementing a global counter which accepts remote requests for {de,in}crementing and getting its value looks like this: Server ====== > import Distributed > > data Msg = Inc | Dec | GetValue Pid | Value Int > deriving (Show, Read) > > counter' n = do > receive (\v -> case v of > Inc -> counter' (n+1) > Dec -> counter' (n-1) > GetValue pid -> do > pid (Value n) > counter' n Client ====== > import Distributed > > data Msg = Value Int | GetValue Pid | Inc | Dec | Hallo > deriving (Show, Read) > > destHost = "remote.host" > destNode = "Counter-Node" > > client :: Pid -> DIO Msg () > client pid = do > proc $ putStrLn "i,d,v?" > str <- proc $ getLine > case str of > "i" -> do > remoteSend destHost destNode "Counter" Inc > client pid > "d" -> do > remoteSend destHost destNode "Counter" Dec > client pid > "v" -> do > me <- self > remoteSend destHost destNode "Counter" (GetValue me) > receive (\v -> case v of > Value v -> do > proc $ putStrLn ("\n"++(show v)) > client pid > ) > _ -> client pid Further features include: ========================= - optimization of network-usage (connection caching) - robustness (similar Erlang´s "monitor_node"/"spawn_link") - a preprocessor for easy program creation from .dhs files (desugars & receive) - a couple of example programs including Dish, the Distributed Haskell Shell for testing your Distributed Haskell programs. - written entirely in Literate Haskell :-) Future work =========== Another implementation using a "ports-based" approach extending Channels will be released some time later. Feedback ======== We´re really interested in feedback, especially regarding all the trouble caused by using yet another monad (DIO) which requires casting normal IO-operations (see the "proc (putStrLn ..)" in the client code above). Bug reports are welcome, too! Please send them to Frank Huch and Volker Stolz . Feel free to contact us about any issues arising from using Erlang-style Distributed Haskell. Happy distributing, Volker