Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hack Lang : an Introduction @ FB DevC Malang Meetup 2017

DOT Indonesia
September 23, 2017

Hack Lang : an Introduction @ FB DevC Malang Meetup 2017

A short introduction to Hack programming language and it's HVVM.
Another technology from Facebook.

DOT Indonesia

September 23, 2017
Tweet

More Decks by DOT Indonesia

Other Decks in Programming

Transcript

  1. When you hit facebook.com, or you pull out your phone

    and get a notification, or basically any interaction that you have with Facebook servers, these servers running hack code Julien Verlague –Facebook Engineer
  2. 2 Basic Type of Programming Languages 1. Statically Typed •

    Java, C#, C++, etc • Steps: • Write code • Check the type • Run correctly Gradually Typed • Hack • You can decide to use which method 2. Dynamically Typed • Javascript, Python, PERL, PHP • Steps: • Write code • Run directly • Ups, something wrong..
  3. HHVM : Just In Time Compiler PHP Hack Hip-hop Byte

    Code (HHBC) X86-64 machine code PHP Zend Opcode EXECUTE Compile (JIT) Interprate
  4. Error Messages Something wrong You may need to change this

    code Or this one… Do you remember of Java/C#/C++ ?
  5. Hack Types • Nullable: ?string • Tuples: (int, bool, Object)

    • Closures: (function(int): int) • Generics: A<T>, foo<T> (T $x): T{ } • Constraints: foo<T as A> (T $x) : T • Co/contravariance: interface X<+T1, -T2>