Hy You Voted Labour
   HOME

TheInfoList



OR:

Hy is a dialect of the
Lisp A lisp is a speech impairment in which a person misarticulates sibilants (, , , , , , , ). These misarticulations often result in unclear speech. Types * A frontal lisp occurs when the tongue is placed anterior to the target. Interdental lisping ...
programming language designed to interact with Python by translating s-expressions into Python's abstract syntax tree (AST). Hy was introduced at Python Conference (PyCon) 2013 by Paul Tagliamonte. Lisp allows operating on code as data ( metaprogramming), thus Hy can be used to write
domain-specific language A domain-specific language (DSL) is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains. There are a wide variety of DSLs, ranging f ...
s. Similar to Kawa's and Clojure's mappings onto the
Java virtual machine A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describes ...
(JVM), Hy is meant to operate as a transparent Lisp front-end for Python. It allows Python libraries, including the
standard library In computer programming, a standard library is the library made available across implementations of a programming language. These libraries are conventionally described in programming language specifications; however, contents of a language's as ...
, to be imported and accessed alongside Hy code with a compilingThe 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. step where both languages are converted into Python's AST.Hy is tested on Python 2.7, 3.4 through 3.6, and PyPy.


Example code

From the language documentation: => (print "Hy!") Hy! => (defn salutationsnm ame(print (+ "Hy " name "!"))) => (salutationsnm "YourName") Hy YourName!


See also

*
Common Lisp Common Lisp (CL) is a dialect of the Lisp programming language, published in ANSI standard document ''ANSI INCITS 226-1994 (S20018)'' (formerly ''X3.226-1994 (R1999)''). The Common Lisp HyperSpec, a hyperlinked HTML version, has been derived fro ...
* Clojure * Kawa (Scheme implementation) *
CLPython CLPython is an implementation of the Python programming language written in Common Lisp. This project allow to call Lisp functions from Python and Python functions from Lisp. Licensed under LGPL. CLPython was started in 2006, but as of 2013, it ...


Notes


References


External links

* *
Documentation

Video of 2014 PyCon talk
{{Lisp programming language Lisp (programming language) Cross-platform free software Lisp programming language family Programming languages created in 2013