I’d like to use SWISH to collaborate with a colleague. I’ve tried to understand whether it is possible to do that and how, but I can’t seem to find where this is explained. The SWISH examples on SWISH -- SWI-Prolog for SHaring are great in explaining how to use the online instance but what I’d ideally like to be able to do is to run an independent instance, ideally both online and off, which I’d share with my collaborator, just like sharing a jupyter notebook.
Is there a tutorial for how to do this?
Importantly we’d both need to be able to make our code run on SWISH, possibly as a library. For instance, I would like to be able to run one of my ILP systems inside SWISH and let another person experiment with the data and the hyperparameters of the learning procedure etc. But I think SWISH runs in a sandbox that restricts what libraries can be loaded? Is that correct?
EDIT: hang on. I’m looking at the local installation instructions on the github. Apologies, I went straight to the SWISH instance running online thinking I’d find something there.
Uh. It might be an idea to include a link to the github README in the online instance with a few words about how to run SWISH on your own.
Yes. You’ll need a new instance and make your ILP system sandbox safe or share the instance without a sandbox after limiting access to trusted users. Nice examples of the first approach are in the Examples page below Other public SWISH instances
Feel free to make PRs that help people to understand the SWISH installation and reuse possibilities. The system is pretty flexible (although notably the web technology side of things are quite dated )
Note that on the public server you can use :- include(FileOrHash). to include other files.
Thanks. If I get to know it well enough I will. I’m find with it being dated, for my purpose I think it should be fine. I don’t think I have the web development knowledge to help there though
Thanks. I could potentially run my entire ILP system as one file but that would be a little inconvenient.
Oops. My ILP system relies on modules to find clean copies of training data and many other things. I’ll just have to run locally outwith a sandbox. I hope.
Alright! That wasn’t hard after all. I got SWISH running locally and communicating with my SWI IDE like it says here: GitHub - SWI-Prolog/swish: SWI-Prolog for SHaring: a SWI-Prolog web IDE · GitHub. That’s great because all my project’s files are loaded into SWISH and I don’t need to mess with include/1 and weird windows paths.
Only one problem now: I don’t know how to open my project’s files in SWISH. I’d like to edit them in place in SWISH, instead of alt/tabbing back and forth between SWISH and the IDE. Is there a way to do that?
a) Probably a bug: consulting run.pl on the windows terminal (powershell console) doesn’t start the server:
For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
6 ?- [run].
% Library was moved: library(http/json) --> library(json)
% Updating GIT version stamps in the background.
Warning: C:/Users/YeGoblynQueenne/Documents/Prolog/swish/lib/render/svgtree.pl:131:
Warning: Singleton variables: [Term]
true.
This is what it looks in the SWI IDE instead:
42 ?- swish.
% Library was moved: library(http/json) --> library(json)
% Updating GIT version stamps in the background.
Warning: C:/Users/YeGoblynQueenne/Documents/Prolog/swish/lib/render/svgtree.pl:131:
Warning: Singleton variables: [Term]
% Started server at http://localhost:57052/
true.
Maybe something related to the latest bug fixes for the console glitch?
b) Swish can’t seem to find my debug subjects.
Swish:
debug(learn).
learn: no matching debug topic (yet)
1true
SWi IDE:
43 ?- debug(learn).
true.
EDIT: just to clarify, SWISH then fails to print out my debug statements while the SWI IDE does print them.