Try Hy

  • It's a dialect of LISP that's compiled down to Python AST IICR.

    Here's more information: http://docs.hylang.org/en/latest/tutorial.html

  • Well done! If anyone wants to learn more:

    http://hylang.org/

    http://github.com/hylang

    http://www.youtube.com/watch?v=ulekCWvDFVI

    and a quick 5 minute lightning talk:

    http://youtu.be/1vui-LupKJI?t=16m13s

    (Creator here)

    Hack on!

  • I did a little presentation on Hy at Pycon Canada earlier this year [1].

    Hy has come a ways since then even. Shortly after that talk we added succinct syntax aliases for QUOTE and QUASIQUOTE. And we added a nice clojure-inspired core library.

    It's a cool little language. Fun to hack on. You could learn a few things if you do. And I do hope that we can start help creating documentation for the Python AST module via this project.

    [1] http://pyvideo.org/video/2328/hy-a-lisp-that-compiles-to-pyt...

  • A+ for presentation

  • So it just desugars into Python? I see there is a section in the documentation for macros, but there's nothing there. Does it support AST macros right now? I thought of doing something similar to this except doing some kind of static or gradual typing (that would be a larger project though).

  • Very nice. Surface syntax (and some semantics like interop) seem to be heavily inspired by Clojure :-)

  • Hy is neat. I love Lisps that "compile" or are embedable within host scripting languages.

    My favourite one to hack on (owing to my PHP ability) is Pharen[0]. Very neat little Lisp that compiles down to PHP, which is very fun to play with. I highly suggest giving Hy a go if you're a Pythonista, as you can learn a lot about programming in general by seeing how these sorts of languages map to the host. Very fun to hack on, too!

    [0]: http://scriptor.github.io/pharen/

  • To quote Dark Helmet, "What the hell am I looking at?"

  • Not bad. Could be a very useful tool to teach Python programmers Lisp, although I don't think Python benefits much from converting its syntax to sexprs.

  • Source: https://github.com/hylang/tryhy

  • Apparently without TCO :(

        File "<input>", line 1, in fac
        File "<input>", line 1, in fac
        File "<input>", line 1, in fac
        RuntimeError: maximum recursion depth exceeded
        =>

  • Heh, recognized reverse polish notation right away. One of the companies I interviewed at last year had me program an RPN calculator fed by CSV spreadsheets. Weirdest thing I've made to date by a pretty wide margin.

  • Incredible implementation.

  • What blew my mind is this actually worked on my iPod Touch and brought up the keyboard. Usually "dynamic" JavaScript keyboards or games totally fail on there..

  • Excellent. I thought what a LISP on top of the Python runtime would be (like Clojure + JVM), didn't knew this existed already.

  • "(defun f x (x))" gives a Python stack trace.

  • Finally my knowledge of Scheme comes in handy!

  • Love at first sight with the presentation

  • I think this is fucking amazing.

  • effin' finally. now to do some serious lisping!

  • where's cons?

  • (-40 1) = 40.

    To be honest this is a stupid syntax. Basically it reads 40 - 1 from what I can tell from playing around. Why would you take -40, something that everyone understands as negative forty and make it mean forty minus?

  • This could be the next big thing.

  • Is Python really that awesome?

  • []+1 = [] 1

    []+[] -> error ...