News for hackers. Stuff that matters.
Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by mikeytown2 on Monday September 21, 2009 @01:17AM (#834047)
One of the authors conclusions (see section 7 of the PDF) about PHP threading is 1/2 wrong. There is the PCNTL extension. And I actually wrote some code for a project of mine that does batch processing using multiple processes; my code works with vanilla PHP, unlike the PCNTL extension.
Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by dmajda on Monday September 21, 2009 @03:24AM (#834147)
The PCNTL extension is about process control, not threading. I don't see how it could help to solve the limitations mentioned in the section 7.1 of the thesis.
Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by mikeytown2 on Monday September 21, 2009 @03:16PM (#835280)
A new process can be considered very crude threading. I use the database to send messages between the different processes.
Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by dryicerx on Monday September 21, 2009 @01:27AM (#834054)
And then do PHP.JS. http://phpjs.org/

What have I done?

Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by lucraft on Monday September 21, 2009 @04:17AM (#834198)
Is that page a joke?

"By including the PHP.JS library in your own projects, you can use your favorite PHP functions client-side."

and:

"Using PHP.JS may speed up development for PHP developers who are increasingly confronted with client-side technology."

I hate being confronted with client-side technology.

Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by scotty79 on Monday September 21, 2009 @06:39AM (#834324)
Actually this page is brilliant. I have not included php.js in my projects but used this page many times to find out how to do in JavaScript things that are easy in PHP but in js ... they are not easy at all.
Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by ilyak on Monday September 21, 2009 @04:45AM (#834234)
"for PHP developers who are PHP developers" One trick pony knows only one trick.
Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by beilabs on Monday September 21, 2009 @02:31AM (#834103)
I saw his original presentation in Prague - Euruko 2008. Nice to see that he completed the project. Congrats dude, it's a huge project to take on. Will you be pushing the code on github?
Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by dmajda on Monday September 21, 2009 @03:43AM (#834169)
Thanks :-)

The source code is available on my website: http://www.majda.cz/download/translating-ruby-to-php-cd.tar..... I didn't push it on GitHub because I didn't indend to develop the compiler further after finishing the thesis.

The code is BSD-licensed however, so if anyone wants to hack on it, he is free to go :-)

Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by rbxbx on Monday September 21, 2009 @12:37PM (#834927)
Thanks for hopping into the thread. Very interesting project you have/had here sir. :)
Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by catch23 on Monday September 21, 2009 @12:15AM (#833987)
why? Are there lots of PHP developers that want ruby libraries?
Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by dmajda on Monday September 21, 2009 @03:33AM (#834154)
I begun to work on the master thesis when there was no mod_rails, Rails hostings were less common and they were more expensive than PHP hostings. So the other commenters in this thread are right about the "deployability" reason.

When the work was being finished, I aleready saw that the real-world usefulness of the compiler is minimal. This is why I didn't develop the compiler further after finishing the thesis.

Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by mosburger on Monday September 21, 2009 @09:42AM (#834549)
Can you make a Java -> PHP compiler next? I'm obviously joking, but finding reliable, inexpensive Java hosting is nearly impossible.
Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by halo on Monday September 21, 2009 @12:41AM (#834015)
The likely rationale is that there's probably quite a few people who want the deployability of PHP without having to work around the problems with the language.
Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by pilif on Monday September 21, 2009 @02:46AM (#834116)
to be honest though, with the advent of passenger (basically mod_rails), ruby webapps don't feel harder to deploy then PHP at all any more.

I don't see any practical reason to translate Ruby to PHP. Compared to other translations, this one doesn't make sense at all as you don't get any advantages of the translations result.

Compare this to a translator that translates Ruby to JS: Here you get the ability to run Ruby in the browsers. Or JRuby where you get the ability to run Ruby in a Java-only environment (plus a bit of performance in some cases), or IronRuby for the same reasons for the .NET platform.

But PHP? I don't get it.

Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by tomjen2 on Monday September 21, 2009 @03:16AM (#834140)
It might not be impossible to set up, but there are far more webhosts that offer php than rails (and believe it or not, there are plenty of people who are in the market for $2/month webhosting).
Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by pilif on Monday September 21, 2009 @03:26AM (#834148)
I have a feeling that the time to make a rails application transcoded to PHP actually work on a $2/month hoster amounts to much more money than a rails hosting plan, which, after googling for "rails hosting" seems to be available for $4/month.

So unless your time is really cheap ($2/month, that's, considering a 40 hours week $0.0125/hour), you'd be better off just getting a rails hoster.

No. This feels like it's of pure academical value.

Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by rbxbx on Monday September 21, 2009 @02:12AM (#834087)
Going back to using PHP after extensively using ruby is pretty brutal, even with just a subset of the functionality, this is a pretty nice little project, imo. Maybe one of us will drag it back from the grave.
Re:Ruby.PHP: Ruby to PHP Compiler (thesis etc) by petercooper on Monday September 21, 2009 @08:18AM (#834431)
As a Ruby developer, a fully working 100% Ruby->PHP doodad would interest me for ease of deployability (Passenger rocks, but it's hardly universal) and speed. PHP still kicks even Ruby 1.9's ass on the Alioth speed tests. I wonder if PHP (or even Zend) can act as a good virtual machine of sorts in the way the JVM does..