3 ms·
The Hack Transpiler: Run your Hack project on a PHP5 engine
- Joky 12y agoDoes 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 12y agoThe 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 12y ago> 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.
- Joky 12y agoThe distinction is murky, that's my point. I wonder who invented this term and when? A look at Google Trends shows how it is very recent: http://www.google.com/trends/explore#q=transpiler http://www.google.com/trends/explore#q=transpiler
- vsi 12y agowhen I search for the term transpiler on google, the first hit is this wikipedia entry http://en.wikipedia.org/wiki/Source-to-source_compiler http://en.wikipedia.org/wiki/Source-to-source_compiler Relevant statement "A source-to-source compiler translates between programming languages that operate at approximately the same level of abstraction, while a traditional compiler translates from a higher level programming language to a lower level programming language."
- vsi 12y agoHi, 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 12y agoI 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 12y agoit's for the latter reason. Enums are a fairly new feature, we don't believe that many people have used it yet :).
- touristtam 12y agosorry newbie question here: What's the incentive to move to HHVM and Hacklang coming from a regular PHP Lamp background?
- jwatzman 12y agoTake a look at the homepage: http://hacklang.org/ http://hacklang.org/