This article relies too much on references to primary sources. (August 2019) (Learn how and when to remove this template message)
Hy logo - Cuddles the cuttlefish
|Paradigm||Multi-paradigm: procedural, functional, object-oriented, meta, reflective, generic|
|Designed by||Paul Tagliamonte|
0.17.0 / 20 May 2019
|Scope||lexical, optionally dynamic|
|Lisp, Kawa, Clojure, Common Lisp|
Hy (alternately, Hylang) is a programming language, a dialect of the language Lisp designed to interact with the language Python by translating expressions into Python's abstract syntax tree (AST). Hy was introduced at Python Conference (PyCon) 2013 by Paul Tagliamonte.
Similar to Kawa's and Clojure's mapping of s-expressions onto the Java virtual machine (JVM), Hy is meant to operate as a transparent Lisp front end to Python's abstract syntax. Lisp allows operating on code as data (metaprogramming). Thus, Hy can be used to write domain-specific languages. Hy also allows Python libraries, including the standard library, to be imported and accessed alongside Hy code with a compiling[note 1] step converting the data structure of both into Python's AST.[note 2]
From the language documentation:
=> (print "Hy!") Hy! => (defn salutationsnm [name] (print (+ "Hy " name "!"))) => (salutationsnm "YourName") Hy YourName!
- "Compiled" is a term which may apply to expressing Hy code in Python's AST or converting that AST into bytecode, the latter being dependent on the specific Python interpreter used and not Hy.
- Hy is tested on Python 2.7, 3.4 through 3.6, and PyPy.
- Tagliamonte, Paul (2 April 2013). PyCon lightning talk (Speech). Python Conference (PyCon). Santa Clara. Retrieved 2 September 2014.
- Turto, Tuukka (14 February 2014). "Programming Can Be Fun with Hy". Open Source For You. Retrieved 2 September 2014.
- Edge, Jake (30 April 2014). "Getting Hy on Python". LWN.net. Retrieved 2 September 2014.
- Tagliamonte, Paul (11 April 2014). Getting Hy on Python: How to implement a Lisp front-end to Python (Speech). PyCon. Montreal. Retrieved 2 September 2014.
- "Hy Documentation". hylang.org. Retrieved 3 September 2014.
- Danjou, Julien (26 March 2014). "The AST". The Hacker's Guide to Python. pp. 165–172.
- Kitchin, John (31 March 2016). "More on Hy and why I think it is a big deal". The Kitchin Research Group. Carnegie Mellon University. Retrieved 19 September 2018.
- "Quickstart". Hylang.org. 15 May 2018. Retrieved 19 September 2018.
|LISP 1, 1.5, LISP 2(abandoned)|
|Lisp Machine Lisp|