Successfully reported this slideshow.
Your SlideShare is downloading. ×

Intro to Hack Language

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 15 Ad

More Related Content

Slideshows for you (20)

Advertisement

Recently uploaded (20)

Advertisement

Intro to Hack Language

  1. 1. Intro to Hack Kyle Ferguson @kylegferg docs.hhvm.com
  2. 2. Hack - Programming language for HHVM - Evolved from PHP
  3. 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. 4. PHP (dynamic) - Rapid development cycle - Easily deployed - Highly available Java/C++ (static) - Disciplined - Scales better Goals for Hack
  5. 5. Introducing Hack
  6. 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. 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
  8. 8. Unpredictable code is DANGEROUS Hack provides a *more* predictable PHP
  9. 9. Migrating
  10. 10. Migrating
  11. 11. Migrating
  12. 12. Migrating
  13. 13. Migrating
  14. 14. Migrating
  15. 15. Tools / Help Documentation docs.hhvm.com Editor plugins: Vim, Emacs Example Site: github.com/hhvm/hack-example-site Dev Environment: github.com/senary/harbor

×