* Daniel Friesen <lists(a)nadir-seen-fire.com> [Wed, 10 Nov 2010 05:54:51
-0800]:
Sorry, but the differences between PHP and JS are more
than you think.
Besides /x you're going to run into a bit of pain where /s is used.
And you'll be rearanging code a bit to cache RegExp's created through
string concatenation.
And there's the potential to be tripped up by associative arrays if
the
parser uses them.
And as for WYSIWYG, parsing is quite different, at least if you're
sane
enough to not want to re-run an extremely expensive
parser like the MW
one for every few character changes.
And then there are extensions...
The parser is heavy... even if you take into account how efficient JS
engines have become and the potential for them to be even faster at
executing the parser than php is you don't want a heavy directly
ported
parser doing the work handling message parsing client
side.
PHP will never come to browsers. However, there is the way to bring
Javascript to mod_php:
http://pecl.php.net/package/spidermonkey
It even has beta status, not alpha. Maybe even has a chance to be
included to Parser? However, one should not expect to find it at
"crippled" hosting. A good dedicated hosting / co-location is probably
required to compile / setup it yourself (though a most of MediaWiki
installations run from such hosting, not a crippled down ones).
The same language for server and client side would bring many
advantages. Like you don't have to re-implement something complex twice
in both languages, only the pars that are different for server / client.
Dmitriy