Arc Forumnew | comments | leaders | submitlogin
Say I wanted to use Arc in my Python project
1 point by d0m 5093 days ago | 2 comments
What would be the easiest way to achieve that? To be precise, I would like to hack in Arc while being able to call some python functions. Or, from python, be able to call Arc.

Should I use Arc as kind of "service" which I connect to? Or write my own interpreter?

Thanks



2 points by aw 5093 days ago | link

I like this blog post on why to use HTTP by default: http://timothyfitz.wordpress.com/2009/02/12/why-http/ (that is, unless you have some reason why HTTP isn't good enough, use HTTP :)

akkartik mentioned my library to call Python from Arc. Going in the other direction is also easy. To call Arc from Python, have Arc run a web server on a port (say 8080 or 9001 or whatever) that you firewall off so that only your Python program can get to it, and have Arc accept HTTP requests with things to do and have it respond with a JSON response.

-----

2 points by akkartik 5093 days ago | link

aw's had some experience running other languages as separate processes communicating over a port: http://awwx.ws/lang2

For readwarp I have python components that emit JSON and communicate over a FIFO with the arc server. I use a scheme JSON parser for speed.

I'm not sure what I can generalize, just a couple of sample points.

-----