

The Hack Transpiler: Run your Hack project on a PHP5 engine - ot
https://code.facebook.com/posts/398235553660954/announcing-the-hack-transpiler/

======
Joky
Does anyone know the origin of the term "transpiler"? While I found some ~10y
old reference, it seems to have become popular only recently.

I don't like it as it is very blurry and to me it means the same as compiler.

From Wikipedia: "A compiler is a computer program (or set of programs) that
transforms source code written in a programming language (the source language)
into another computer language".

~~~
jwatzman
The reason we called it a transpiler here is that the output is source code in
another language that is intended as the input to another compiler (well, the
PHP5 runtime in this case, but same general idea). It doesn't execute code, or
produce anything that is directly executable itself. It still needs another
step.

I agree the distinction is murky, though. When you run gcc, one stage will
output asm, then send that to an assembler. But that isn't typically called
transpiling. But on the other hand, I'd hardly call asm source code...

So that's why we called it a transpiler. Don't disagree, just some context.

~~~
PuercoPop
> It doesn't execute code,

Because if it did, it would be an interpreter.

> or produce anything that is directly executable itself.

My PoV is that the CPU as a interpreter. compilers just translate. It appears
to me that you are under the impression that there is something special about
machine code, that compilers should generate machine code in order to be one.
If that were the case I would disagree. I concur with the OP that transpiler
should just be dropped, just use compiler.

------
vsi
Hi, I'm the engineer who worked on this tool primarily :). I'll be happy to
answer any questions about how it works and our design choices.

~~~
michaelmior
I was surprised to find Enums in the list of unsupported features. On the
surface, this seems like something which would be pretty straightforward. Are
there some non-obvious technical challenges here, or is it just something that
you haven't gotten to yet?

~~~
vsi
it's for the latter reason. Enums are a fairly new feature, we don't believe
that many people have used it yet :).

------
touristtam
sorry newbie question here: What's the incentive to move to HHVM and Hacklang
coming from a regular PHP Lamp background?

~~~
jwatzman
Take a look at the homepage: [http://hacklang.org/](http://hacklang.org/)

