Question

I was looking at the hack language of Facebook but I have a server running several php sites.

Now I was wondering if there is a tool that can convert hack back to php, so it can be run it on my server but I can develop in hack?

Was it helpful?

Solution

Hack is neither a subset nor a superset of PHP -- we've been calling it a "dialect". While writing a tool to convert many (but not all!) features from Hack to PHP might be possible right now, we don't believe it to be a good idea. This thread has some discussion and elaboration on why: https://github.com/facebook/hhvm/issues/2236 (Super short summary: you really want the runtime to be enforcing your type annotations.)

As that thread says, we do want a better PHP conversion story than we have right now, particularly for frameworks that don't want to convert over to Hack wholesale (since they'd lose most of their users/customers :)). We don't have anything yet, but have some ideas we haven't gotten around to working on yet.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top