Facebook has released an open source code generator for Hack: a spinoff of the PHP programming language. Named Hack Codegen, it enables easy generation of Hack code in addition to writing it into signed files to prevent undesired modifications. It’s an effort to raise the level of abstraction and reduce coupling, and Hack was built to reduce reliance on string concatenation for code generation. The code is available on GitHub.
For more technical information on Hack CodeGen, check out this blog post from facebook.