What if Elisp and Python Had a Child?

John Kitchin, as Irreal has covered many times, is doing a lot of excellent work with Org mode and Emacs. Most of his scientific computation is done in Python, a language he’s been using for 15 years and is very comfortable with. He’s managed to integrate Python and Org mode by using Babel code blocks.

He discovered, though, that it’s a lot more fun to program in Lisp than in Python. That’s something that many of us have discovered so I’m entirely sympathetic to is desire to do his scientific work in Lisp. The problem is that Python has really great support for scientific calculations that isn’t generally available in Lisp environments. What’s really needed, he says, is a way of accessing the Python library from Lisp. Happily, there is a way of doing this with Hy, a Lisp dialect that compiles to a Python abstract syntax tree that can executed by Python.

Kitchin tries a few simple experiments in his post and discovers that it’s amazingly simple to write in Lisp and still have all the numerical goodness of Python. Take a look at his post to see easy and natural it is. If, like Kitchin, you have a large investment in Python knowledge, need the scientific libraries that Python provides, and would rather be writing in Lisp be sure to check out his post and then head over to the Hy site. It’s pretty easy to install and get started with Hy so you can try it out with little effort.

Hat tip to Karl Voit for pointing me to Kitchin’s post.

This entry was posted in General and tagged , , , . Bookmark the permalink.