Search code examples
phphhvmhacklang

HHVM Hack source to plain PHP


I searched on Google and on SO. Couldn't find this question or an answer to it anywhere. SO here goes.

I'd like to start using Hack at work, at least for some small projects. Our servers right now don't have HHVM installed, and it would take some doing to get that done. Because of that, I was wondering if it is possible to write and use Hack locally, but then "compile"/"convert" the Hack-source files to plain PHP. The plain PHP source could then be deployed to our current platforms as is.

I know, edge case, not long term, but I am curious about the possibility anyway

Edit It seems enough people asked this kind of question, because Facebook released a transpiler from Hack to PHP. I haven't tried it yet, but thought I'd mention it here.


Solution

  • No. This has been discussed and doesn't make sense. There's a lot more to Hack than just type annotations that makes it near impossible to be able to convert it to PHP.