Re[Haskell-cafe] mote invocations in Haskell?

Hello, Is there a way to perform some kind of remote method invocation in haskell? (Or, "remote object", but I prefer not to use this term, as there are no "objects" strictly speaking in Haskell) I would like to use a higher level API than sockets for network programing. ----- Yves Parès Live long and prosper -- View this message in context: http://old.nabble.com/Remote-invocations-in-Haskell--tp28006793p28006793.htm... Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

You could use a webserver and have a RESTful interface, though I'm not sure
if that's what you're looking for.
On Tue, Mar 23, 2010 at 1:46 PM, Yves Parès
Hello,
Is there a way to perform some kind of remote method invocation in haskell? (Or, "remote object", but I prefer not to use this term, as there are no "objects" strictly speaking in Haskell) I would like to use a higher level API than sockets for network programing.
----- Yves Parès
Live long and prosper -- View this message in context: http://old.nabble.com/Remote-invocations-in-Haskell--tp28006793p28006793.htm... Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

* Yves Parès
Is there a way to perform some kind of remote method invocation in haskell? (Or, "remote object", but I prefer not to use this term, as there are no "objects" strictly speaking in Haskell) I would like to use a higher level API than sockets for network programing.
There is for example XML-RPC library for Haskell. http://hackage.haskell.org/package/haxr -- Roman I. Cheplyaka :: http://ro-che.info/ "Don't let school get in the way of your education." - Mark Twain

Okay, I tried to make the sample here: http://www.haskell.org/haskellwiki/HaXR But I can't get it working... Is there an external XML-RPC server that must be running? Maybe even an external HTTP server? The server launches without complaining about anything, whereas the client tells: simple_client: user error (Error calling examples.add: connect: does not exist (Connection refused)) I know I have to adapt the url the client tries to connect at (in the sample, "http://localhost/~bjorn/cgi-bin/simple_server"), but I don't know how. Roman Cheplyaka-2 wrote:
* Yves Parès
[2010-03-23 13:46:25-0700] Is there a way to perform some kind of remote method invocation in haskell? (Or, "remote object", but I prefer not to use this term, as there are no "objects" strictly speaking in Haskell) I would like to use a higher level API than sockets for network programing.
There is for example XML-RPC library for Haskell. http://hackage.haskell.org/package/haxr
-- Roman I. Cheplyaka :: http://ro-che.info/ "Don't let school get in the way of your education." - Mark Twain _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
----- Yves Parès Live long and prosper -- View this message in context: http://old.nabble.com/Remote-invocations-in-Haskell--tp28006793p28007923.htm... Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

Okay, well, apparently I have to rely on an external HTTP server. This is not very simple, is there another more suitable way to get RPC working in haskell? Yves Parès wrote:
Okay, I tried to make the sample here: http://www.haskell.org/haskellwiki/HaXR
But I can't get it working... Is there an external XML-RPC server that must be running? Maybe even an external HTTP server? The server launches without complaining about anything, whereas the client tells: simple_client: user error (Error calling examples.add: connect: does not exist (Connection refused))
I know I have to adapt the url the client tries to connect at (in the sample, "http://localhost/~bjorn/cgi-bin/simple_server"), but I don't know how.
Roman Cheplyaka-2 wrote:
* Yves Parès
[2010-03-23 13:46:25-0700] Is there a way to perform some kind of remote method invocation in haskell? (Or, "remote object", but I prefer not to use this term, as there are no "objects" strictly speaking in Haskell) I would like to use a higher level API than sockets for network programing.
There is for example XML-RPC library for Haskell. http://hackage.haskell.org/package/haxr
-- Roman I. Cheplyaka :: http://ro-che.info/ "Don't let school get in the way of your education." - Mark Twain _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
----- Yves Parès Live long and prosper -- View this message in context: http://old.nabble.com/Remote-invocations-in-Haskell--tp28006793p28008179.htm... Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

Maybe erlang is more suitable for you as rpc is built in function in erlang. Yves Parès wrote:
Okay, well, apparently I have to rely on an external HTTP server. This is not very simple, is there another more suitable way to get RPC working in haskell?
Yves Parès wrote:
Okay, I tried to make the sample here: http://www.haskell.org/haskellwiki/HaXR
But I can't get it working... Is there an external XML-RPC server that must be running? Maybe even an external HTTP server? The server launches without complaining about anything, whereas the client tells: simple_client: user error (Error calling examples.add: connect: does not exist (Connection refused))
I know I have to adapt the url the client tries to connect at (in the sample, "http://localhost/~bjorn/cgi-bin/simple_server"), but I don't know how.
----- fac n = let { f = foldr (*) 1 [1..n] } in f -- View this message in context: http://old.nabble.com/Remote-invocations-in-Haskell--tp28006793p28009901.htm... Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

Yves Parès wrote:
Okay, well, apparently I have to rely on an external HTTP server. This is not very simple, is there another more suitable way to get RPC working in haskell?
Apparently it is possible to use Happstack as webserver, here's example I came up with: import Network.XmlRpc.Server import Happstack.Server.SimpleHTTP import Control.Monad.Trans import Data.ByteString.Lazy.Char8 add :: Int -> Int -> IO Int add x y = return (x + y) handler = do Body body <- rqBody `fmap` askRq liftIO $ handleCall (methods [("examples.add", fun add)]) (unpack body) main = simpleHTTP (Conf 8080 Nothing) handler

Hi
On Tue, Mar 23, 2010 at 9:46 PM, Yves Parès
Is there a way to perform some kind of remote method invocation in haskell? (Or, "remote object", but I prefer not to use this term, as there are no "objects" strictly speaking in Haskell) I would like to use a higher level API than sockets for network programing.
you could try dbus. dbus-client[1] is a relatively high-level wrapper. [1]: http://hackage.haskell.org/package/dbus-client [2]: http://hackage.haskell.org/package/dbus-core -- Håkon Lorentzen e-mail: hakonlo@gmail.com phone: +47 90539718
participants (6)
-
Gleb Alexeyev
-
Håkon Lorentzen
-
Michael Snoyman
-
Roman Cheplyaka
-
Yves Parès
-
zaxis