For the past 48 hours I have been participating in the Gopher Gala hackathon. I'm a little tired now, but I had to share my project and get the word out. I have created a first release of a Golang kernel for Jupyter (aka ipython) notebooks (see the Github repo here)! That's right Go lovers, you can now create, in the browser, and share documents that contain live Go code, equations, visualizations and explanatory text. It's time we programmed in Go interactively and let all those data scientists out there experience the joys of concurrency, channels, etc.
And here are some example notebooks:
- Simple Printing and Channels
- Pattern Recognition with Golearn
- Feed Forward, Recurrent Neural Nets
- Time Parsing, Formatting
- Stateful Goroutines
- Worker Pools
Make sure jupyter notebook and
libzmq-dev are installed. See here for more details on installing jupyter. Next, install
goimports if you haven't already:
go get golang.org/x/tools/cmd/goimports
Get the kernel:
go get github.com/gophergala2016/gophernotes
Create a directory for the new kernel config:
mkdir -p ~/.ipython/kernels/gophernotes
Copy the kernel config into the
cp -r $GOPATH/src/github.com/gophergala2016/gophernotes/kernel/* ~/.ipython/kernels/gophernotes
Start the jupyter notebook:
Golang from the
New drop down menu, and have fun!
Possible Issues: Depending on your environment, you may need to manually change the path to the
gophernotes executable in
kernel/kernel.json before copying it to
~/.ipython/kernels/gophernotes. You can put the full path to the
gophernotes executable here, and you shouldn't have any further issues.
Pull down and run the latest image:
docker pull dwhitena/gophernotes:latest docker run --name gophernotes --net host -d dwhitena/gophernotes:latest
Point your browser to
Golang from the
New drop down menu, and have fun! It's that easy. Note, in both of these scenarios, you are still able to create python notebooks, text files, run the ipython shell, etc.