Skip to main content

Hack Documentation

Getting Started​

Getting Started​

Installing Hack, running your first program, and introducing the tools.

Expressions & Operators​

Expressions, operators, associativity, and precedence.

Contexts & Capabilities​

Specifying capabilities and permissions for functions.

Packages​

Organize files into separate builds and deployments.

Silencing Errors​

HH_FIXME best practices and error codes.

Source Code Fundamentals​

Basic syntax, namespaces, and the autoloader.

Arrays & Collections​

Immutable collections, mutable collections, and APIs.

Modules​

Language support for organizing code.

XHP​

Safe, composable HTML templating.

Contributing​

How to contribute to this website.

Control Flow​

Statements​

Simple statements, blocks, and loops.

Readonly​

Specialized feature for performantly controlling object mutability.

Asynchronous Operations​

Asynchronous functions, await, and the concurrent keyword.

Classes, Interfaces, Traits​

Functions​

Named functions, anonymous functions and parameters.

Traits & Interfaces​

Mechanisms for code reuse and code constraint within classes.

Classes​

Classes provide a way to group functionality and state together.

Attributes​

Attaching metadata to Hack programs, built-in attributes and defining your own.

Types & Generics​

Types​

The type checker.

Generics​

Generic types, where constraints, and variance.

Built-In Types​

Built-in types known to the type checker.

Reified Generics​

Generics with type information accessible at runtime.

Experimental Additions​

Experimental Features​

Enable features in the experimental phase.

Memoization Options​

Control use of memoization and the Implicit Context

Expression Trees​

Typechecker support for domain specific languages.

API References​

Built-In APIs​

Full reference docs for all functions, classes, interfaces, and traits in the Hack language.

Standard Library​

Full reference docs for all functions, classes, interfaces, and traits in the Hack Standard Library.