ANN: Hy - Python / Lisp interoperability layer

Paul Tagliamonte paultag at debian.org
Sat Apr 6 02:51:38 CEST 2013


Hello, World!

tl;dr
=====

Version:   0.9.4
License:   Expat (sometimes called MIT)
Hilarious: Yes

Hy is a wicked funny hack that lets you interop (in both directions)
with Lisp from Python (or with Python from Lisp).

It's pip installable:

  $ pip install hy
   [...]
  $ hy
  => (print (.join ", " ["Hello" "World"]))
  Hello, World

  (REPL even has cute readline bits mostly workingish, with a few known
   issues)


And the source is on GitHub @ http://git.io/hy (star it, fork it, hack it)


It's undergoing changes quite quickly - so, be careful!


OK, what is it (technically)
============================

Hy is a set of hacks, implemented in Python, to lex and compile a Lisp
variant (called `Hy', which looks very similar to Clojure in some ways)
into Python AST, and transparently load it into sys.modules using a PEP
302 import hook.

I gave a lightning talk about Hy at PyCon, in case anyone's having
flashbacks. You can see that talk on my blog
(http://blog.pault.ag/post/46982895940/), or watch a full hour-long talk
about Hy at Boston Python at http://www.youtube.com/watch?v=ulekCWvDFVI


Right, so that means?
=====================

You can do hilarious (hylarious?) things like write full Django
projects[1] in Lisp, or interop with pymongo[2], or even use pdb
to debug Lisp code[3].


Wait, are you serious?
======================

About it working? Yup!

About making this lisp-variant production quality? Not really.

It's just really funny, and helps teach people about how awesome Python is.


Whatabout Macros?
=================

Yep!(*)

*: but you have to write them in Python for now (code plot'ed) :(

Docs?
=====

Yep! http://hy.rtfd.org/ - could use help!


Hacks welcome!

With lots of love,
  paultag


Special thanks to the current contributors:

  * Thomas Mashek <thomas at thescoundrels.net>
  * Amrut Joshi <amrut.joshi at gmail.com>
  * Christopher Allan Webber <cwebber at dustycloud.org>
  * Will Kahn-Greene <willg at bluesock.org>
  * James King <james at agentultra.com>
  * Julien Danjou <julien at danjou.info>
  * Nicolas Dandrimont <nicolas.dandrimont at crans.org>


[1]: https://github.com/paultag/djlisp
[2]: https://gist.github.com/paultag/5188459
[3]: http://blog.pault.ag/post/45232056896/hilariously-debuggable-lisp-hy


-- 
 .''`.  Paul Tagliamonte <paultag at debian.org>
: :'  : Proud Debian Developer
`. `'`  4096R / 8F04 9AD8 2C92 066C 7352  D28A 7B58 5B30 807C 2A87
 `-     http://people.debian.org/~paultag


More information about the Python-announce-list mailing list