[KIP] - K Online Scratchpad/Notebooks/IDE

Open
#2,541 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale

Research direction

The issue does not identify repository files, tests, or an implementation entry point. Start by reviewing the existing KWeb project and the K framework's browser- or Docker-based execution options, then define a focused first milestone and its completion criteria before implementation.

Written by the indexing model from the issue text.

Description

kip web

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/run K code through their browser.

More advanced feature ideas:

  1. The ability to save & share a scratchpad with others e.g. via a URL.
  2. Online-IDE features like syntax highlighting, autocompletion etc.
  3. An interactive K-Notebook for literate-programming (similar to Jupyter Notebook for Python)

Motivation

  1. Drive up engagement of newcomers to the 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 the K-framework.
  2. Help existing users (even advanced ones) share interactive 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:

  1. For Coq there's JsCoq. This has got syntax highlighting and an interactive scratchpad, but no ability to share links to examples from what I can tell.
  2. For C#, for example there's dotnetfiddle - this allows C# code to be run in the browser and also for examples to be shared with a link.
  3. For Python there are many examples but probably most notably Jupyter Notebooks. These allow for a fully interactive literate programming experience without leaving your browser.
  4. For Java (and many other languages) there is TutorialsPoint, which allows users to write, compile, run, save and share code examples.

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:

K now supports interactive online literate programming via K-Notebooks, which allow users to simultaneously write, document, run and share K examples and projects all in the one place. Check out BLAH_URL.xyz to get started.

Then perhaps more inline documentation/examples around using K-Notebooks could be hosted at said URL.

Potential Alternatives/Work-arounds

  1. For compiling and running, the workaround for this is to just compile and run K locally - as is the state of the art today.
  2. For code-sharing, one can use a tool like Git for example, or create a GitHub Gist if the idea is still in a very experimental stage.
  3. Also, I guess since K seems to be Dockerized here, a workaround to setting up K 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.
Dominant language
Python
Stars
591
Forks
163
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from runtimeverification/k

All issues in runtimeverification/k

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.