» www.Giftbox.Az - Bir birindən gözəl hədiyyə satışı
ウィキペディアランダム
毎日カテゴリ
共有: WhatsappFacebookTwitterVK

Hy

Hy(またはHylang)は、式をPythonAST(抽象構文木)へ変換することで、PythonとLisp間でのやり取りができるように設計されたプログラミング言語Lisp方言のひとつである。Hyは(Python Conference)(PyCon)2013でPaul Tagliamonteが発表した[2]

Hy
Hy logo - Cuddles the (cuttlefish)
パラダイム (Multi-paradigm): (procedural), (functional), object-oriented, (meta), (reflective), (generic)
登場時期 2013年 (10年前) (2013)
設計者 Paul Tagliamonte
最新リリース 0.26.0 / 2023年2月8日[1]
評価版リリース 0.17.0 / 2019年5月20日 (3年前) (2019-05-20)
影響を受けた言語 (Lisp), (Kawa), Clojure, Common Lisp
プラットフォーム Cross-platform
ライセンス MIT-style
ウェブサイト hylang.org
拡張子 .hy
関連言語 (Lisp)
(テンプレートを表示)

KawaClojureにおいて、S式Java仮想マシン(JVM)の抽象構文木にマッピングされるのと同様に[3]、Hyは、Pythonの抽象構文に対する透過的なLispフロントエンドとして使用することが想定されている[4]。Lispではコード自体をデータとして操作することが可能である(メタプログラミング)ため、Hyをドメイン固有言語(DSL)として使用することができる[5]。Hyのコードは、コンパイル[note 1]時に両言語のコードをPythonのASTにステップ変換するため、標準ライブラリを含むPythonのライブラリにインポートしたり、ライブラリからHyのコードにアクセスしたりすることが可能である[note 2][6][7][8]

コード例

以下はHy言語のドキュメントからの引用である[9]

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

関連項目

出典

  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, and PyPy.

参考文献

  1. ^ 出典URL: https://github.com/hylang/hy/releases/tag/0.26.0, 閲覧日: 2023年2月15日, 題名: Release 0.26.0, 出版日: 2023年2月8日
  2. ^ Tagliamonte, Paul (2 April 2013). PyCon lightning talk (Speech). (Python Conference) (PyCon). Santa Clara. 2014年9月2日閲覧
  3. ^ Turto, Tuukka (2014年2月14日). “Programming Can Be Fun with Hy”. (Open Source For You). http://www.opensourceforu.com/2014/02/programming-can-fun-hy/ 2014年9月2日閲覧。 
  4. ^ Edge (2014年4月30日). “Getting Hy on Python”. (LWN.net). 2014年9月2日閲覧。
  5. ^ (Speech). |title=は必須です。 ()
  6. ^ “Hy Documentation”. hylang.org. 2014年9月3日閲覧。
  7. ^ Danjou, Julien (26 March 2014). “The AST”. The Hacker's Guide to Python. pp. 165–172. https://books.google.com/books?id=B6nhAwAAQBAJ&pg=PT171 
  8. ^ Kitchin (2016年3月31日). “More on Hy and why I think it is a big deal”. The Kitchin Research Group. (Carnegie Mellon University). 2018年9月19日閲覧。
  9. ^ “Quickstart”. Hylang.org (2018年5月15日). 2018年9月19日閲覧。

外部リンク

  • 公式ウェブサイト
  • hy - GitHub
  • Documentation
  • Video of 2014 PyCon talk
ウィキペディア、ウィキ、本、library、論文、読んだ、ダウンロード、自由、無料ダウンロード、mp3、video、mp4、3gp、 jpg、jpeg、gif、png、画像、音楽、歌、映画、本、ゲーム、ゲーム。