Hack and HHVM
O'Reilly Media (Verlag)
978-1-4919-2087-9 (ISBN)
You’ll explore static typechecking and several other features that separate Hack from its PHP origins, and learn how to set up, configure, deploy, and monitor HHVM. Ideal for developers with basic PHP knowledge or experience with other languages, this book also demonstrates how these tools can be used with existing PHP codebases and new projects alike.
- Learn how Hack provides static typechecking while retaining PHP’s flexible, rapid development capability
- Write typesafe code with Hack’s generics feature
- Explore HHVM, a just-in-time compilation runtime engine with full PHP compatibility
- Dive into Hack collections, asynchronous functions, and the XHP extension for PHP
- Understand Hack’s design rationale, including why it omits some PHP features
- Use Hack for multitasking, and for generating HTML securely
- Learn tools for working with Hack code, including PHP-to-Hack migration
Owen Yamauchi is a software engineer at Facebook where he works on the HHVM team. Before joining Facebook in 2009, he interned VMware and Apple. Owen grew up in Belgium and earned his BS in Computer Science at Carnegie Mellon
Chapter 1Typechecking
Why Use the Typechecker?
Setting Up the Typechecker
Type Annotation Syntax
Hack’s Type System
Rules
Type Inference
Refining Types
Enforcement of Type Annotations at Runtime
Chapter 2Generics
Introductory Example
Other Generic Entities
Type Erasure
Constraints
Unresolved Types, Revisited
Generics and Subtypes
Advanced: Covariance and Contravariance
Chapter 3Other Features of Hack
Enums
Type Aliases
Array Shapes
Lambda Expressions
Constructor Parameter Promotion
Attributes
Enhanced Autoloading
Integer Arithmetic Overflow
Nullsafe Method Call Operator
Trait and Interface Requirements
Silencing Typechecker Errors
Chapter 4PHP Features Not Supported in Hack
References
Old-Style Constructors
Case-Insensitive Name Lookup
Variable Variables
Dynamic Properties
Mixing Method Call Syntax
isset, empty, and unset
Others
Chapter 5Collections
Why Use Collections?
Collections Have Reference Semantics
Using Collections
Type Annotations for Collections
Interoperating with Arrays
Chapter 6Async
Introductory Examples
Async in Detail
Structuring Async Code
Other Types of Waiting
Common Mistakes
Async Extensions
Chapter 7XHP
Why Use XHP?
How to Use XHP
Creating Your Own XHP Classes
XHP Best Practices
Migrating to XHP
XHP Internals
Chapter 8Configuring and Deploying HHVM
Specifying Configuration Options
Server Mode
Warming Up the JIT
Repo-Authoritative Mode
The Admin Server
Chapter 9hphpd: Interactive Debugging
Getting Started
Evaluating Code
The Execution Environment
Using Breakpoints
Viewing Code and Documentation
Macros
Configuring hphpd
Chapter 10Hack Tools
Inspecting the Codebase
Migrating PHP to Hack
Transpiling Hack to PHP
Erscheint lt. Verlag | 20.10.2015 |
---|---|
Zusatzinfo | black & white illustrations |
Verlagsort | Sebastopol |
Sprache | englisch |
Maße | 177 x 232 mm |
Gewicht | 470 g |
Einbandart | kartoniert |
Themenwelt | Mathematik / Informatik ► Informatik ► Datenbanken |
Informatik ► Programmiersprachen / -werkzeuge ► C / C++ | |
Mathematik / Informatik ► Informatik ► Theorie / Studium | |
Informatik ► Web / Internet ► PHP | |
Schlagworte | C/C++-Programmierung • Facebook • hack • Hiphop • PHP |
ISBN-10 | 1-4919-2087-4 / 1491920874 |
ISBN-13 | 978-1-4919-2087-9 / 9781491920879 |
Zustand | Neuware |
Haben Sie eine Frage zum Produkt? |
aus dem Bereich