Overview
Explore Slack's journey of migrating from PHP to Facebook's Hack programming language in this 31-minute conference talk from the International PHP Conference. Discover the surprising, challenging, and beneficial aspects of transitioning a multi-million line PHP codebase. Learn about Hack's features, including static type checking, inferred generics, union types, and type-safe HTML with XHP. Gain insights into the differences between PHP and Hack arrays, type refinement, and the Hack Standard Library. Understand the process of eliminating PHP dependencies and the lessons learned during the migration. Draw inspiration for your own projects as the speaker reflects on the benefits and drawbacks of Hack, offering valuable perspectives for the PHP community.
Syllabus
Intro
Overview
Static Type Checking
Inferred Generics
Inferred Union Types
Two kinds of Arrays
Arrays with Generics
Hack Arrays
Arrays with mixed types
Using Optional Fields
Type Refinement
PHP Standard Library
Composing PHP functions
Hack Standard Library
Hack Pipeline with HSL
Type Checked Regex
XHP: Type safe HTML
Fix with automation
Move code into functions
DB Types: Before
Inferred Return Types
Untyped code
Eliminate PHP Dependencies
HHVM 4.0 Upgrade
Lessons Learned
Taught by
International PHP Conference