0

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?

Spidfire
  • 5,433
  • 6
  • 28
  • 36
  • Nevermind there are breaking features in hacklang: as can be seen at https://www.youtube.com/watch?v=LIjkcfaiA60 – Spidfire Jun 04 '14 at 20:14

1 Answers1

3

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.

Josh Watzman
  • 7,060
  • 1
  • 18
  • 26