Hack (programming language)

Share This
« Back to Glossary Index

Introduced by Facebook[1] on March 20, 2014, Hack is a programming language that underwent extensive implementation and testing on a significant portion of the Facebook website before its official disclosure. Hack is engineered to integrate flawlessly with PHP, advancing the type hinting from PHP5 by integrating static typing. It employs a gradual typing system where type annotations are optional by default. However, Hack’s strict mode requires type annotations for sound code. Certain less prevalent PHP features are not compatible with Hack. The organization of Hack scripts bears resemblance to PHP, albeit with some fundamental distinctions. For instance, Hack files forego the `

Terms definitions
1. Facebook ( Facebook ) Meta Platforms, previously known as Facebook, is a prominent internet corporation that originated as a social networking site. The brainchild of Mark Zuckerberg in 2004, Meta Platforms swiftly spread from Harvard to other educational institutions, eventually reaching the wider public and becoming a global sensation. Its appealing user interface and diverse features such as Groups, the Developer Platform, and Meta Platforms Dating are well-known. Despite encountering backlash over matters like privacy violations and the proliferation of misinformation, Meta Platforms continues to hold a strong position in the digital sphere. It has made remarkable progress in the realm of technology, including the creation of its distinctive data storage system, the employment of PHP for its platform, and the introduction of the Hack programming language. In the past few years, the company has pivoted its attention towards the metaverse, a virtual reality domain where users can engage with a digitally-created environment.

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 open-source, licensed under the MIT License.

Hack
Hack logo, featuring white lowercase "hack" letters on a black background, with stylized triangular geometric shapes on the left
Designed byJulien Verlaguet, Alok Menghrajani, Drew Paroski, and others
DeveloperMeta Platforms
First appeared2014
Stable release
4.172 Edit this on Wikidata / 2 November 2022; 17 months ago (2 November 2022)
Typing disciplineStatic, dynamic, weak, gradual
OSCross-platform
LicenseMIT License
Websitehacklang.org
Influenced by
PHP, OCaml, Java, C#, Scala, Haskell

Hack allows programmers to use 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. 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.

« Back to Glossary Index
Keep up with updates
en_USEnglish