Python3 to clojure IPC

I have a strange request. We are in a state where we need to start the clojure service between our working python3.3 and the database. For this reason, I am considering different ways of interacting between python and clojure. I looked at Thrift, but unfortunately it does not have python3 support yet. 0mq also looked interesting, but I'm worried about the req / req structure blocking python3 threads (there will be multiple threads for multiple processes that should use this proxy service).

Are there any existing existing libraries that could help me here? At the end of the day, I could write my own service from scratch, using alef and raw sockets, but I feel that it is too much to reinvent the wheel.

+4
source share
2 answers

Clojure means JVM. Most languages ​​running on the JVM allow you to "call Java" and "call Java", which basically means something else on the JVM. I have never done this, but you can probably call Clojure from Jython. Now Jython does not support the Python 3 language, but supports Pyro.

This is a little far-fetched, but you can try:

JVM Python-VM Jython Clojure ( Your app -> Pyro ) --> ( Pyro -> Proxy -> Your app ) 

RMI arguments should probably be translated into Java primitives and Java strings. It may also require some ClassLoader-Voodoo.

+4
source

I use ZeroMQ in Python in production quite happily so far; There is Clojure support that I haven't used yet - it requires its own libraries, which can be a little awkward. I am going with your ZeroMQ link, even if this is not a complete RPC mechanism, because often problems with RPC can be broken down quite simply as operations in one or more message queues.

Meanwhile, there is also clojure-py , which allows you to have your own Python and eat your Clojure too. It is still quite young and not without rough edges, but the bulk of the functionality is in place.

Finally, there is always XML-RPC for which Clojure and Python have libraries if you just want something to just stick your Python and Clojure together.

+2
source

All Articles