Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Wikitech

HipHop

 

 

First page Previous page 1 2 Next page Last page  View All Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded


tstarling at wikimedia

Mar 27, 2011, 8:21 PM

Post #1 of 42 (3299 views)
Permalink
HipHop

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 [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


roan.kattouw at gmail

Mar 27, 2011, 11:36 PM

Post #2 of 42 (3273 views)
Permalink
Re: HipHop [In reply to]

2011/3/28 Tim Starling <tstarling [at] wikimedia>:
> Who's with me?
>
I don't really have a good idea of what would need to change to
support HipHop, but if the changes aren't to intrusive I'm all for it.

If we decide to do this, we should also decide when to start and when
we want to have HPHP support working (1.18? 1.19?).

Roan Kattouw (Catrope)

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


aschulz4587 at gmail

Mar 27, 2011, 11:50 PM

Post #3 of 42 (3309 views)
Permalink
Re: HipHop [In reply to]

Two things:
(i) I'd really hope that subclassing would be very rare here. I don't think
this will be much of an issue though.
(ii) Also, it would be nice if developers could all have hiphop running on
their test wikis, so that code that's broken on hiphop isn't committed in
ignorance. The only problem is that, last time I checked, the dependency
list for hiphop is very considerable...and isn't for Windows yet. However, I
believe Domas didn't need *too* many patches to get MW working, which
suggests that having to write code that compiles with hiphop won't be that
difficult and error prone. If there can be a small yet complete list of
"things that only work in regular PHP" then that might be an OK alternative
to each dev running/testing hiphop.

Otherwise,


Tim Starling-2 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 [at] lists
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
>

--
View this message in context: http://old.nabble.com/HipHop-tp31253551p31254438.html
Sent from the Wikipedia Developers mailing list archive at Nabble.com.


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


tstarling at wikimedia

Mar 28, 2011, 12:44 AM

Post #4 of 42 (3258 views)
Permalink
Re: HipHop [In reply to]

On 28/03/11 17:36, Roan Kattouw wrote:
> 2011/3/28 Tim Starling <tstarling [at] wikimedia>:
>> Who's with me?
>>
> I don't really have a good idea of what would need to change to
> support HipHop, but if the changes aren't to intrusive I'm all for it.
>
> If we decide to do this, we should also decide when to start and when
> we want to have HPHP support working (1.18? 1.19?).

It depends on how many people are interested in it, and I'm not sure
how much work there is to do. But as long as we're careful to maintain
compatibility with Zend, we can work in trunk. Once it's ready, we can
add it to the installation docs.

It should be ready for 1.19 at the latest. If it's not done by then,
we should shelve the project.

-- Tim Starling


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


innocentkiller at gmail

Mar 28, 2011, 6:42 AM

Post #5 of 42 (3300 views)
Permalink
Re: HipHop [In reply to]

On Mon, Mar 28, 2011 at 2:50 AM, Aaron Schulz <aschulz4587 [at] gmail> wrote:
> (ii) Also, it would be nice if developers could all have hiphop running on
> their test wikis, so that code that's broken on hiphop isn't committed in
> ignorance. The only problem is that, last time I checked, the dependency
> list for hiphop is very considerable.
>

I also don't know if they've actually merged the 32bit work into their
mainline yet--I know a volunteer was working on it. If they're lacking
32bit support in the main release still, that might be a reason to hold
off for now.

I've compiled HPHP before, the dependencies aren't really that bad
(anymore), you just have to compile a custom build of libevent and
libcurl.

I know nothing of trying to get it to work on Windows, probably would
be a royal PITA without cygwin.

-Chad

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Simetrical+wikilist at gmail

Mar 28, 2011, 7:28 AM

Post #6 of 42 (3254 views)
Permalink
Re: HipHop [In reply to]

On Sun, Mar 27, 2011 at 11:21 PM, Tim Starling <tstarling [at] wikimedia> wrote:
> 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.

What happens when the feature lists start diverging, because Zend adds
what it thinks would be useful and Facebook ignores that and adds what
it thinks would be useful? Then we can't use any new features from
either. Or are we sure Facebook is committed to maintaining long-term
compatibility with Zend PHP?

On Mon, Mar 28, 2011 at 9:42 AM, Chad <innocentkiller [at] gmail> wrote:
> I also don't know if they've actually merged the 32bit work into their
> mainline yet--I know a volunteer was working on it. If they're lacking
> 32bit support in the main release still, that might be a reason to hold
> off for now.

Why? People on 32-bit machines can just run Zend PHP.

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


midom.lists at gmail

Mar 28, 2011, 7:34 AM

Post #7 of 42 (3264 views)
Permalink
Re: HipHop [In reply to]

On Mar 28, 2011, at 5:28 PM, Aryeh Gregor wrote:

> ... and Facebook ignores that and adds what
> it thinks would be useful?

Facebook already has features Zend does not:

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

Stuff like:
* Parallel RPC - MySQL, HTTP, ..
* Background execution, post-send execution, pagelet server
etc

Domas
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


tstarling at wikimedia

Mar 28, 2011, 7:47 AM

Post #8 of 42 (3255 views)
Permalink
Re: HipHop [In reply to]

On 29/03/11 01:28, Aryeh Gregor wrote:
> What happens when the feature lists start diverging, because Zend adds
> what it thinks would be useful and Facebook ignores that and adds what
> it thinks would be useful? Then we can't use any new features from
> either.

We can use features from both, using function_exists(), like what we
do now with PHP modules.

If you compile PHP with no zlib, you can't compress anything, but the
rest of MediaWiki still works. In the future we may use HipHop's
parallel execution features. If you don't have HipHop, the work will
be done in serial. I quandaries will be very rare.

-- Tim Starling


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


innocentkiller at gmail

Mar 28, 2011, 7:50 AM

Post #9 of 42 (3252 views)
Permalink
Re: HipHop [In reply to]

On Mon, Mar 28, 2011 at 10:28 AM, Aryeh Gregor
<Simetrical+wikilist [at] gmail> wrote:
> On Mon, Mar 28, 2011 at 9:42 AM, Chad <innocentkiller [at] gmail> wrote:
>> I also don't know if they've actually merged the 32bit work into their
>> mainline yet--I know a volunteer was working on it. If they're lacking
>> 32bit support in the main release still, that might be a reason to hold
>> off for now.
>
> Why?  People on 32-bit machines can just run Zend PHP.
>

I meant that as more for developers looking to help in the effort but
might still be on a 32bit system :)

-Chad

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


lists at nadir-seen-fire

Mar 28, 2011, 9:47 AM

Post #10 of 42 (3285 views)
Permalink
Re: HipHop [In reply to]

On 11-03-28 12:44 AM, Tim Starling wrote:
> On 28/03/11 17:36, Roan Kattouw wrote:
>> 2011/3/28 Tim Starling<tstarling [at] wikimedia>:
>>> Who's with me?
>>>
>> I don't really have a good idea of what would need to change to
>> support HipHop, but if the changes aren't to intrusive I'm all for it.
>>
>> If we decide to do this, we should also decide when to start and when
>> we want to have HPHP support working (1.18? 1.19?).
> It depends on how many people are interested in it, and I'm not sure
> how much work there is to do. But as long as we're careful to maintain
> compatibility with Zend, we can work in trunk. Once it's ready, we can
> add it to the installation docs.
>
> It should be ready for 1.19 at the latest. If it's not done by then,
> we should shelve the project.
>
> -- Tim Starling
Sounds interesting...

Then again, I'm also interested in making Drizzle work, and switching
our skin systems to using a custom xml/html template system.

Maybe I'll try running HPHP myself in production in my upcoming project
when it's ready in core.

~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Simetrical+wikilist at gmail

Mar 28, 2011, 3:40 PM

