You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Question: on using a remote process for the Python interpreter #6
I really enjoyed listening to Scicloj meeting #4. You're doing interesting work here. I feel that you're setting the Clojure community up for an interop story with Python that's similar to how we're able to make use of Java.
I have a question, if you don't mind. Per now, I can use my own interpreter of choice like this:
I would like to use libpython-clj to interface with a running Python process that's not started from within the Clojure process, but "on its own terms". A possible process could look like this:
Make some changes to the remote Python interpreter allow libpython-clj to ... do what it needs to do.
Start a Clojure process
Point the Clojure process to the running Python process
Evaluate Python code in that context.
The reason why I can't just start a new process, is that the Python process is started by another application, and I need access to the application state, as the user interacts with the state.
Is this in scope for libpython-clj?
Do you think it's feasible?
I spent some time reading the libpython-clj source code, but I must admit that this is above my level, hence I'm asking.
Thanks again for your work, and have a nice day!
Teodor
This isn't currently possible; it would take something like launching a clojure process that did the networking stuff and the eval'ed things in a python context.
Is there a python equivalent to nrepl? Maybe some bindings around that would do something like what you want.
Activity
cnuernber commentedon Oct 12, 2019
@teodorlu Hey Teodor!
This isn't currently possible; it would take something like launching a clojure process that did the networking stuff and the eval'ed things in a python context.
Is there a python equivalent to nrepl? Maybe some bindings around that would do something like what you want.
teodorlu commentedon Oct 14, 2019
Thanks for the clear reply -- I wasn't aware of how
libpython-cljdid its internal work, so the clarification was really helpful to me.Something similar to NREPL seems like the way to go.
Closing this. Thanks again!
Teodor