Facebook Engineering Blog
Writing code that writes code — with Hack Codegen

Writing code that writes code — with Hack Codegen

8/20/2015 · Alejandro Marcu

What this post added

Introduced Hack Codegen, a library for generating Hack code and writing it into signed files. This addresses issues with string concatenation for code generation, improves type safety, and reduces boilerplate by generating classes (like getters and mutators) from declarative schemas. It also introduces signed files to prevent manual modification of generated code and supports manual sections for flexibility.

Read the original post ↗