from Hacker News

Try Hy

by proppy on 11/9/13, 12:41 AM with 64 comments

  • by ninetax on 11/9/13, 12:58 AM

    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

  • by paultag on 11/9/13, 3:20 AM

    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!

  • by agentultra on 11/9/13, 1:54 AM

    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...

  • by mkramlich on 11/9/13, 1:14 AM

    A+ for presentation
  • by anaphor on 11/9/13, 1:22 AM

    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).
  • by zaph0d on 11/9/13, 9:24 AM

    Very nice. Surface syntax (and some semantics like interop) seem to be heavily inspired by Clojure :-)
  • by girvo on 11/9/13, 9:17 AM

    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/

  • by dmoney on 11/9/13, 7:35 AM

    To quote Dark Helmet, "What the hell am I looking at?"
  • by vezzy-fnord on 11/9/13, 1:05 AM

    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.
  • by nlake44 on 11/9/13, 2:54 AM

  • by andrelaszlo on 11/9/13, 7:47 PM

    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
        =>
  • by mattholtom on 11/9/13, 4:00 AM

    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.
  • by jackhammons on 11/9/13, 1:23 AM

    Incredible implementation.
  • by petercooper on 11/9/13, 11:19 AM

    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..
  • by hcarvalhoalves on 11/9/13, 2:06 AM

    Excellent. I thought what a LISP on top of the Python runtime would be (like Clojure + JVM), didn't knew this existed already.
  • by a3_nm on 11/9/13, 9:49 AM

    "(defun f x (x))" gives a Python stack trace.
  • by Sunlis on 11/9/13, 4:04 AM

    Finally my knowledge of Scheme comes in handy!
  • by talles on 11/9/13, 3:43 AM

    Love at first sight with the presentation
  • by d0m on 11/9/13, 3:31 AM

    I think this is fucking amazing.
  • by basyt on 11/9/13, 4:22 AM

    effin' finally. now to do some serious lisping!
  • by derp_dogg on 11/9/13, 5:42 AM

    where's cons?
  • by jbeja on 11/9/13, 5:01 AM

    This could be the next big thing.
  • by jbeja on 11/9/13, 3:24 AM

    Is Python really that awesome?
  • by ravestar on 11/9/13, 1:22 AM

    []+1 = [] 1

    []+[] -> error ...