Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embed gophernotes in an application? #232

Open
cosmos72 opened this issue Apr 6, 2021 · 1 comment
Open

embed gophernotes in an application? #232

cosmos72 opened this issue Apr 6, 2021 · 1 comment
Labels

Comments

@cosmos72
Copy link
Member

cosmos72 commented Apr 6, 2021

@cdevr asked in cosmos72/gomacro#13

Do you think it'd be possible to go even further and run something like gophernotes from within an app? (to get a notebook interface available inside a running application)

@cosmos72
Copy link
Member Author

cosmos72 commented Apr 6, 2021

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant