Hack (programming language)

Hack
ParadigmsMulti-paradigm: imperative, functional, object-oriented, procedural, reflective
FamilyPHP
Designed byJulien Verlaguet, Alok Menghrajani, Drew Paroski, others
DeveloperMeta Platforms
First appeared2014 (2014)
Stable release
4.172  / 2 November 2022 (2 November 2022)
Typing disciplineStatic, dynamic, weak, gradual
OSCross-platform
LicenseMIT
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.

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. 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.