Top Qs
Timeline
Chat
Perspective
Hy (programming language)
Dialect of the Lisp programming language designed to interact with Python From Wikipedia, the free encyclopedia
Remove ads
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]
Remove ads
Example code
From the language documentation:[11]
=> (print "Hy!")
Hy!
=> (defn salutationsnm [name] (print (+ "Hy " name "!")))
=> (salutationsnm "YourName")
Hy YourName!
See also
Notes
References
External links
Wikiwand - on
Seamless Wikipedia browsing. On steroids.
Remove ads