Post #11 of 42 (3296 views)
Permalink
Re: HipHop [In reply to]

On Mon, Mar 28, 2011 at 10:47 AM, Tim Starling <tstarling [at] wikimedia> wrote:
> We can use features from both, using function_exists(), like what we
> do now with PHP modules.

Well, yes, if there's some reasonable fallback. It doesn't work for
features that are useless if you have to write a fallback, like
various types of syntactic sugar. For example, the first features
from PHP 5.3 release notes include namespaces, late static binding,
lambda functions and closures, NOWDOC, a ternary operator shortcut,
limited goto, and __callStatic. If Facebook didn't implement some of
those new features in Hiphop by the time we could feasibly require PHP
5.3, we wouldn't be able to use them. (Some look really nice, like
anonymous functions -- one of the things I really like about
JavaScript.)

Granted, this sort of thing is rarely very essential, and maybe Hiphop
will keep up with all of PHP's new syntactic sugar. Overall, I'm all
in favor of trying out Hiphop on Wikimedia -- I was just wondering
what would happen if Hiphop doesn't incorporate all of PHP's new
features over time. Which might be groundless, if Facebook plans to
incorporate all of PHP's new syntactic features over time.

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Platonides at gmail

Mar 28, 2011, 4:48 PM

Post #12 of 42 (3236 views)
Permalink
Re: HipHop [In reply to]

Tim Starling 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/

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?


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


tstarling at wikimedia

Mar 28, 2011, 6:33 PM

Post #13 of 42 (3252 views)
Permalink
Re: HipHop [In reply to]

On 29/03/11 09:40, Aryeh Gregor wrote:
> On Mon, Mar 28, 2011 at 10:47 AM, Tim Starling <tstarling [at] wikimedia> wrote:
>> We can use features from both, using function_exists(), like what we
>> do now with PHP modules.
>
> Well, yes, if there's some reasonable fallback. It doesn't work for
> features that are useless if you have to write a fallback, like
> various types of syntactic sugar. For example, the first features
> from PHP 5.3 release notes include namespaces, late static binding,
> lambda functions and closures, NOWDOC, a ternary operator shortcut,
> limited goto, and __callStatic. If Facebook didn't implement some of
> those new features in Hiphop by the time we could feasibly require PHP
> 5.3, we wouldn't be able to use them. (Some look really nice, like
> anonymous functions -- one of the things I really like about
> JavaScript.)

Yes, that's true, and that's part of the reason I'm flagging this
change on the mailing list. Domas says that the HipHop team is working
on PHP 5.3 support, so maybe the issue won't come up. But yes, in
principle, I am saying that we should support HipHop even when it
means not using new features from PHP.

PHP 5.3 might be cool, but so is cutting our power usage by half (pun
intended).

-- Tim Starling


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


innocentkiller at gmail

Mar 29, 2011, 6:51 AM

Post #14 of 42 (3229 views)
Permalink
Re: HipHop [In reply to]

On Sun, Mar 27, 2011 at 11:21 PM, Tim Starling <tstarling [at] wikimedia> wrote:
> 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?
>

*grabs a battle axe* I'm with you!

I went ahead and compiled hiphop last night on a fresh VM. Couple of
notes for anyone trying to join us.

For those of you on Ubuntu or other flavors of Debian, the guide at [0] wil
pretty much walk you through it pain-free. One little gotcha: you need a
libmemcached of at least 0.39, and the latest version in 10.04 and below
is 0.31, so you'll either need to do a manual build, grab it from the newer
repo, or go ahead and bite the bullet and upgrade. Oh, and run make from
a screen and walk away for awhile, it's not the fastest build ever.

I finished building around 1am last night, didn't get to the next stage yet.

I might try building on OSX today. I couldn't get it to work ~6 months ago,
but those issues may well be resolved by now.

-Chad

