A Haskell kernel for IPython
github.com
github.com
(And if anyone has an interest in contributing, please get in touch!)
[0] http://andrew.gibiansky.com/blog/ipython/ipython-kernels/
Be sure to send a message to the IPython-dev mailing list if you're happy to recieve contributions and/or feedback (also from IPython developers).
Please don't hesitate to ask us on the dev mailing list if you run into any problems. For one thing, we're planning on making some updates to the protocol spec soon, based mostly on the experience of the IJulia work. It would be great to have your input there as well, in case you spot something that wouldn't fit well the patterns you saw while doing the Haskell port.
And besides, this means I now have one less excuse to get off my butt and learn Haskell! :)
What about multiple definitions for functions depending on what kind of input is given. Like python has no tail recursion, but lisp does. Write a python function that gets transparently translated to lisp to utilize the features of the language.
You could perhaps have multiple language cores each communicating problems to one another via the common language of the notebook... but that's nothing more than any other text serialization route with all of the challenges therein.
Is IHaskell related to ihaskell-notebook? https://github.com/creswick/ihaskell-notebook
If anyone wants a good intro to the amazing stuff IPython can do, check this (~3hr) video out: http://pyvideo.org/video/1652/ipython-in-depth-high-producti...
Or, many examples of what the notebooks can do: http://nbviewer.ipython.org/
The best part about this project is that it stands to reduce much of the duplicated / wasted effort that goes into recreating the same interface functionality for every single programming language. This is already allowing Julia (and now Haskell) to reap the benefits of the amazing browser UI work that's gone into the IPython Notebook – all for the very low cost of implementing a rather simple ZMQ message server.
Using those you can integrate bash, R, Ruby, SQL, etc. into the same notebook and pass data between them all.
EDIT: Here's a link to most known magic extensions: https://github.com/ipython/ipython/wiki/Extensions-Index
Edit: here's an example [0]
[0] http://nbviewer.ipython.org/urls/raw.github.com/JuliaLang/IJ...
The PyCall.jl [1] package allows transparent calling of Python from Julia. It's quite stable and exceptionally well done (it was written by Steven G. Johnson of FFTW [2] fame – his software is uniformly impressive). The IJulia package [3], which primarily provides a pure Julia IPython kernel so that you can interact with Julia via the various IPython front-ends, also includes [4] a Python package for calling Julia from Python plus IPython "magics" for calling Julia from a normal IPython process. This is rather more experimental than IJulia, but should be usable.
[1] https://github.com/stevengj/PyCall.jl
[2] http://fftw.org
[3] https://github.com/JuliaLang/IJulia.jl
[4] https://github.com/JuliaLang/IJulia.jl/tree/master/python
I actually was just discussing with coworkers how I wish tools around org-mode could actually create an "editable" final state that didn't require emacs. I've been introducing iPython as a way around this, but I've been disappointed with forcing everyone into using python for our analysis work.
Only one of my coworkers really uses emacs, and so sharing perf data and analysis quickly has mostly become iPython.
This gives me hope!
Example: There's a c extension to babel/org-mode that allows you to write a document like this in normal text, and then type:
+begin_src c int test = 42; printf("%i", test); +end_src
and then run and execute this code block in the document, and have the results appear underneath it. That is already pretty cool.
But even cooler is that you can have a python block, and a R block and a ruby block, and then define a variable in python, and have ruby do something with that variable (i.e hand it over) and then create a new variable based on the ruby transformations, and hand it over to R to do some statistics processing with the data. Finally, You take the R output, display it as a table, and generate a plot for it.
All in one text file. Truly awesome.
If we can find a way to use the "ipython kernel" with other languages to generate a generic notebook that can access multiple language runtimes, it'll be unstoppable (just as unstoppable as org-mode is)
In many cases Haskell is very concise and it helps to have an option on the interactive interpreter to enter a Haskell one-liner to prototype a solution.
It's too successful/cross language to just be associated with Python. The guide to learning Julia actually encourages using IPython Julia.
IHaskell specific: As a beginning Haskell learner, is there a simple graphing framework that can make graphs shown inline in IPython (of course bindings to D3 etc to make web native graphs would be awesome, but even just images are fine) ... I'm currently learning maths/stats by implementing basic functions and experimenting with them in R, Julia, possibly Haskell etc. Being able to easily do simple graphs is crucial.
Haskell on IPython? HELL YES. I am definitely taking my Haskell education more seriously this week.