top | item 7214400

Hy, a Lisp that compiles to Python

115 points| cabalamat | 12 years ago |github.com | reply

60 comments

order
[+] antimora|12 years ago|reply
This terminal cracked me up: http://try-hy.appspot.com/
[+] bcambel|12 years ago|reply
thanks for the share. It's hilarious!
[+] elwell|12 years ago|reply
Looks bad in windows chrome though. this looks better to me:

  #hy-console {
      margin-top: 191px;
      margin-left: 223px;
      -webkit-transform: rotateX(-20deg) rotateY(5deg) rotateZ(5deg) skewX(4deg);
      transform: rotateX(-20deg) rotateY(5deg) rotateZ(5deg) skewX(4deg); 
  }
[+] paultag|12 years ago|reply
Language author here :)

if anyone wants to learn more, we have a pretty sweet team over in #hy on freenode, and have some MLs and stuff sprinkled around.

[+] zem|12 years ago|reply
i'll ask you the same questions i asked the parenjs author, and which i think are pretty much faqs if you're developing a language-hosted lisp dialect. (some of them, like the interop ones, are answered in the hy docs, but it would be nice to have a quick up-front list for reference).

* lisp-1 or lisp-2?

* scoping rules?

* 1-way or 2-way python interop?

* lisp support for python objects?

* any support for tco or loop/recur?

* reader macros?

* speed penalty relative to native python?

[+] TacticalCoder|12 years ago|reply
In a way Hy seems to be to Python what Clojure is to Java / JavaScript. Did Clojure influence you and if so, how?

Congrats and nice looking terminal : )

[+] lloeki|12 years ago|reply
Either I have (good or bad?) luck or I've got some zeitgeist hunch or something, but first I had a convincing WIP of implementing Ruby in RPython when Topaz went out, and now while I'm working on a Lisp[0] — again in RPython — comes Hy.

Well at least Hy is markedly different, as my goal is not to compile to Python AST/bytecode, but "merely" be implemented in (R)Python (and C for LLVM) with no access to the Python runtime.

[0]: https://github.com/lloeki/wasp

[+] bcambel|12 years ago|reply
Great movement from the community to show some love to FP. I really like Clojure, and will give Hy a try as well. FP really forces you to write better code and somehow your thinking starts to change slowly. What I realised is that after I started to write Clojure, I am writing much more functions in Python as well. If you haven't tried yet, give FP some chance.
[+] Foxboron|12 years ago|reply
I just want to note that Lisp does not really imply functional programming. Hy is nothing more then Python with Lisp syntax and the awesomesauce that comes from Lisp as macros and reader macros.
[+] anaphor|12 years ago|reply
This doesn't make Python any more functional, all it does is change the syntax.
[+] stcredzero|12 years ago|reply
How about "HAI" -- a Lisp that compiles to Lolcode?
[+] Pirate-of-SV|12 years ago|reply
Most of the programming language Y to language Z requires the user to know more Z than Y. Kind of losing the point there.

Everything's not only about making points, but still...

[+] prodigal_erik|12 years ago|reply
For a Lisp fan, merely learning another language is fine. It's the need to actually use that other language day to day that creates a lot of obvious wasted repetitive effort and friction. Without macros, much of what the software industry produces is essentially macro expansions done by hand (sometimes called "plumbing" or "infrastructure").
[+] Foxboron|12 years ago|reply
Hy was originally a project to show "Hey, see how awesome Python & AST is!". Lisp being an easy choice to implement. Just awesome it have turned into something actually use able and fun to code with.
[+] unknown|12 years ago|reply

[deleted]

[+] Crito|12 years ago|reply
Give me a fucking break, neutering language because somebody somewhere might hypothetically be emotionally damaged by reading it is something that we can save for marketers writing bone-dry press releases. If you don't like that word, then you don't have to say it. Pestering other people for saying it is a joke.

Why don't you go submit pull requests to every single fucking project using the WTFPL license while you are at it?

[+] razzmataz|12 years ago|reply
Ages ago, there used to be a python-lisp hybrid called e7. I wonder if that provided any inspiration.
[+] jimmcslim|12 years ago|reply
Has there been any work done on Light Table integration?
[+] Foxboron|12 years ago|reply
I have been trying to pull-off a nREPL for hy. But haven't really come close yet. Going to try and do some more work on that front in the near future.
[+] mikaelj|12 years ago|reply
Why the non-tsandard names of everything? And... CLOS?
[+] klibertp|12 years ago|reply
What is the standard you're talking about? Common Lisp? Scheme? Clojure? Emacs Lisp?

Hy looks like it borrows heavily from Clojure, which borrows from Common Lisp in terms of names, but they are both different languages and so they differ. About the only objectionable name I found in Hy is `assoc`, which I'd expect to return the value with given key and not set it.

And CLOS is quite a good object system, actually. I somehow missed how it's implemented in Hy, but multiple dispatch would be cute in Python.

[+] unknown|12 years ago|reply

[deleted]

[+] unknown|12 years ago|reply

[deleted]

[+] hk__2|12 years ago|reply
Can someone explain for non-native English speakers what’s the problem with “goddamn”?