dotnet / interactive

.NET Interactive combines the power of .NET with many other languages to create notebooks, REPLs, and embedded coding experiences. Share code, explore data, write, and learn across your apps in ways you couldn't before.
MIT License
2.8k stars 374 forks source link

Add support for Go, using GoNB kernel #3511

Open janpfeifer opened 2 months ago

janpfeifer commented 2 months ago

Is your feature request related to a problem? Please describe.

I maintain GoNB, I think the only currently supported Go kernel for Jupyter notebooks, and there has been requests for better support for VSCode+Polyglot -- without auto-complete, notebooks are not as useful.

Notice GoNB does support Jupyter's Completion protocol, but VSCode won't use it.

I'm not sure what is required for dotnet/interactive to add support for another language, but Go provides a great Language Server (LSP), see gopls.

Describe the solution you'd like Go language to be included in the set of languages supported.

Describe alternatives you've considered Maybe Polyglot to talk Jupyter's Completion protocol ? I'm not sure if this is feasible. This way it would be "future compatible" with new languages or custom kernels ...

jonsequitur commented 1 month ago

Since GoNB already supports the Jupyter Message Protocol, you should be able to follow the same process that enables Python and R to work within a Polyglot Notebook.

https://github.com/dotnet/interactive/blob/main/docs/adding-jupyter-kernels.md

janpfeifer commented 1 month ago

Thanks for the pointer @jonsequitur !

I'll have to investigate further ... my first read at the document I don't know what is referred by a #!connect jupyter command (and I wonder why it seems to be hardcoding conda) among other things. I haven't used the Polyglot yet, so I'm probably missing something obvious.

But GoNB does implement the comms protocol, so hopefully it should work somehow.