3. Benefits
- Created by Facebook, open source
- If you know PHP, you know Hack
- Easy to adopt (even w/ existing code base)
- Language additions (generics, collections, etc.)
4. PHP (dynamic)
- Rapid development cycle
- Easily deployed
- Highly available
Java/C++ (static)
- Disciplined
- Scales better
Goals for Hack
6. What gets “typed”
Members
Parameters
Returns
Types
Primitive: string, int, bool, array
Nullable: ?string, ?FooInterface
Classes: Validator, FooInterface
Other: mixed, void, this
Also see: closures, collections,
generics, constraints
Tuples: (string, int)
7. Modes
Partial (default)!
!
- Nothing is *required* to have types defined
- Allows for incremental adoption
Strict!
!
- EVERYTHING must be typed
Decl!
!
- Allows “Strict” code to work with legacy code
- Always avoid this mode if possible