[0] https://github.com/facebook/hiphop-php/wiki/Building-and-Installing-on-Ubuntu-10.10

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Simetrical+wikilist at gmail

Mar 29, 2011, 7:28 AM

Post #15 of 42 (3238 views)
Permalink
Re: HipHop [In reply to]

On Mon, Mar 28, 2011 at 9:33 PM, Tim Starling <tstarling [at] wikimedia> wrote:
> Yes, that's true, and that's part of the reason I'm flagging this
> change on the mailing list. Domas says that the HipHop team is working
> on PHP 5.3 support, so maybe the issue won't come up. But yes, in
> principle, I am saying that we should support HipHop even when it
> means not using new features from PHP.
>
> PHP 5.3 might be cool, but so is cutting our power usage by half (pun
> intended).

Okay, then I'm all in favor.

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


magnusmanske at googlemail

Mar 29, 2011, 3:22 PM

Post #16 of 42 (3229 views)
Permalink
Re: HipHop [In reply to]

On Tue, Mar 29, 2011 at 3:28 PM, Aryeh Gregor
<Simetrical+wikilist [at] gmail> wrote:
> On Mon, Mar 28, 2011 at 9:33 PM, Tim Starling <tstarling [at] wikimedia> wrote:
>> Yes, that's true, and that's part of the reason I'm flagging this
>> change on the mailing list. Domas says that the HipHop team is working
>> on PHP 5.3 support, so maybe the issue won't come up. But yes, in
>> principle, I am saying that we should support HipHop even when it
>> means not using new features from PHP.
>>
>> PHP 5.3 might be cool, but so is cutting our power usage by half (pun
>> intended).
>
> Okay, then I'm all in favor.

Plus, free C++ MediaWiki parser ;-)

Seriously, there should be a way to turn the entire package into a
(huge) library; maybe transpile it and then replace the C++ code for
index.php with a manually written library interface?

Offline readers, scientific analysis tools, etc. could profit
massively from an always-current, fast C++ library...

Magnus

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


tstarling at wikimedia

Mar 30, 2011, 12:26 AM

Post #17 of 42 (3227 views)
Permalink
Re: HipHop [In reply to]

On 03/30/2011 12:51 AM, Chad wrote:
> For those of you on Ubuntu or other flavors of Debian, the guide at [0] wil
> pretty much walk you through it pain-free. One little gotcha: you need a
> libmemcached of at least 0.39, and the latest version in 10.04 and below
> is 0.31, so you'll either need to do a manual build, grab it from the newer
> repo, or go ahead and bite the bullet and upgrade. Oh, and run make from
> a screen and walk away for awhile, it's not the fastest build ever.

I saw that there are RPMs for CentOS, so I installed CentOS inside a
chroot inside Ubuntu 10.10 x86-64. Surprisingly, this was quite easy.
I put some notes at:

<http://www.mediawiki.org/wiki/User:Tim_Starling/HipHop_in_CentOS_chroot>

Of course, the downside is that you then have to work inside a chroot.
It's probably tolerable if you use the bind mount for /home that
schroot provides by default to store your files.

-- Tim Starling


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


arichards at wikimedia

Mar 30, 2011, 10:30 AM

Post #18 of 42 (3234 views)
Permalink
Re: HipHop [In reply to]

On 3/30/11 12:26 AM, Tim Starling wrote:
> On 03/30/2011 12:51 AM, Chad wrote:
>> For those of you on Ubuntu or other flavors of Debian, the guide at [0] wil
>> pretty much walk you through it pain-free. One little gotcha: you need a
>> libmemcached of at least 0.39, and the latest version in 10.04 and below
>> is 0.31, so you'll either need to do a manual build, grab it from the newer
>> repo, or go ahead and bite the bullet and upgrade. Oh, and run make from
>> a screen and walk away for awhile, it's not the fastest build ever.
> I saw that there are RPMs for CentOS, so I installed CentOS inside a
> chroot inside Ubuntu 10.10 x86-64. Surprisingly, this was quite easy.

