DaemonForums  

Go Back   DaemonForums > DaemonForums.org > News

News News regarding BSD and related.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 31st January 2010
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default Facebook's PHP compiler

First it looked like Facebook rewrote the PHP runtime for speed, but it looks like they wrote a PHP compiler.
See http://www.sdtimes.com/blog/post/201...P-runtime.aspx
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #2   (View Single Post)  
Old 2nd February 2010
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

More news about this Facebook PHP runtime or compiler at the theregister.co.uk
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #3   (View Single Post)  
Old 2nd February 2010
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

The announcement of "HipHop for PHP" from the Facebook website, (my first Facebook visit BTW

http://developers.facebook.com/news....og=1&story=358
Quote:
HipHop for PHP isn't technically a compiler itself. Rather it is a source code transformer. HipHop programmatically transforms your PHP source code into highly optimized C++ and then uses g++ to compile it.

HipHop executes the source code in a semantically equivalent manner and sacrifices some rarely used features — such as eval() — in exchange for improved performance. HipHop includes a code transformer, a reimplementation of PHP's runtime system, and a rewrite of many common PHP Extensions to take advantage of these performance optimizations.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump

Last edited by J65nko; 2nd February 2010 at 10:01 PM. Reason: Added quote
Reply With Quote
  #4   (View Single Post)  
Old 3rd February 2010
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

I'm not sure a PHP to C++ compiler is an improvement over just writing it in C++ to start with, but I'll take their word for it :-o
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #5   (View Single Post)  
Old 3rd February 2010
MatthewC MatthewC is offline
New User
 
Join Date: Feb 2010
Posts: 2
Default

Quote:
Originally Posted by TerryP View Post
I'm not sure a PHP to C++ compiler is an improvement over just writing it in C++ to start with, but I'll take their word for it :-o
True, but he started off the post pointing out how simple PHP is to write and debug, and how quickly they can ramp up new developers due to the simplicity of the language. Given the immense volume of traffic that is riding on their systems, I'd assume you'd rather have the new engineers start with a simple language that's hard to mess up and have an experienced engineer write something that will translate it into clean C++, instead of letting the new guy write something that will leave them exposed to some elementary buffer overflow or something of that nature Just my 2 cents.
Reply With Quote
  #6   (View Single Post)  
Old 3rd February 2010
MatthewC MatthewC is offline
New User
 
Join Date: Feb 2010
Posts: 2
Default

Quote:
Originally Posted by MatthewC View Post
True, but he started off the post pointing out how simple PHP is to write and debug, and how quickly they can ramp up new developers due to the simplicity of the language. Given the immense volume of traffic that is riding on their systems, I'd assume you'd rather have the new engineers start with a simple language that's hard to mess up and have an experienced engineer write something that will translate it into clean C++, instead of letting the new guy write something that will leave them exposed to some elementary buffer overflow or something of that nature Just my 2 cents.
And yes, I know of PHP's track record of vulnerabilities. There's ways to mess things up that way too, but in my experience the bugs with PHP are generally more straightforward and easier to pick out than with C++, especially in terms of memory management.
Reply With Quote
  #7   (View Single Post)  
Old 3rd February 2010
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

They actually use PHP as a CASE and/or prototyping tool with a fast turn around.

After everything works as desired, they use the HipHop tool to crunch out C++ to satisfy their "need for speed". Makes sense and also saves electricity and carbon emissions
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #8   (View Single Post)  
Old 4th February 2010
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

In my personal experiences PHP is faster to write but can make assembly look more fun to debug.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #9   (View Single Post)  
Old 4th February 2010
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

PHP doesn't handle errors very gracefully, personally I prefer the way Python does things by just throwing an exception and exiting whenever something unexpected happens. Which is different from PHP which tried to fix things and run anyway unless it's a really gross error ...

Another thing I dislike about PHP is that it seems to be a rather directionless language. Features and "enhancements" are added almost at random, a prime example is the GOTO feature someone added for PHP6, and then someone else filed a bugreport titled PHP now includes GOTO ...
The response by the PHP devs?
Quote:
goto hell;
Professional ...

Again, Python does this much better with PEP (Python Enhancement Proposal). Not only does this force people to actually think before they add a feature or module, it also filters out many features that are not particular great ideas to start with, as well as create an atmosphere of positive criticism.

In many ways PHP is like Linux, and Python is like BSD ...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Old 5th February 2010
roddierod's Avatar
roddierod roddierod is offline
Real Name: Rod Person
VPN Cryptographer
 
Join Date: Apr 2008
Location: Pittsburgh, Pa
Posts: 437
Default

Quote:
Originally Posted by Carpetsmoker View Post
In many ways PHP is like Linux, and Python is like BSD ...
Exactly!

10 years ago, I rebuilt our site here from IIS and ASAPI dlls to Apache and PHP.
At the time I didn't know Python and there was all this PHP buzz so I decided to go with it. I took me about 4 or 5 days to learn all the things I need to know in PHP to build a website to interact with a MS SQL database in real time - finding someone talking about connecting to MS SQL at the time was the hardest thing.

I've re-written the site 3 or 4 times and even use PHP frame works to make the code more logical and OO, but despite all that I'm still embarrassed by the code and that is because I've learned Python since then. Python is just so much more organized and logic like FreeBSD! The next iteration of that web site will be in Python which will give Corporate Security a headache, which I love to do!
__________________
"The basic tool for the manipulation of reality is the manipulation of words. If you can control the meaning of words, you can control the people who must use the words." -Philip K. Dick
Reply With Quote
Reply

Tags
php compiler

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
building cross compiler, having issues moonlightcheese FreeBSD General 2 13th September 2008 02:22 PM
java compiler bsdnewbie999 OpenBSD Packages and Ports 8 9th August 2008 12:18 PM
pkg_chk c++ compiler not available fenrisW0lf NetBSD Package System (pkgsrc) 15 30th June 2008 10:48 AM
pcc compiler question ChineseBroccoli FreeBSD General 1 11th June 2008 11:29 PM


All times are GMT. The time now is 08:53 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick