5

There are some interesting descriptions of writing language kernels to allow a language previously unsupported by IPython to be executed from IPython.

In all cases, the kernel creation step involves using the target language's ZeroMQ bindings (since ZeroMQ is a major architectural component of IPython's front-end to kernel communication protocol).

In my company, a proprietary language was created a few years ago and is maintained with compilers to bytecode (with a bytecode runner written in C++), Flash, and JavaScript ... it's still heavily used today but it has never had anything like a REPL.

This language is a functional language similar to Haskell or SML, and it has no ZeroMQ bindings with no plans for the language maintainers to add any.

Is there a way to still write a kernel that can communicate with IPython?

Community
  • 1
  • 1
ely
  • 74,674
  • 34
  • 147
  • 228

1 Answers1

1

If your language has Python bindings, or you can drive a REPL from Python using something like Pexpect, you can create a wrapper kernel, reusing the IPython communication machinery.

This is documented here: http://ipython.org/ipython-doc/dev/development/wrapperkernels.html

Thomas K
  • 39,200
  • 7
  • 84
  • 86
  • It unfortunately does not, but this is useful to know. The language in question is typically compiled to Javascript or Flash for web applications, but can also be compiled to bytecode via neko and then run with a custom bytecode runner. If it has extensions to anything, it would be only Haxe, but I am not even sure the extent of that. Currently I am using a collection of cell magic functions that take care of the back end compilation of a cell in the notebook, targeting either .js or .swf, and then using `display.HTML` to display an iframe of the results in the output cell. – ely Feb 24 '15 at 22:55
  • You could build a kernel along similar lines, where the kernel's 'execution' actually compiled the code to js and then sent it back to the frontend to really be executed. You probably wouldn't be able to use things like tab completion, because the kernel wouldn't know about the namespace, but execution should be possible. – Thomas K Feb 24 '15 at 23:29