Also, I've been told that there are VMs with HipHop already set up which
would save the pain of compiling it yourself. I haven't tried any of
them myself yet, but a quick Google search led me to this:

http://www.virtcloud.eu/?page=hiphop

And there are no doubt others.

Arthur

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


inez at wikia-inc

Mar 31, 2011, 12:26 AM

Post #19 of 42 (3261 views)
Permalink
Re: HipHop [In reply to]

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 <tstarling [at] wikimedia> 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 [at] lists
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


tstarling at wikimedia

Apr 3, 2011, 5:38 PM

Post #20 of 42 (3264 views)
Permalink
Re: HipHop [In reply to]

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 [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


brion at pobox

Apr 3, 2011, 7:11 PM

Post #21 of 42 (3200 views)
Permalink
Re: HipHop [In reply to]

On Sun, Apr 3, 2011 at 5:38 PM, Tim Starling <tstarling [at] wikimedia>wrote:

> 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.
>

Ain't that always the way ;)

[various more scary things mentioned]


> When I'm ready to write all this up properly, the following page will
> appear on mediawiki.org:
>
> http://www.mediawiki.org/wiki/HipHop


Wheeeeee! So far it sounds like most of these are things we can work around
reasonably sensibly, so mostly good news. Any remaining issues with 'scary
reference stuff' like stub objects, or do those semantics actually already
work for us?

-- brion
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


tstarling at wikimedia

Apr 3, 2011, 9:05 PM

Post #22 of 42 (3214 views)
Permalink
Re: HipHop [In reply to]

On 04/04/2011 12:11 PM, Brion Vibber wrote:
> Wheeeeee! So far it sounds like most of these are things we can work around
> reasonably sensibly, so mostly good news. Any remaining issues with 'scary
> reference stuff' like stub objects, or do those semantics actually already
> work for us?

I'm not expecting any problems with stub objects.

One piece of good news that I neglected to mention is that MediaWiki
appears to work almost unmodified under the HipHop command-line
interpreter, hphpi. I did some page views and edits in it. I think
this must be what Inez is doing, judging by his very short patch. If
there were any problems with things like references, you'd expect them
to show up there.

Stub objects would probably break with the compiler option
"AllDynamic" off, but so would a lot of things. That's why it's on in
the build scripts I've written.

-- Tim Starling


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


inez at wikia-inc

Apr 4, 2011, 11:31 AM

Post #23 of 42 (3254 views)
Permalink
Re: HipHop [In reply to]

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 <tstarling [at] wikimedia>wrote:

> 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 [at] lists
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Platonides at gmail

Apr 4, 2011, 2:31 PM

Post #24 of 42 (3197 views)
Permalink
Re: HipHop [In reply to]

Tim Starling wrote:
> 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.


Having to create a reflection class and look for exceptions just to
check for class existance is really ugly.
However, looking at https://github.com/facebook/hiphop-php/issues/314 it
seems to be a declaration before use problem (even though class_exists
shouldn't be declaring it). I suppose that we could work around that by
including all classes at the beginning instead of using the AutoLoader,
which shouldn't be needed for compiled code.


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


tstarling at wikimedia

Apr 4, 2011, 4:25 PM

Post #25 of 42 (3203 views)
Permalink
Re: HipHop [In reply to]

On 04/05/2011 04:31 AM, Inez Korczynski wrote:
> 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?

To compile:

hphp --target=cpp --format=exe --input-dir=. \
-i class-test.php -i class-test-2.php \
-i class-test-3.php -i define-test.php \
-c../compiler.conf --parse-on-demand=true \
--program=test --output-dir=build --log=4

where ../compiler.conf is the configuration file I checked in to
subversion in maintenance/hiphop, class-test*.php are the various
class declaration tests.

To execute:

build/test -f class-test.php

etc.

-- Tim Starling


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

First page Previous page 1 2 Next page Last page  View All Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.