A Tour of New Language and Library Features
summary
Overview of concrete Hack features and what they actually do: Lambda Expressions give shorter arrow syntax with automatic capture and produce the same runtime closure objects as PHP so they interoperate; Collections API supplies Vector/Map/Set with generics, mutable and immutable variants, left-to-right chaining, and runtime key checks that throw instead of producing PHP notices; async/await yields awaitable joinable IO so independent DB/mcache/Thrift calls run in parallel; constructor argument promotion reduces boilerplate. Vim plugin demo shows editor autocomplete and the typechecker catches missing returns.
AI-written summary · about
chapters (25)
- 0:00Intro
- 2:50Type Annotations at Run Time
- 4:20PHP Closure Expressions
- 4:52Hack Lambda Expressions
- 5:26Benefits of Lambda Expressions
- 6:17More Examples
- 7:42Hack Collections
- 8:33map/filter example
- 14:32Design
- 16:42array_merge() example
- 17:32Downsides of one-size-fits-all
- 18:43Static Typing
- 20:56PHP arrays have value-type semantics
- 23:10Immutable Collections
- 31:13Code example: Sync = Async
- 31:57Awaitable
- 32:38Parallel async/await
- 34:07Mid-execution
- 36:15Entering async
- 37:56Goodies!: Constructor Promotion
- 39:34Goodies!: Trailing Commas
- 41:38Detecting Errors in Traits
- 44:48Trait requirements: solution
- 48:41Goodies!: Trait Interfaces
- 55:29Future Directions
related talks
52mVoodoo PHP
01h 11mTransforming PHP
37mMultilingualism makes better programmers - beyond PHP and JavaScript
55mFantastic functions and where to find them
37mLet's Program Like It's 1999
44mHeresy! Combining Type Systems with PHP
31mPHP to Hack, an incrementally typed Adventure at Slack
43mFrom PHP to Hack as a Stack and Back
