Giter Site home page Giter Site logo

Comments (3)

parente avatar parente commented on June 9, 2024

Thanks for opening this. I love to see ideas for new clients of Jupyter kernels!

I'm not familiar with h, but based on your description, I think the setup would be something more like the following:

  1. User of h is on a site
  2. User writes code in the h sidebar (e.g., in a fenced code block)
  3. User selects the code and hits an execute button
  4. When user executes the code for the first time, the h extension contacts a kernel gateway to request a kernel in the desired language (for simplicity, let's pretend the kernel gateway and kernel live somewhere in the cloud, say, as a service the h authors provide)
  5. The h sidebar sends the code (not a notebook ipynb file) to the provisioned kernel / kernel gateway for evaluation following the jupyter protocol
  6. Kernel responds and h renders the result inline.
  7. h saves the code in one of its annotations however it wants.

The key difference between your proposal and this is that the kernel gateway, when operating in its normal jupyter-websocket mode, doesn't know anything about ipynb files. It takes jupyter protocol messages on a websocket, sends them to a jupyter kernel on 0mq (which is what all kernels talk), and does the reverse for messages that come from kernels.

The jupyter-js-services npm package provides a nice library for requesting kernels from a kernel gateway and sending them code. Here's an example:

https://github.com/jupyter-incubator/kernel_gateway_demos/blob/master/node_client_example/client.js

Since the kernel gateway uses HTTP and Websockets, you can use pretty much any language to communicate with it. Here's another example in Python which doesn't have a nice library like nodejs (yet?)

https://github.com/jupyter-incubator/kernel_gateway_demos/tree/master/python_client_example

from kernel_gateway.

jibe-b avatar jibe-b commented on June 9, 2024

Thanks for answering with details!

The process will likely be simple like this, and can be developed with a local h server. I only need to know more about the jupyter protocols to do it, and your description shows it is rather simple too.

I will try something in the next weeks (but don't expect it too quickly) and I may come back with further questions.

from kernel_gateway.

parente avatar parente commented on June 9, 2024

@jibe-b I'm going to close this issue. If you did attempt the h experiment, feel free to let us know the outcome in new issues or in the Jupyter Google group.

from kernel_gateway.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.