Learn HACK with Real Code Examples
Updated Nov 20, 2025
Installation Setup
Install HHVM on your system
Set up Hack language support
Configure environment paths
Test sample Hack scripts
Integrate with web server for development
Environment Setup
Install HHVM
Configure hhconfig
Install Hack development tools
Set PATH for HHVM binaries
Test sample Hack scripts
Config Files
hhconfig - project typecheck configuration
src/ - main Hack source code
lib/ - reusable libraries
tests/ - unit and integration tests
configs/ - HHVM server configurations
Cli Commands
hh_client - typecheck Hack project
hh_server - start Hack typecheck server
hhvm script.hack - run Hack script
hhvm -web - run Hack web server
hh_client --json - get typecheck results
Internationalization
Supports UTF-8 strings
Works with global databases and APIs
Data formats can handle internationalized content
Compatible with international libraries in PHP
No built-in localization engine; relies on PHP ecosystem
Accessibility
Open-source and cross-platform via HHVM
Documentation available online
Community support through forums and GitHub
Gradual typing eases transition for PHP developers
Works well in large codebases and teams
Ui Styling
Web applications styled with standard HTML/CSS/JS
Hack used for backend logic
Optional templating engines for frontend
Integration with frameworks like HackMVC
No built-in UI styling in language itself
State Management
Variables with optional static types
Collections for structured data
Async functions for managing concurrent state
Shapes for structured object-like data
Modules encapsulate reusable logic
Data Management
Hack collections (vec, dict, keyset)
Typed variables and function arguments
Shapes for structured records
Persistent data via databases or files
Async pipelines for dynamic data handling