qiemem / PythonExtension

Python extension for NetLogo
20 stars 6 forks source link

Remote host/interpreter support #3

Open arthurhjorth opened 7 years ago

arthurhjorth commented 7 years ago

Bash on Ubuntu on Windows (AKA Windows Subsystem Linux, AKA WSL) is really cool. However, because it is a sub system, Windows cannot access the Python binaries in WSL. And consequently, the NetLogo python extension won't be able to run them.

JetBrain's PyCharm solves this in their Windows GUI version by allowing people to connect to a remote SSH host that is then run on WSL. All code is sent to WSL via SSH, compiled, run, and values returned. It works beautifully and seamlessly.

Do you have any idea how difficult it would be to implement a similar feature in the extension?

Edit: I wouldn't know where to look for their implementation, but here is how to set it all up. Maybe that will give you a sense of how it works behind the scene: https://www.jetbrains.com/help/pycharm/2016.3/configuring-remote-interpreters-via-wsl.html

qiemem commented 7 years ago

Glad you brought this up. I've already been thinking about something similar as a way to let people connect to an existing python instance (so you could connect to a running notebook or whatever). I think just letting people specify "hostname:port" as what to connect to, and then having them start the python process manually should do it, ya? I'll look more into what pycharm is doing.

arthurhjorth commented 7 years ago

Ha! I actually wrote in my first draft of the issue that the simplest implementation in which we just ask users for hostname and port would be great, but figured I didn't want to come off as too bossy and deleted it :p I think that would be super cool.

And good point that this is not specifical to WSL. Long-term this would make it easier for everyone to quickly run the python part of their code on a remote computer that has all the necessary libraries up and running. (might lower the threshold for using the extension too)

:+1: :+1: :+1: