5

I'm looking for a way to pass events back and forth between Clojure and erlang.

  • has someone done this before?
  • how should I encode the (immutable) messages in a flaxable general way?
  • Should IPC be used for this? what sort?
  • where has this gone wrong for you in the past?
Arthur Ulfeldt
  • 90,827
  • 27
  • 201
  • 284
  • +1 for a question that makes most people scratch their heads... – gahooa Nov 18 '09 at 21:13
  • 2
    Have not done this before, but I can think of two (potentially bad) options: 1) Use Thrift to make a custom RPC solution. It has support for Java and Erlang. 2) Look at BERT-RPC, created and used by GitHub for Erlang-Ruby RPC, and write a Clojure client library for it. – alanlcode Nov 18 '09 at 21:26
  • alanlcode: dont be shy post this as an answer. these are good ideas. – Arthur Ulfeldt Nov 18 '09 at 22:11

2 Answers2

6

You could use jinterface from clojure and be able to act as an Erlang node and send out multiple Pids associated with your node, in the Erlang cluster.

Christian
  • 9,417
  • 1
  • 39
  • 48
2

You've got lots of options as long as you use a socket (e.g. TCP/IP).

  • Have you considered JSON?
  • XML?

I can't say I've done Clojure <--> Erlang bridges before but "talking" to Erlang in JSON/XML is sufficiently painless.

Of course you can use the erl_interface (binary exchange protocol) but then you'll need (probably unless there is a lib for this) to craft a marshaller for this in Clojure.

jldupont
  • 93,734
  • 56
  • 203
  • 318