Intro to Hack Language
Upcoming SlideShare
Loading in...5
×
 

Intro to Hack Language

on

  • 1,015 views

What is Hack, why should you care, and how to get started.

What is Hack, why should you care, and how to get started.

Statistics

Views

Total Views
1,015
Views on SlideShare
364
Embed Views
651

Actions

Likes
1
Downloads
2
Comments
1

2 Embeds 651

http://www.scoop.it 599
https://twitter.com 52

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Sorry the code previews are so dark and small, they were much more readable on my machine and exported a little funny.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Intro to Hack Language Intro to Hack Language Presentation Transcript

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