Hy (programming language)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Intgr (talk | contribs) at 17:07, 29 October 2017 (Replace externals link with wikilinks). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Hy
Cuddles the cuttlefish
ParadigmMulti-paradigm: procedural, functional, object-oriented, meta, reflective, generic
FamilyLisp
Designed byPaul Tagliamonte
First appeared2013
Preview release
0.13.0 - Jun 20, 2017
Scopelexical, optionally dynamic[citation needed]
OSCross-platform
Filename extensions.hy
Websitehylang.org

Hy (alternately, Hylang) is a dialect of the Lisp programming language designed to interact with Python by translating expressions into Python's abstract syntax tree (AST). Hy was introduced at PyCon 2013 by Paul Tagliamonte.[1]

Similar to Clojure's and Kawa's mapping of s-expressions onto the JVM,[2] Hy is meant to operate as a transparent Lisp front end to Python's abstract syntax.[3] Because Lisp allows operating on code as data, Hy can be used to write domain-specific languages.[4] Hy also allows Python libraries (including the standard library) to be imported and accessed alongside Hy code with a compilation[note 1] step converting the data structure of both into Python's AST.[note 2][5][6]

Example code

From the language documentation:[7]

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

See also

Notes

  1. ^ "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 particular Python interpreter used and not Hy.
  2. ^ Hy is tested on Python 2.7, 3.3 through 3.6, and PyPy.

References

  1. ^ Paul Tagliamonte (2 April 2013). PyCon lightning talk (Speech). PyCon. Santa Clara. Retrieved 2 September 2014.
  2. ^ Turto, Tuukka (14 February 2014). "Programming Can Be Fun with Hy". Open Source For You. Retrieved 2 September 2014.
  3. ^ Edge, Jake (30 April 2014). "Getting Hy on Python". LWN.net. Retrieved 2 September 2014.
  4. ^ Paul Tagliamonte (11 April 2014). Getting Hy on Python: How to implement a Lisp front-end to Python (Speech). PyCon. Montreal. Retrieved 2 September 2014.
  5. ^ "Hy Documentation". hylang.org. Retrieved 3 September 2014.
  6. ^ Danjou, Julien (26 March 2014). "The AST". The Hacker's Guide to Python. pp. 165–172.
  7. ^ http://docs.hylang.org/en/latest/quickstart.html

External links

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