Re: [Wikitech-l] HipHop

2011-04-04 Thread Inez Korczynski
Hi Tim,

I have no problem running foo.php and test.php that you sent in hphpi, but
also it compiles and run without any problems with hphp. What command
exactly do you use to compile and then execute?

Inez

On Sun, Apr 3, 2011 at 5:38 PM, Tim Starling tstarl...@wikimedia.orgwrote:

 On 03/29/2011 10:48 AM, Platonides wrote:
  I was expecting this the week hip-hop hit. What would be required to
  target hip-hop? How does that differ from working from Zend?

 I've explored the issues and made some initial changes to my working
 copy. I'm now waiting for it to compile, and once it's tested, I'll
 commit it.

 There is a list of things that differ here:

 https://github.com/facebook/hiphop-php/blob/master/doc/inconsistencies

 Unfortunately it seems to leave out the most important differences.

 It seems incredible, and I'm hoping someone will correct me, but it
 seems that file inclusion has to be completely different in HipHop.
 Even the simplest script won't work. I put this in foo.php:

 ?php
 class Foo {
static function bar() {
print Hello\n;
}
 }
 ?

 And this in test.php:

 ?php
 include 'foo.php';
 Foo::bar();
 ?

 This gives HipHop Fatal error: Cannot redeclare class Foo at
 runtime. All classes which are compiled exist from startup, and trying
 to declare them produces this error. This means that it is no longer
 possible to mix class and function declarations with code we want to
 execute. My working copy has fixes for the most important instances of
 this, such as in Setup.php and WebStart.php.

 There are two exceptions to this. One is the interpreter. HipHop has
 an interpreter, which is used for eval() and for include() on a file
 with a fully-qualified path. We can use this to allow us to change
 LocalSettings.php without recompiling.

 If you want to do include() and have it execute compiled code, you
 need to use a path which is relative to the base of the compiled code.
 My working copy has some functions which allow this to be done in a
 self-documenting way.

 The other exception is volatile mode, which unfortunately appears to
 be completely broken, at least in the RPMs that I'm using. It's so
 broken that calling class_exists() on a literal string will break the
 class at compile time, making it impossible to use, with no way to
 repair it. My working copy has a wrapper for class_exists() which
 doesn't suffer from this problem.

 Another undocumented difference is that HipHop does not use php.ini or
 anything like it, so most instances of ini_get() and ini_set() are
 broken. The functions exist, but only have stub functionality. HipHop
 has its own configuration files, but they aren't like php.ini.

 When I'm ready to write all this up properly, the following page will
 appear on mediawiki.org:

 http://www.mediawiki.org/wiki/HipHop

 -- Tim Starling



 ___
 Wikitech-l mailing list
 Wikitech-l@lists.wikimedia.org
 https://lists.wikimedia.org/mailman/listinfo/wikitech-l

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] HipHop

2011-03-31 Thread Inez Korczynski
Hello,

I'm working on migration to HipHop at Wikia (we run on MediaWiki
1.16.2 with tons of our custom extensions and skins).

At this point I'm testing and benchmarking all different use cases and
so far I didn't run into any serious problems - however there were
memory corruptions when using DOMDocument (Preprocessor_DOM) under
heavy load, but it is already fixed.

Btw. I had to apply this patch http://pastebin.com/qJNcwp99 to
MediaWiki code to make it work (commenting preg_replace is just
temporary change).

Very likely in our approach we will mostly target HipHop (not Zend)
with future development, since we want to switch our developers to
work with HipHop as well.

Inez

On Sun, Mar 27, 2011 at 8:21 PM, Tim Starling tstarl...@wikimedia.org wrote:
 I think we should migrate MediaWiki to target HipHop [1] as its
 primary high-performance platform. I think we should continue to
 support Zend, for the benefit of small installations. But we should
 additionally support HipHop, use it on Wikimedia, and optimise our
 algorithms for it.

 In cases where an algorithm optimised for HipHop would be excessively
 slow when running under Zend, we can split the implementations by
 subclassing.

 I was skeptical about HipHop at first, since the road is littered with
 the bodies of dead PHP compilers. But it looks like Facebook is pretty
 well committed to this one, and they have the resources to maintain
 it. I waited and watched for a while, but I think the time has come to
 make a decision on this.

 Facebook now write their PHP code to target HipHop exclusively, so by
 trying to write code that works on both platforms, we'll be in new
 territory, to some degree. Maybe that's scary, but I think it can work.

 Who's with me?

 -- Tim Starling

 [1] https://github.com/facebook/hiphop-php/wiki/


 ___
 Wikitech-l mailing list
 Wikitech-l@lists.wikimedia.org
 https://lists.wikimedia.org/mailman/listinfo/wikitech-l


___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l