February 1, 2019

January 23, 2019

Please reload

Recent Posts

About 2 weeks ago, we published that we had successfully converted a PHPUnit example project and it ran just the same as if it had been run with PHP....

PHPUnit [Beta] Full-Native Java Test Results

June 11, 2018

Please reload

Featured Posts

How does the Runtime Converter compare to Facebook's HipHop?

May 12, 2017

On the face of it, HipHop, which is Facebook's source code converter from PHP into C++, would be a very similar project to the Runtime Converter which converts PHP into Java/Swift/C#. In fact, HipHop serves as an excellent example of how it is possible to convert PHP and have it run flawlessly.


Where HipHop and the Runtime Converter differ is in their primary goals. The primary goal of HipHop was to speed up PHP and reduce costs. The Runtime Converter also has this potential, especially with the Swift and C# versions (and with developer work + optimization also the Java), but one of its main goals is to enable developer productivity using the new languages.


HipHop took relatively simple code such as



and converted it to completely unreadable code whose only goal is to be optimized by the g++ compiler.


HipHop conversion:


Now, this  code may not be radically different than the way C++ really looks, but it is completely useless for development and intended to be that way.


Here is that same block of code put throught the Runtime Converter into Java:

This code far from perfect, but it is important to keep in mind the bigger picture.

1. This code is easily converted into basic Java with a few keyboard strokes.

2. The Runtime Converter is being optimized to run correctly and to compile first, and this overly simple loop example is not all that it can handle. The redundant isTrue check will also be shortly removed.

3. When you call this function from Java, it really doesn't matter what its internals are, just that it works.


Here's another example from code from a PHP CURL example (http://php.net/manual/en/curl.examples.php).



 Converted Code

 Of course its still a work in progress and we'll remove the hardcoded option values in the future, but it really does work and it is not significantly more verbose than the sources themselves. This example, btw, happens to be not a function, but an "include". It would be similar to a " void main(String[] args)" or servlet GET. With the Runtime Converter, you can actually load this example to a server or call it on the command line.

More Information about HipHop

HipHop for PHP: Move Fast

Share on Facebook
Share on Twitter
Please reload

Follow Us
Please reload

Search By Tags
Please reload

  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square

© 2017 RuntimeConverter