Hack (programming language)

Hack
Hack logo, featuring white lowercase "hack" letters on a black background, with stylized triangular geometric shapes on the left
ParadigmsMulti-paradigm: imperative, functional, object-oriented, procedural, reflective
FamilyPHP
Designed byJulien Verlaguet, Alok Menghrajani, Drew Paroski, others[1]
DeveloperMeta Platforms
First appeared2014; 10 years ago (2014)
Stable release
4.172 Edit this on Wikidata / 2 November 2022; 2 years ago (2 November 2022)
Typing disciplineStatic, dynamic, weak, gradual
OSCross-platform
LicenseMIT[2]
Websitehacklang.org
Influenced by
PHP, OCaml, Java, C#, Scala, Haskell

Hack is a programming language for the HipHop Virtual Machine (HHVM), created by Meta (formerly Facebook) as a dialect of PHP. The language implementation is free and open-source software, licensed under an MIT License.[2][3][4]

Hack allows use of both dynamic typing and static typing. This kind of a type system is called gradual typing, which is also implemented in other programming languages such as ActionScript.[5] Hack's type system allows types to be specified for function arguments, function return values, and class properties; however, types of local variables are always inferred and cannot be specified.[3][6]

  1. ^ O'Sullivan, Bryan (2014-03-28). "Where Credit Belongs for Hack". Archived from the original on 2021-03-01. Retrieved 2019-02-06.
  2. ^ a b "facebook/hhvm: hhvm, hphp, hack, License". GitHub.com. Meta Platforms. 2018-04-11. Archived from the original on 2019-01-07. Retrieved 2019-02-06.
  3. ^ a b Lockhart, Josh (2014-04-03). "Facebook's Hack, HHVM, and the future of PHP". O'Reilly Media. Archived from the original on 2019-01-07. Retrieved 2019-02-06.
  4. ^ Cade Metz (2014-03-20). "Facebook Introduces 'Hack,' the Programming Language of the Future". Wired. Archived from the original on 2014-03-28. Retrieved 2019-02-06.
  5. ^ Aseem Rastogi; Avik Chaudhuri; Basil Hosmer (January 2012). "The Ins and Outs of Gradual Type Inference" (PDF). Association for Computing Machinery (ACM). Archived (PDF) from the original on 2017-08-12. Retrieved 2019-02-06.
  6. ^ "Hack Manual: Hack and HHVM – Type Annotations". docs.hhvm.com. Archived from the original on 2018-08-02. Retrieved 2019-02-06.