moonio: afternoon hack to quickly embed an(y) intertpretter into IPython

IPython is a tool that is catching on like wildfire. Jupyter ( is a project that is attempting to split apart the Python-specific parts from the generic infrastructure.

I had no idea how the project was architected, but I decided to see if there was a way that one could embed “any” interpretter into IPython simply. Documentation is a little sparse, and I got a clue on how it might be possible at the page “IPython kernels for other languages”:

One of the the projects looked particularly useful: “Simple example kernel”:

I copied his project, and added some functionality that would actually attach to an arbitrary interpretter. With fairly minimal hacking, I produced ‘moonio’:

The idea is that you can get an interpretter to work with basically only two things: * the name of the interpretter (easy!)
* a regex that enables you to identify whtn the interpretter is expecting input.

That’s it! I have no bells or whistles, of course, but it was a fun afternoon hack. The project comes with an example config file that sets up the configuration for gforth. Basically, two lines of json should get you on your way.

I called the project ‘moonio’ because Io is a moon of Jupiter, and it intermediates the IO between IPython (and hopefully Jupyter at some stage) and an interpretter.

I hope you like my little project.

About mcturra2000

Computer programmer living in Scotland.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s