HackToPhp: A proof-of-concept Hack-to-PHP transpiler, written in PHP

This project uses HHVM's builtin parser (hh_parse) and an existing library to turn Hack code into PHP code. It generates PHP-Parser-equivalent nodes for the original Hack AST, then prints the result.

It aims to preserve all of Hack’s types so that the resultant PHP code can be checked by a tool like Psalm, converting any asynchronous code to its synchronous equivalent.

Head on over to GitHub to see all the gritty details.

Who made this? I did.

Why? Because it didn’t exist (though it has an antecedent).

Is it production-ready? Hack no.

Who uses it? Nobody.