3

Hy

 4 years ago
source link: https://www.tuicool.com/articles/emaAban
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Hy QvUR3eN.png!web

Hy logo - Cuddles thecuttlefish

Paradigm Multi-paradigm : procedural , functional , object-oriented , meta , reflective , generic Family Lisp Designed by Paul Tagliamonte Developers Core team First appeared 2013 ; 6 years ago Preview release

0.17.0 / 20 May 2019 ; 2 months ago

Scope lexical, optionally dynamic

[ citation needed ]

Platform IA-32 , x86-64 OS Cross-platform License MIT-style Filename extensions .hy Website hylang.org Influenced by Lisp , Kawa , Clojure , Common Lisp

Hy (alternately, Hylang ) is aprogramming language, adialect of the languageLisp designed to interact with the languagePython by translating expressions into Python'sabstract syntax tree (AST). Hy was introduced atPython Conference (PyCon) 2013 by Paul Tagliamonte.

Similar toKawa's andClojure's mapping ofs-expressions onto theJava 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 Pythonlibraries, including thestandard library, to be imported and accessed alongside Hy code with acompiling step converting the data structure of both into Python's AST.

Contents

Example code [ edit ]

From the language documentation:

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

See also [ edit ]

Notes [ edit ]

  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 specific Python interpreter used and not Hy.
  2. Hy is tested on Python 2.7, 3.4 through 3.6, andPyPy.

References [ edit ]

  1. Tagliamonte, Paul (2 April 2013). PyCon lightning talk (Speech).Python Conference (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. 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. "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. 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 .
  8. "Quickstart" . Hylang.org . 15 May 2018 . Retrieved 19 September 2018 .

External links [ edit ]

Timeline of Lisp dialects ( edit ) 1955 1960 1965 1970 1975 1980 1985 1990 1995 2000 2005 2010 2015 2019 LISP 1, 1.5, LISP 2 (abandoned) Maclisp Interlisp Lisp Machine Lisp Scheme R5RS R6RS R7RS small NIL Common Lisp Le Lisp T Emacs Lisp AutoLISP OpenLisp PicoLisp EuLisp ISLISP newLISP Racket GNU Guile Visual LISP Qi, QiII Shen Clojure Arc LFE Hy

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK