Open cosmos72 opened 3 years ago
I think it's feasible, although it currently requires duplicating a lot of code.
Gophernotes is actually "just" a ZeroMQ server that receives requests from a separate Jupyter notebook, forwards them to gomacro interpreter (loaded as a library, not a separate process), and sends back the evaluation results to Jupyter notebook as ZeroMQ replies.
So in theory one could import and call the Gophernotes code that launches such server.
The main difficulty is that all Gophernotes code currently resides in a package main
thus it cannot be imported and used as library from another application: one would need to copy it to a different package first.
I am thinking whether it could be better to move Gophernotes code to a different package, and have a minimal package main
that calls it...
@cdevr asked in https://github.com/cosmos72/gomacro/issues/13