Open ColmBhandal opened 2 years ago
We would like to do something like this eventually. It's a large task though and we're not sure when we're going to have the resources for it.
I put this back on the board as a large task. I'll look at it with @shd101wyy . We have something like this for the prover, we could look at making that a bit more flexible and allowing for any of our tools in some limited capacity.
Also, @tothtamas28 is developing the kit
tool, which should be able to help with this.
We could call it "KlayGround".
Just wanted to give this a +1 from me since I would also love to see this becoming a thing!
Not a long-term idea or anything, but just as a POC I created a very basic pair of services that would allow someone to access K
commands through their browser, via an interactive terminal:
https://github.com/ColmBhandal/kwetty
Not sure how it would work with multiple users logging in or anything. ATM it's just configured with one user people can use to log in over SSH.
Don't have it deployed anywhere, just tested it on localhost
.
I think we should consider Jupyter Notebooks as a platform for this. Here are some advantages to such an approach:
K
. To this end, I've hacked together a POC Jupyter Kernel allowing K
code to be run interactively in a browser:
You can try this online:
There are 2 Notebooks:
lesson-02.ipynb
- Tutorial lesson 1.2
converted to an interactive notebook.lesson-02-soln.ipynb
- the solution to said lesson.Notes:
lesson 1.2
interactively in their browser, as demoed in Binder.Related: #2925
FYI the Binder Demo was broken for a while - pip wasn't installed - I just fixed it there.
@ColmBhandal, you may be interested in this: https://marketplace.visualstudio.com/items?itemName=RuntimeVerification.k-vscode I started working on a VSCode extension that brings syntax highlighting, code suggestions, go to definition and find usages. It's still in progress, and I plan to add more features, but this could work as an IDE in the browser. GitHub allows you to view files using the VSCode browser, where you can install extensions from the Marketplace.
Note that you can't install this version online. I need to update the packaging solution.
Expose an online "k-scratchpad" (or an online IDE / Notebooks environment) that one can visit within their browser and immediately start writing / compiling / running
K
code. There are various levels of sophistication possible. The most basic idea is just a scratchpad allowing someone to write/compile/runK
code through their browser.More advanced feature ideas:
K
-Notebook for literate-programming (similar to Jupyter Notebook for Python)Motivation
K
language. Having an interactive scratchpad with zero setup cost may motivate more people to get involved in the language. In particular, Interactive Notebooks for literate programming would likely drive up engagement. More engagement means a larger active community, and that can lead to better quality/popularity of theK
-framework.K
examples. For example, if the online tool allowed people to create a permalink to their scratchpads (like dotnetfiddle does, as just one example), these could be shared, giving recipients instant interactive access to an idea, without having to download/compile anything.There are similar online IDEs/scratchpads/Noteboooks/compilers for other languages e.g. to name a few:
There is an existing GitHub project called KWeb. It looks like this allows someone to host an online K IDE themselves, rather than providing the IDE-as-a-service, so to speak. There is an example link provided on that project but looks like it was just a POC and the link seems to be dead: http://fsl.cs.uiuc.edu/tool/.
Documentation
Here is just a small example of what some documentation might look like leading users to use interactive
K
Notebooks, for example:Then perhaps more inline documentation/examples around using
K
-Notebooks could be hosted at said URL.Potential Alternatives/Work-arounds
K
locally - as is the state of the art today.K
seems to be Dockerized here, a workaround to setting upK
locally I guess would be just pull the Docker image and run it as a container. Assuming someone has Docker installed, which many do seem to these days.