Hy (programming language)

From Wikipedia, the free encyclopedia

Template:Short description

Page Module:Infobox/styles.css has no content.

Hy
Lua error in package.lua at line 80: module 'Module:InfoboxImage/data' not found.
Hy logo – Cuddles the cuttlefish
ParadigmMulti-paradigm: procedural, functional, object-oriented, meta, reflective, generic
FamilyLisp
Designed byPaul Tagliamonte
DevelopersCore team
First appeared2013; 13 years ago (2013)
Template:Infobox software/simple
Typing disciplinedynamic, strong
Scopelexical, optionally dynamic[citation needed]
PlatformIA-32, x86-64
OScross-platform
LicenseMIT-style
Filename extensions.hy
Websitehylang.org
Influenced by
Kawa, Clojure, Common Lisp

Hy is a dialect of the Lisp programming language designed to interact with Python by translating s-expressions into Python's abstract syntax tree (AST).[1][2] Hy was introduced at Python Conference (PyCon) 2013 by Paul Tagliamonte.[3] Lisp allows operating on code as data (metaprogramming), thus Hy can be used to write domain-specific languages.[4]

Similar to Kawa's and Clojure's mappings onto the Java virtual machine (JVM),[5][6] Hy is meant to operate as a transparent Lisp front-end for Python.[7] It allows Python libraries, including the standard library, to be imported and accessed alongside Hy code with a compiling[note 1] step where both languages are converted into Python's AST.[note 2][8][9][10]

Example code

From the language documentation:[11]

=> (print "Hy!")
Hy!
=> (defn salutationsnm [name] (print (+ "Hy " name "!")))
=> (salutationsnm "YourName")
Hy YourName!

See also

Notes

  1. ^ The term "compiled" 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.
  2. ^ Hy is tested on Python 2.7, 3.4 through 3.6, and PyPy.

References

Page Template:Reflist/styles.css has no content.

  1. ^ Page Module:Citation/CS1/styles.css has no content.Jaworski, Michał; Ziadé, Tarek (2019). Expert Python programming (Third ed.). Birmingham, U.K.: Packt Publishing. p. 173. ISBN 978-1-78980-677-9. OCLC 1125343555.
  2. ^ Page Module:Citation/CS1/styles.css has no content.Danjou, Julien (2018). Serious Python: black-belt advice on deployment, scalability, testing, and more. San Francisco, CA: No Starch Press. pp. 145–149. ISBN 9781593278793. OCLC 1057729260.
  3. ^ Page Module:Citation/CS1/styles.css has no content.Tagliamonte, Paul (2 April 2013). PyCon lightning talk (Speech). Python Conference (PyCon). Santa Clara. Retrieved 2 September 2014.
  4. ^ Page Module:Citation/CS1/styles.css has no content.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.
  5. ^ Page Module:Citation/CS1/styles.css has no content.Turto, Tuukka (14 February 2014). "Programming Can Be Fun with Hy". Open Source For You. Retrieved 2 September 2014.
  6. ^ Page Module:Citation/CS1/styles.css has no content.Watson, Mark (2020). A Lisp Programmer Living in Python-Land: The Hy Programming Language (PDF). LeanBooks.
  7. ^ Page Module:Citation/CS1/styles.css has no content.Edge, Jake (30 April 2014). "Getting Hy on Python". LWN.net. Retrieved 2 September 2014.
  8. ^ Page Module:Citation/CS1/styles.css has no content."Hy Documentation". hylang.org. Retrieved 3 September 2014.
  9. ^ Page Module:Citation/CS1/styles.css has no content.Danjou, Julien (26 March 2014). "The AST". The Hacker's Guide to Python. pp. 165–172.
  10. ^ Page Module:Citation/CS1/styles.css has no content.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.
  11. ^ Page Module:Citation/CS1/styles.css has no content."Quickstart". Hylang.org. 15 May 2018. Retrieved 19 September 2018.
Page Template:Navbar-header/styles.css has no content.
1958 1960 1965 1970 1975 1980 1985 1990 1995 2000 2005 2010 2015 2020
 LISP 1, 1.5, LISP 2(abandoned)
 Maclisp
 Interlisp
 MDL
 Lisp Machine Lisp
 Scheme  R5RS  R6RS  R7RS small
 NIL
 ZIL (Zork Implementation Language)
 Franz Lisp
 muLisp
 Common Lisp  ANSI standard
 Le Lisp
 MIT Scheme
 XLISP
 T
 Chez Scheme
 Emacs Lisp
 AutoLISP
 PicoLisp
 Gambit
 EuLisp
 ISLISP
 OpenLisp
 PLT Scheme  Racket
 newLISP
 GNU Guile
 Visual LISP
 Clojure
 Arc
 LFE
 Hy

Template:Lisp programming language