Hack Developer Day Recap

Visit the post for more.

Joel Pobar
5 min readintermediate
--
View Original

Overview

The article recaps Facebook's Hack Developer Day, where the company introduced Hack, a gradually-typed programming language for HHVM that interoperates with PHP. The event featured presentations from the Hack and HHVM teams, discussions on converting PHP code to Hack, and insights into the performance and open-source status of HHVM.

What You'll Learn

1

How to convert your PHP code to Hack using available tools

2

Why Hack serves as a bridge between dynamic and statically-typed programming languages

3

How to utilize Heroku for deploying HHVM and Hack applications

4

When to use the Hack type checker for code correctness

Prerequisites & Requirements

  • Basic understanding of PHP programming
  • Familiarity with HHVM and its ecosystem(optional)

Key Questions Answered

What is Hack and how does it relate to PHP?
Hack is a gradually-typed programming language developed by Facebook that interoperates seamlessly with PHP. It aims to provide code correctness while maintaining a fast feedback loop, making it a bridge between dynamic and statically-typed programming paradigms.
What tools are available for converting PHP code to Hack?
The article discusses tools like the Hackificator, which converts PHP code to Hack syntax, and commands like hh_server —convert and remove_soft_types —harden that help in annotating and finalizing the conversion process.
How does Heroku support HHVM and Hack?
Heroku offers a custom build pack that provides out-of-the-box support for HHVM and Hack, making it one of the first hosting providers to do so. This enables developers to deploy their Hack applications easily on the Heroku platform.
What are the key features of Hack's language and libraries?
Hack includes features such as Collections, lambdas, and async/await, which enhance its functionality. Presentations during the event highlighted these features, showcasing their practical applications in development.

Key Statistics & Figures

Number of developers attending Hack Developer Day
150
This number reflects the in-person attendance at the event, indicating strong interest in Hack and HHVM.
Number of viewers for the live stream
2,000
This statistic shows the extensive reach of the event beyond those who attended in person.
Percentage of top PHP frameworks passing unit tests on HHVM
100%
18 of the top 33 open source PHP frameworks have a 100% unit test pass rate on HHVM, showcasing its compatibility.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Programming Language
Hack
A gradually-typed programming language developed by Facebook for use with HHVM.
Runtime
Hhvm
A virtual machine designed for executing programs written in Hack and PHP.
Cloud Platform
Heroku
A platform-as-a-service that supports deploying applications built with HHVM and Hack.

Key Actionable Insights

1
Developers should explore the Hackificator tool to streamline the conversion of existing PHP code to Hack. This tool automates the initial conversion process, saving time and effort.
Using the Hackificator can significantly increase productivity during the transition from PHP to Hack, especially for teams with large codebases.
2
Utilizing Heroku for deploying Hack applications can simplify the hosting process. With built-in support for HHVM, developers can focus more on coding rather than server management.
Heroku's custom build pack for HHVM allows developers to quickly set up and deploy their applications, making it an attractive option for Hack developers.
3
Engaging with the Hack community can provide valuable feedback and insights into best practices. Participating in forums and events can help developers stay updated on the latest developments.
Community involvement fosters collaboration and knowledge sharing, which can enhance the overall development experience with Hack and HHVM.

Common Pitfalls

1
One common pitfall when transitioning from PHP to Hack is underestimating the manual steps required during the conversion process.
While tools like the Hackificator can automate parts of the conversion, developers may still need to manually adjust code to ensure full compatibility and correctness.