3 ms·
"HipHop for PHP isn't technically a compiler itself." ... "HipHop programmatically transforms your PHP source code into highly optimized C++" Sounds like a c
by tlrobinson 17y ago
"HipHop for PHP isn't technically a compiler itself."
...
"HipHop programmatically transforms your PHP source code into highly optimized C++"
Sounds like a compiler to me. Compilers don't have to target machine code.
- DrJokepu 17y agoExactly my thoughts. To further support your statement, theoretically, it should be possible to create a CPU that interprets C++ source code as machine code (not sure why would anyone do that though.)
- jrockway 17y agoA better example is modern x86 CPUs. You feed them x86 instructions, but that is not the native language of the CPU; everything is translated into the real underlying (RISC) language as the x86 instructions are encountered. Or so I'm told. I've never read Intel's source code :)
- rbanffy 17y agoI doubt it would be this elegant ;-)
- EricBurnett 17y agoBy that logic then PHP itself is also assembly because someone could make a machine that executes it natively. We might as well throw all distinctions away if we go down this road.
- DrJokepu 17y agoI'm not sure if I understand what you're trying to suggest. Indeed, someone could make a machine that executes PHP natively. It's a Turing-complete language, just like C++ or x86 assembly for that matter so it should be possible to build a (weak) universal machine that executes them directly.
- EricBurnett 17y agoMy point is that what someone could create shouldn't have any bearing on the discussion. They are using c++ as an intermediate language, fine. Just because we could make a machine that executes it shouldn't alter that distinction. We can still call that compiling, but hypothesizing new machines doesn't help.
- bkudria 17y agoExactly. The textbook definition of a compiler is a program that translates a program from one language to another.
- codexon 17y agoHere's a quote from an alleged Facebook employee on Reddit regarding this matter. This entire thread needs to go fall in a well and die. If they had just called it a compiler, you nerds would be arguing about the same thing and saying it was a source code transformer. They just called it that because it translates PHP to C++, and to most people who don't have Asperger's that's not the same as compiling. How do I know this? I sit 20 feet from the guys who wrote it. http://www.reddit.com/r/programming/comments/ax7k4/facebooks_hiphop_for_php_programmatically/c0jvpya http://www.reddit.com/r/programming/comments/ax7k4/facebooks...
- tlrobinson 17y agoI'm not sure how working 20 feet from the guy makes him an authority on how us "nerds" would react. Anyway, the thing that got me was the "technically", otherwise I may have let it slide. You could argue it's not a compiler in the commonly accepted sense of the word, but technically it most certainly is a compiler.