Hack Documentation

Learn

  • Getting Started

    Some simple steps to install Hack, writing and running your first program, and some information about Hack-related tools.
  • Source Code Fundamentals

    The basic source-code elements, program structure, name scope, scripts and script inclusion, and namespaces.
  • Expressions And Operators

    Full expressions, side-effects, precedence and associativity, order-of-evaluation, and all the operators.
  • Statements

    Compound statements, labeled statements, expression statements, selection statements, iteration statements, jump statements, and other statements.
  • Functions

    Defining and calling functions and methods, and anonymous functions (writing closures and lambdas).
  • Classes

    Defining basic classes, member visiblity, implementing interfaces, inheritance, and using traits.
  • Types

    An introduction to basic features of the type checker.
  • Built In Types

    Built-in types known to the type checker.
  • Generics

    Generic types and functions, type parameters, type constraints, type arguments, and variance.
  • Asynchronous Operations

    How async programming lets apps scale better and reduces blocking.
  • Attributes

    Declarative information that can be attached to various program entities, and retrieved at run-time via reflection.
  • XHP

    A reusable and customizable UI system that automatically handles escaping and XSS protection.

Built-in API Reference

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

Standard Library API Reference

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