Enduring with more and more open source projects, Facebook has recently open-sourced Hack Codegen, a library for automatically generating Hack code.
As we all know that hack is Facebook’s sequel of the PHP language that works with the HHVM virtual machine. In the meantime, the library generates code, which is written into marked files to avoid undesired modifications.
Facebook said on its GitHub page for Hack Codegen, "The idea behind writing code that writes code is to raise the level of abstraction and reduce coupling,"
"Being able to generate code through automated code generation allows programmers to increase the level of abstraction by making frameworks that are declarative and that are translated into high-quality Hack code," said Facebook software engineer Alejandro Marcu, in a blog post. "We've been using Hack Codegen at Facebook for a while. After seeing so much internal success, we open-sourced this library so that more people could take advantage of it."
Earlier to developing Hack CodeGen, Facebook mainly focused on generated code through concatenating cords and a helper functions. Marcu said, "We realized early on that we would need a good library to generate code, since concatenating strings to generate code don't really scale.” He also added, "At the time, we didn't do that much code generation at FB, mostly dumping values into arrays, so we didn't have any good tools except for signing files."
In the meantime, Facebook’s Parse group has planned to make its SDKs obtainable through open source. If you want to get more information about Hack Codegen, you can find it on Facebook’s GitHub project page.
However, you can get assistance from our open source developer and get support for your open source customization project!