Facebook open sources “Hack Codegen” a code that writes code

Good news for Open Source Lovers!
Facebook has open-sourced Hack Codegen – its library for automatically generating Hack code, allowing outside developers to automate some of their routine work while developing large programs.
HACK is the Facebook’s own programming language designed to build complex web sites and other software quickly and without many flaws.
HACK programming language is developed for HipHop Virtual Machine (HHVM) – an open-source virtual machine designed to execute programs written in Hack and PHP. The top 20 open source frameworks on Github run on HHVM.

HACK CodeGen is Now Open Source

While making the announcement of open-sourcing Hack Codegen, which automatically generates hack code, Facebook’s software engineer Alejandro Marcu said in a blog post:

“Being able to generate code through automated code generation allows [developers] to increase the level of abstraction by making frameworks that are declarative and that are translated into high-quality Hack code.”
“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.”

Before Hack Codegen, Facebook engineers used concatenating strings to generate code that perform simple yet frequently executed tasks, like fetching birthday of a user.
However, the social media giant later discovered that the technique was not good enough to scale up and realized that it need a good library to generate code. This results in the birth of Hack Codegen.

Code That Writes Code

Hack Codegen simplifies code generation by helping developers create a schema, which holds code for multiple times usage, and a way to generate all the related functionality required to support that code.
The library only needs a developer to provide the required details about the particular implementation, although rest of the task is done by the software, such as generation of classes, variables, methods, functions, interfaces, files, and other standard blocks of code.
The Hack Codegen library includes:
  • Hack_builder to deal with the concatenation
  • New lines
  • Indentation
  • Braces
  • Hack keywords
  • Collections
  • Signed files to re-generate code automatically when a schema is changed
The open-source version of Hack Codegen is available on GitHub.
- Advertisement -
c5d094d2086cdf56ad5c1380e5317d2e?s=96&r=g - Facebook open sources "Hack Codegen" a code that writes code
Adeel Younashttps://techwafer.com
Editor-in-Chief at TechWafer (previously The Tech) an Entrepreneur, Blogger, Developer, and Freelancer.

Recent Articles

Tecno Spark 6 Review:

Tecno is taking our lower-end smartphone segment with phones like Spark 6. It is an all-in-one device for gamers and battery enthusiasts in the...

vivo Launches Y20 with 5000mAh Battery, Triple Macro Camera and Side Fingerprint

vivo, the leading global smartphone brand, today announced the launch of its latest mid-range smartphone, the Vivo Y20 in Pakistan. vivo Y20 with 5000mAh Battery,...

OPPO launches Enco W51 headphones loaded with exciting features

Hoping to connect users' lives in a smarter way, OPPO launches a new entrant as part of its IoT strategy – OPPO Enco W51....

realme C17 launched with 90Hz Display, 6GB RAM and 128GB Storage

realme has finally launched the most affordable realme C17 with 6 GB + 128 GB large storage & 90Hz ultra-smooth punch-hole display at an...

HUAWEI Y9a – the Midrange King Goes on Sale across Pakistan Today

The HUAWEI Y series continues to exceed expectations of young consumers all over Pakistan. It is touted as a worthy digital companion that flouts...

Trending

93,180FansLike
2,569FollowersFollow
519FollowersFollow
4,917FollowersFollow
900SubscribersSubscribe

Leave A Reply

Please enter your comment!
Please enter your name here