coq-serapi icon indicating copy to clipboard operation
coq-serapi copied to clipboard

ZeroMQ support -- Jupyter kernel

Open ejgallego opened this issue 8 years ago • 15 comments

The title says it all. This is a first step towards becoming a Jupyter kernel. The basic resources are:

  • https://github.com/akabe/ocaml-jupyter
  • https://github.com/andrewray/iocaml
  • http://jupyter-client.readthedocs.io/en/latest/kernels.html
  • https://github.com/dsblank/simple_kernel

ejgallego avatar Jun 22 '16 21:06 ejgallego

Sounds really exciting!

cpitclaudel avatar Jun 22 '16 21:06 cpitclaudel

Some more discussion on ZeroMQ in Ocaml here:

https://sympa.inria.fr/sympa/arc/caml-list/2016-07/msg00181.html

[unfortunately, the ocaml mailing list is not accessible to google]

ejgallego avatar Jun 29 '17 15:06 ejgallego

Hi, I'm just curious if there's any reason one cannot leverage work done on integrating ocaml with jupyter. That project appears to have implemented their own zeromq interface. I should add I am no expert in ocaml/coq and my knowledge of zeromq is minimal (coming from a python background).

bsdz avatar Jul 23 '17 14:07 bsdz

@bsdz indeed that is the plan; I guess we are all just short on time / working on other stuff [in my case I am using my free time trying to tweak Coq upstream itself so clients such as SerAPI have a better time interacting with it]

Any help here will be more than welcome!

ejgallego avatar Jul 23 '17 14:07 ejgallego

Thanks for the info @ejgallego. If I can help, I will; although, initially only from a testing perspective.

bsdz avatar Jul 23 '17 15:07 bsdz

There is a better (and more modern) implementation of OCaml kernel for Jupyter by the way : https://github.com/akabe/ocaml-jupyter

XVilka avatar Jan 04 '18 07:01 XVilka

Thanks @XVilka , the info is really appreciated.

ejgallego avatar Jan 04 '18 14:01 ejgallego

For those interested, we plan to work on the first prototype at the Coq Implementors Workshop 2018 if I can finally attend. We will use the SerAPI toplevel + @akabe 's OCaml bindings.

ejgallego avatar Apr 19 '18 14:04 ejgallego

How are you planning to handle backtracking? Will it be more OCaml-style (redefinitions override previous definitions?)

cpitclaudel avatar Apr 19 '18 15:04 cpitclaudel

How are you planning to handle backtracking? Will it be more OCaml-style (redefinitions override previous definitions?)

There is no notion of "backtracking" in the Coq document model, but rather Coq maintains an internal document representation, that is synchronized with the Jupyter document, so indeed certain changes may force invalidation, etc... We will see how well it fits, but in principle, adding an already existing definition would error. Until the new document model can land in Coq, I will use a compat layer that should take care of the most pressing subjects.

p.s: IMVHO the word "backtracking" applied to Coq documents used incorrectly, as the usual meaning is in the context of proof search.

ejgallego avatar Apr 19 '18 15:04 ejgallego

We will see how well it fits, but in principle, adding an already existing definition would error.

OK :)

p.s: IMVHO the word "backtracking" applied to Coq documents used incorrectly, as the usual meaning is in the context of proof search.

I tend to use both the algorithmic sense and the usual one, "reverse one's previous action or opinion."

cpitclaudel avatar Apr 19 '18 15:04 cpitclaudel

Lately I tend to prefer the model of "updating the document" to "reversing a concrete edit or checking action".

ejgallego avatar Apr 19 '18 15:04 ejgallego

I saw the Python interface issue is linked to this. Sorry if this a naive question, but how is this issue related to it?

brando90 avatar Feb 02 '19 21:02 brando90

I saw the Python interface issue is linked to this. Sorry if this a naive question, but how is this issue related to it?

I feel like implementing Jupyter kernels is better done in Python; thus if we would complete the Python interface that could significantly help this issue.

ejgallego avatar Feb 05 '19 02:02 ejgallego

cc: https://github.com/EugeneLoy/coq_jupyter

ejgallego avatar Feb 05 '19 14:02 ejgallego

Jupyter protocol is for now not planned, in favor of coq-lsp

ejgallego avatar Feb 15 '23 00:02 ejgallego