|All reviews||Hack and HHVM||Latest reviews||Best sellers ranking|
Hack and HHVM
September 28, 2015
Week: Not ranked All time: 402
Jose GomezHack and HHVM is a book describes a type checking language developed by Facebook, named Hack.
The Hack language is based on PHP and a Just in time compiler for both PHP and Hack implemented by HHVM - HipHop Virtual Machine.
The target readers of this book are developers that have a good PHP knowledge, specially based on Object Oriented Programming using PHP and developers know how PHP internally works.
This book describes in depth all the Hack features compared to PHP and how HHVM can be installed and used and the improvements you can get with it.
The book is divided in three sections. Each section is divided into chapters. Their contents increase in complexity going from the more basic concepts to the more advanced topics from chapter to chapter in a section.
The first part (Chapters 1 to 7) describes Hack features and topics from the basics to the more advanced, comparing them with PHP.
Chapter 1 is an introduction to Hack and why it can be used for Web development on the server side, and the benefits of using it over PHP.
Chapter 2 describes what is a type checker, how Hack works, the annotation syntax, type system, their rules, interfaces and types refining. Installation and setting up is described here as well.
Chapter 3 covers the generic entities such functions, methods, traits, interfaces, how to create type aliases, constraints, how to Hack deals with unresolved types, create sub-types and as example how arrays are implemented as collections and the benefits of this implementation.
Chapter 4 describes other features that are currently not present in PHP like enums and functions to manipulate them, type aliasing in more depth, transparent and opaque aliases, shapes, the way parameters are promoted to member attributes in a constructor, attributes, how Hack deals with integer overflow opposite to the way PHP deals with it, null-safe methods, requirements for using traits and intefaces and how to silent specific type-checking errors.
Chapter 5 covers PHP features that are not present in Hack and the reason they are not present like references, old style constructors, case insensitive lookup, variable variables, dynamic properties, ways of PHP call static methods are not supported in Hack, isset, empty and unset statements are not supported in Hack and the goto statement.
Most of them are not supported because the type checker can not know in advance the resulting types without code execution, and other reasons related with performance.
Chapter 6 describes a reason for using collections, the way they should be used, and how to inter-operate with arrays.
Chapter 7 introduces an important concept the use of asynchronous operations in order to execute several tasks at the same time and the dependency of tasks.
Keep in mind asynchronous operations are not the same as threads. Important topics are covered like the way to structure the asynchronous code, common mistakes developers make and the asynchronous extensions are present in Hack.
The second part (Chapter 8) covers XHP, a Hack and PHP feature to develop user interfaces, generating embedded HTML code, how to create new XHP classes, migrate existing developments to XHP, and the internals of XHP.
The third part (Chapters 9 and 10) is a very good introduction to the HHVM just in time compiler, it can be used to generate Hack and PHP byte code.
Chapter 9 describes how configure HHVM and the way it can be use as command-line or in server mode and how to set up nginx web server to use HHVM. It also covers how to perform administrative tasks remotely, the way HHVM works internally and the way the byte code can be generated.
Chapter 10 explains how to do interactive debugging, the way code can be evaluated, how to debug specific scripts or a working project, how to use breakpoints, view code and define macros to perform a set of debugging task several times.
It is good theoretic book to explain the features introduced by Hack and XHP, the way execution of PHP and Hack projects can be made faster up using HHVM, and the way the code can be debugged using an interactive debugger.
I missed an example of a project development with Hack. Several examples are used and explain the concepts but a sample project could be convenient to introduce all the concepts in a more practical way.
The Hack and HHVM is a book describes a type checking language created by Facebook, named Hack, that is based on PHP and a just in time compiler for both PHP and Hack.
This book describes in depth all the Hack features comparing with PHP and how HHVM can be installed and used and the improvements you can get with it.
It explains all the theory about all the concepts introduced by Hack and the way it works compared with PHP, so a good PHP knowledge is required to follow this book and how it works internally to understand all the benefits introduced by Hack over PHP.
No comments were submitted yet.